Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Oct 31st, 2005, 8:04 PM   #1
zyd
Newbie
 
Join Date: Oct 2005
Posts: 11
Rep Power: 0 zyd is on a distinguished road
int 80h

Hello everyone. new guy in the neighbourhood.
i am starting to program in asm exclusively in linux, but i haven't found good information about the int 80h, just some vague notes.
Could anybody tell me of a paper or a site where i can find good information about this interruption.
Thanks in advance
zyd is offline   Reply With Quote
Old Oct 31st, 2005, 8:56 PM   #2
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Depends entirely upon the implementation and the last code that set it up.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Oct 31st, 2005, 9:06 PM   #3
zyd
Newbie
 
Join Date: Oct 2005
Posts: 11
Rep Power: 0 zyd is on a distinguished road
yes, i read that. But i heard that there are more than less estandarized formats. For example on linux x86, there ought to be a minimum standar, because if there were not, a program wouldn't be portable from one machine to another.
In /usr/include/asm/unistd.h there are the numbres of every single system call. I just need to know the parameters and the locations of them for every system call.
zyd is offline   Reply With Quote
Old Nov 1st, 2005, 6:29 AM   #4
splyxx
Newbie
 
Join Date: Nov 2005
Posts: 4
Rep Power: 0 splyxx is on a distinguished road
Hi,

http://www.lxhp.in-berlin.de/lhpsysc0.html

There's a lot of stuff at www.linuxassembly.org too. On a side note, I would not perform system calls directly if there's a chance to use libc. Doing so only requires linking with the library itself and the C runtime support module and specifying a runtime linker to use:

/home/splyxx [0]> cat test.asm
extern puts
global main

section .text

msg db 'hello world', 0

main:
        push dword msg
        call puts
        add esp, 4
        mov eax, 0
        ret

/home/splyxx [0]> nasm -f elf test.asm -o test.o
/home/splyxx [0]> ld test.o -o test /usr/lib/crti.o /usr/lib/crtn.o /usr/lib/crt1.o -lc --dynamic-linker /lib/ld-linux.so.2
/home/splyxx [0]> ./test
hello world
/home/splyxx [0]>

(The details may differ if you're using a new Linux system - this one is almost three years old - but you should be able to reverse-engineer what gcc does to link applications. If you link with libc, your assembly code will be portable to FreeBSD, NetBSD, OpenBSD (If you prepend libc functions with a ``_'' character even to a.out-based OpenBSD) and perhaps other x86 systems your assembler runs on.)

In fact you should invoke gcc instead of ld to link your application, unless you're writing your own compiler
splyxx is offline   Reply With Quote
Old Nov 1st, 2005, 10:17 AM   #5
zyd
Newbie
 
Join Date: Oct 2005
Posts: 11
Rep Power: 0 zyd is on a distinguished road
ok, that trick of linking the program against glibc, works just fine. But i am doing some research, and every single program in asm for linux x86 that i find uses the int 80h, and they are not so self-explanatory, so it would be nice to have some docs about it.
zyd is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 5:20 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC