3

I can't seem to find a good reference for NASM x86 interrupts on a Linux system. For example, what is int 0x60 and how is it different from int 0x80?

Is there a manual somewhere which will list all the interrupt numbers which can be used in conjunction with the int instruction?

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
Richard JP Le Guen
  • 28,364
  • 7
  • 89
  • 119
  • +1 for the nostalgia... Below there are the breadcrumbs to home :-) – xanatos Mar 13 '11 at 16:17
  • 0x60 and 0x80 are numbers, and NASM has not a single thing in the world to do with it -- it doesn't do anything with those numbers besides copy them from the input to the output. – hobbs Mar 13 '11 at 16:19
  • 0x80 sounds like the syscall handler on various Linuxes. But as was mentioned, it depends on the system. int3 (separate instruction) on Windows is a break point into the debugger, for example. – 0xC0000022L Mar 13 '11 at 16:19

2 Answers2

5

Linux only uses int 0x80 (or sysenter or syscall), with a call number in EAX. Check unistd_32.h, and see


For 16-bit x86, there's a long history of different interrupt numbers for different groups of interfaces, often with a call number in just AH.

There is the Ralph Brown's... It's soo many years...

Instead of looking for a grain of sand in the desert, you could ask directions to Wiki:

BIOS

DOS

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
xanatos
  • 109,618
  • 12
  • 197
  • 280
3

You can use any number from 1 to 255. Those are software generated interrupts

But the meaning/behaviour of it will pretty much depend on the operating system you are running it on! Or more exactly on the registered routine in the IDT that will handle that interrupt.

Richard JP Le Guen
  • 28,364
  • 7
  • 89
  • 119
dreyercito
  • 64
  • 2
  • 1
    Interrupt 0 is also valid to use. Interrupts 0 to 31 are used by the CPU for faults too, but 0 is no different from 1 regarding that. – ecm Mar 24 '20 at 14:11
  • Note that in protected mode, the `int 0` is different from actually triggering a `#DE` exception, e.g. via `div edx`. The IDT entries may not allow user-space to call into the exception handlers with `int`, especially `#PF`, only allow entry from triggering the faults "organically". – Peter Cordes Sep 06 '21 at 06:18