I have made a utility.asm file which looks like thisThe difference between IRET and RET is that IRET pops an extra 2 bytes off the stack (the flags register is popped). An interrupt call always pushes the flags onto the stack before pushing on the far return address. In general, hardware interrupt handlers use an IRET statement while software interrupt handlers use a RETF 2 (far return) statement
Code: Select all
set_graphics_mode:
mov ah , 00h
int 10h
pop ax
ret
....etc
by
Code: Select all
mov ax , 00h
push ax
call set_graphics_mode
Basically is the iret only used at the end of your homemade interrupt or irq function or when a function is calling an interrupt and returning to the callee.
I know from the above quote iret pops the extra flags register on the stack. But apart from that I don't see if their is any other difference between iret and ret...?
As well when you call int 10h or something what gets pushed on the stack just the flags register?
Or could you do the equivalent of an int 10h call by
pushing the flags register eflags onto the stack
and doing a jump to the int 10 interrupt address in the IVT.
Curious?
Thanks for any help