> > What about in Linux or UNIX??
>
> JV>It is best to use libc calls- everything uses libc and you should too.
> JV>Two simple examples:
>
> What does puts do exactly.
Those are ANSI C functions, write a little C program with the -S
switch in gcc and it will generate assembly source to look at.
The C manuals will explain, the -S will show. (gcc -S source.c)
Here's a sample calling INT 80, but I *really* have very few clues
about this.
;nasm -f elf int80.asm -o int80.o
;then either:
; gcc int80.o -o int80
; ld -e main -o int80 int80.o
section .text
global main, msg
main:
mov edx, 07h ; write 0x7 characters
mov ecx, msg ; address of msg
mov ebx, 0h ; write to stdout
mov eax, 4h ; syscall write
int 80h ; trap
mov ebx, 0 ; zero the exit value
mov eax, 1h ; syscall exit
int 80h ; trap
ret ; never reached.
msg:
db 'Hello!', 0Ah
--- ifmail-tx (i386 Linux)
---------------
* Origin: jvahn@short.circuit.com (1:346/15.1@fidonet)
|