flat assembler
Message board for the users of flat assembler.
Index
> Linux > some examples for linux |
Author |
|
0.1 24 Sep 2007, 05:22
i will post my useless examples for linux here.
i hope no one will have any problem with that _________________ Code: o__=- ) (\ /\ |
|||
24 Sep 2007, 05:22 |
|
0.1 24 Sep 2007, 05:24
print first N prime numbers.
_________________ Code: o__=- ) (\ /\ |
|||||||||||
24 Sep 2007, 05:24 |
|
0.1 25 Sep 2007, 05:02
Print first N terms of Fibonacci sequence.
_________________ Code: o__=- ) (\ /\ |
|||||||||||
25 Sep 2007, 05:02 |
|
LocoDelAssembly 03 Dec 2007, 19:19
The examples inside http://lscr.sourceforge.net/ are worth for reading IMHO
|
|||
03 Dec 2007, 19:19 |
|
Gilneas 04 Dec 2007, 22:22
Curses! That lscr archive is a tar bomb!
|
|||
04 Dec 2007, 22:22 |
|
vid 05 Dec 2007, 00:13
write to user "arafel" on this board about problem.
Last edited by vid on 05 Dec 2007, 02:34; edited 1 time in total |
|||
05 Dec 2007, 00:13 |
|
LocoDelAssembly 05 Dec 2007, 01:39
haha, I interpreted that as "the package is great!"
I have noticed a problem with it, the directories are all marked as not executable so only root can enter on them... I fixed it by using a recursive chmod +x but that also gave execution permission to anything... I'm on Windows now but I think I did "chmod -R +x lscr". Perhaps there is a way to uncompress it without this problem but I don't know and in fact this is the only TAR with that I have this trouble so far. I have not contacted him about this because I'm still unsure of the problem's cause, so if someone confirms that the package is improperly TARed please report. |
|||
05 Dec 2007, 01:39 |
|
Gilneas 06 Dec 2007, 06:33
Find is really convenient in this case (instead of chmod -R)
cd lscr find -type d -exec chmod u+x {} \; |
|||
06 Dec 2007, 06:33 |
|
andyz74 06 Dec 2007, 08:18
Apropos roots and rights and attributes...
I found somewhere this little asm-prog, which creates a file and saves a string in it, but it doesn't care for user rights, so the normal user can't read, what is written in the file. (Surely can he chmod it in the necessary way as root, but it would be comfortable, if the asm-prog would do this automatically) I hope U understand, what I mean. Here's the code, what have I to insert, for correcting the read-write-rights of the data file? Code: format elf executable mov eax,8 ;call 8 for creating file mov ebx,f ;ebx is loaded with the filename int 128 mov ebx,eax ;mov file descriptor into ebx mov eax,4 mov ecx,msg mov edx,size int 128 mov eax,6 ;call 6 for close file int 128 mov eax,1 int 128 f db 'Hello',0 msg db 'Hello File!!!',10 size = $-msg BTW, I don't know, who's the origin author of this code, so please don't blame me for ripping code... |
|||
06 Dec 2007, 08:18 |
|
Dex4u 06 Dec 2007, 20:41
Try this:
Code: format elf executable mov eax,8 ;call 8 for creating file mov ebx,f ;ebx is loaded with the filename mov ecx,0x1a4 int 128 mov ebx,eax ;mov file descriptor into ebx mov eax,4 mov ecx,msg mov edx,size int 128 mov eax,6 ;call 6 for close file int 128 mov eax,1 int 128 f db 'Hello',0 msg db 'Hello File!!!',10 size = $-msg |
|||
06 Dec 2007, 20:41 |
|
andyz74 07 Dec 2007, 13:29
OK, tested, works.
But... why? 1a4hex is 420 in dezimal ...and about chmod i think 1 is executable 2 is write 4 is read So I would have expected something like 644 or 664? I don't understand this one. |
|||
07 Dec 2007, 13:29 |
|
Dex4u 07 Dec 2007, 14:50
0x1a4 is 420 dec and 644 Octal, most write it as a Octal number
See here may help http://en.wikipedia.org/wiki/File_system_permissions#Octal_notation |
|||
07 Dec 2007, 14:50 |
|
andyz74 07 Dec 2007, 16:38
OK, that's it!
I think I understood. Thanks for the help! |
|||
07 Dec 2007, 16:38 |
|
m 18 Sep 2008, 15:20
lookup IP address of give host name.
usage: mygetip google.com
_________________ Attitude! |
|||||||||||
18 Sep 2008, 15:20 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.