1494106904@f100.n242.z1.ftn>
Sylvain Lauzon wrote:
> > begin 644 masm2gas.zip
> > M4$L#!!0````(`-F`NB#)Q5YH`0<``$82```,````;6%S;3)G87,N
> Would you tell me what the number "644" is used for?
Glad you asked. :-)
uuencoding is rooted in unix, and 644 represents a file permission.
It is more-or-less a text file permission. 755 would be an executable.
The bitmap: 4 2 1 = r w x (read, write, exec) and 3 ownership fields.
644 = -rw-r--r-- 755 = -rwxr-xr-x
UNIX. Gotta love it. I've been fooling a bit with assembly programming
under Linux, and Pieter de Jong has shown me a method to bypass the
C library and apparently talk straight to the kernel via int 80h.
But something is wrong here. This produces a clean executable when linked
with gcc (the compiler), but when linked with ld (the linker) directly
(ld -o int80 int80.o), the program segfaults and dumps core. Now if I
could just figure out the debugger....
;nasm -f elf int80.asm -o int80.o
;gcc int80.o -o int80
;
section .text
global _start
_start:
mov edx, 07h ; write 0x07 characters
mov ecx, msg ; address of msg
mov ebx, 0h ; write to stdout
mov eax, 4h ; syscall write (see asm/unistd.h)
int 80h ; trap
ret
msg:
db 'Hello!', 0Ah
... The Moon is Waxing Crescent (3% of Full)
--- ifmail v.2.9-tx8.1 (i386-linux)
---------------
* Origin: (jvahn@short.circuit.com) (1:346/15.1)
|