flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
0.1
i will post my useless examples for linux here.
i hope no one will have any problem with that ![]() _________________ Code: o__=- ) (\ /\ |
|||
![]() |
|
0.1
print first N prime numbers.
_________________ Code: o__=- ) (\ /\ |
|||||||||||
![]() |
|
0.1
Print first N terms of Fibonacci sequence.
_________________ Code: o__=- ) (\ /\ |
|||||||||||
![]() |
|
LocoDelAssembly
The examples inside http://lscr.sourceforge.net/ are worth for reading IMHO
|
|||
![]() |
|
Gilneas
Curses! That lscr archive is a tar bomb!
|
|||
![]() |
|
vid
write to user "arafel" on this board about problem.
Last edited by vid on 05 Dec 2007, 02:34; edited 1 time in total |
|||
![]() |
|
LocoDelAssembly
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. |
|||
![]() |
|
Gilneas
Find is really convenient in this case (instead of chmod -R)
cd lscr find -type d -exec chmod u+x {} \; |
|||
![]() |
|
andyz74
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... ![]() |
|||
![]() |
|
Dex4u
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 |
|||
![]() |
|
andyz74
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. |
|||
![]() |
|
Dex4u
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 |
|||
![]() |
|
andyz74
OK, that's it!
![]() I think I understood. Thanks for the help! ![]() |
|||
![]() |
|
m
lookup IP address of give host name.
usage: mygetip google.com
_________________ Attitude! |
|||||||||||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.