0

I have written a keyboard interrupt handler where in my ASM code I have an instruction iretd. When compiling the file, GCC returns an error saying

drivers/kbd_hndlr.S: Assembler messages:
drivers/kbd_hndlr.S:6: Error: no such instruction: `iretd'

I have searched on Google for solutions but I can't seem to find anything about iretd for the AT&T syntax. Is there any alternative I can use instead?

kbd_hndlr.S:

.global keyboard_handler
.extern keyboard_main

keyboard_handler:
        call keyboard_main
        iretd
  • 1
    How about just `IRET` ? – Michael Jun 11 '20 at 12:20
  • `iretd` is just being explicit about 32-bit operand-size. Possibly `iretl` in AT&T if there's any ambiguity. https://www.felixcloutier.com/x86/iret:iretd. As usual you could just disassemble machine code into AT&T syntax to find out what syntax GAS / objdump use. – Peter Cordes Jun 11 '20 at 12:31
  • Thank you very much Peter, that fixed the issue. – Jozef Nagy Jun 11 '20 at 12:38
  • With iret your code could function for 16,32,64 as written. Over specifying (ie. iretl) limits its applicability. That is rarely desirable. – mevets Jun 11 '20 at 12:43

0 Answers0