[prog] Linux assembly IRQ calls

Daniel. cristofd at hevanet.com
Fri Feb 20 15:07:58 EST 2004


>I know assembly programming in Linux is not
>popular, but I'm curious. Can anyone tell
>me where I can get a list of Linux IRQ calls
>and how to use them?
>This stuff was great fun back in DOS days.
>You could write tiny .COM programs back
>then that were lightning fast on a 22 MHz
>386.  I'm thinking of comverting them to
>ASM Linux to use in C programs. Just
>for the fun of it.

The Linux system call interface is a single instruction: int 0x80. 
All system calls are done via this interrupt. To make a system call, 
eax should contain a number that indicates which system call is being 
invoked, and other registers are used to hold the arguments, if any. 
If the system call takes one argument, it will be in ebx; a system 
call with two arguments will use ebx and ecx. Likewise, edx, esi, and 
edi are used if a third, fourth, or fifth argument is required, 
respectively. Upon return from a system call, eax will contain the 
return value. If an error occurs, eax will contain a negative value, 
with the absolute value indicating the error.

The numbers for the different system calls are listed in 
/usr/include/asm/unistd.h.

(Excerpted from http://www.muppetlabs.com/~breadbox/software/tiny/teensy.html)

-Daniel.
-- 
        ()  ASCII ribbon campaign      ()    Hopeless ribbon campaign
        /\    against HTML mail        /\  against gratuitous bloodshed


More information about the Programming mailing list