Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

indirect far jmp - calling old INT problem (Developers)

posted by ecm Homepage E-mail, Düsseldorf, Germany, 15.05.2012, 18:53
(edited by cm on 15.05.2012, 19:10)

> INT 85h
> POP BP
> RETF 2
>
> RETF n usually doesn't even cross my mind as a way to end an ISR, since it
> has the potential to do undesirable things with the flags as discussed
> earlier. In this case, though, it would work just fine, and is more
> efficient than the IRET solution.

This only works if you restore the flags from [bp+6] into the actual flags first, and in that case you'll re-enable TF and IF (if set in the saved flags word) too early - before even calling the ROM BIOS's handler, here.

Edited: Actually I did some tests just now because I wasn't sure, and if you do a popf (setting TF) right before an int instruction, then it will trap only after the int has been called. (Verified in Real and (JEMM's) Virtual 86 Mode on my machine.) I don't know/am not sure that the same is true of interrupts and IF respectively though.

Then, of course, it would still notionally trap/interrupt too early (ie before popping bp in your above suggestion, instead of after/before the caller's next instruction), but you already know that.

---
l

 

Complete thread:

Back to the forum
Board view  Mix view
22760 Postings in 2121 Threads, 402 registered users (1 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum