indirect far jmp - calling old INT problem (Developers)
> 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:
- indirect far jmp in NASM - RayeR, 10.05.2012, 10:46 (Developers)
![Open in board view [Board]](img/board_d.gif)
![Open in mix view [Mix]](img/mix_d.gif)
- indirect far jmp in NASM - RayeR, 10.05.2012, 13:16
- indirect far jmp - ecm, 10.05.2012, 13:26
- indirect far jmp in NASM - Rugxulo, 10.05.2012, 13:26
- indirect far jmp in NASM - RayeR, 10.05.2012, 14:07
- indirect far jmp - ecm, 10.05.2012, 15:17
- indirect far jmp - RayeR, 11.05.2012, 00:47
- indirect far jmp - ecm, 11.05.2012, 12:46
- indirect far jmp - bretjohn, 11.05.2012, 18:53
- indirect far jmp - RayeR, 11.05.2012, 19:31
- indirect far jmp - bretjohn, 11.05.2012, 22:31
- indirect far jmp - ecm, 11.05.2012, 22:33
- indirect far jmp - RayeR, 12.05.2012, 00:33
- indirect far jmp - Arjay, 12.05.2012, 01:07
- indirect far jmp - ecm, 12.05.2012, 01:27
- indirect far jmp - Arjay, 12.05.2012, 11:09
- indirect far jmp - ecm, 12.05.2012, 21:18
- indirect far jmp - Arjay, 12.05.2012, 11:09
- indirect far jmp - RayeR, 12.05.2012, 21:17
- indirect far jmp/call - Chaining Interrupt Service Routines - Arjay, 13.05.2012, 13:16
- indirect far jmp - ecm, 12.05.2012, 01:27
- indirect far jmp - calling old INT problem - RayeR, 13.05.2012, 04:01
- indirect far jmp - calling old INT problem - ecm, 13.05.2012, 04:27
- indirect far jmp - calling old INT problem - RayeR, 13.05.2012, 15:33
- indirect far jmp - calling old INT problem - bretjohn, 13.05.2012, 17:05
- indirect far jmp - calling old INT problem - RayeR, 13.05.2012, 17:15
- indirect far jmp - calling old INT problem - RayeR, 13.05.2012, 19:19
- indirect far jmp - calling old INT problem - Rugxulo, 13.05.2012, 20:02
- indirect far jmp - calling old INT problem - RayeR, 13.05.2012, 20:49
- indirect far jmp - calling old INT problem - ecm, 13.05.2012, 23:49
- indirect far jmp - calling old INT problem - ecm, 13.05.2012, 23:40
- indirect far jmp - calling old INT problem - ecm, 14.05.2012, 00:07
- indirect far jmp - calling old INT problem - RayeR, 14.05.2012, 01:19
- indirect far jmp - calling old INT problem - ecm, 14.05.2012, 00:07
- indirect far jmp - calling old INT problem - Rugxulo, 13.05.2012, 20:02
- indirect far jmp - calling old INT problem - RayeR, 13.05.2012, 19:19
- indirect far jmp - calling old INT problem - RayeR, 13.05.2012, 17:15
- indirect far jmp - calling old INT problem - ecm, 13.05.2012, 23:44
- indirect far jmp - calling old INT problem - bretjohn, 14.05.2012, 18:30
- redundant override in "ss:bp" for clarity - ecm, 14.05.2012, 18:47
- indirect far jmp - calling old INT problem - RayeR, 14.05.2012, 18:50
- indirect far jmp - calling old INT problem - bretjohn, 14.05.2012, 20:16
- indirect far jmp - calling old INT problem - ecm, 14.05.2012, 20:21
- indirect far jmp - calling old INT problem - bretjohn, 14.05.2012, 21:42
- indirect far jmp - calling old INT problem - bretjohn, 15.05.2012, 18:45
- indirect far jmp - calling old INT problem - ecm, 15.05.2012, 18:53
- indirect far jmp - calling old INT problem - bretjohn, 15.05.2012, 20:13
- indirect far jmp - calling old INT problem - RayeR, 17.05.2012, 01:25
- indirect far jmp - calling old INT problem - bretjohn, 15.05.2012, 20:13
- indirect far jmp - calling old INT problem - ecm, 15.05.2012, 18:53
- indirect far jmp - calling old INT problem - bretjohn, 15.05.2012, 18:45
- indirect far jmp - calling old INT problem - bretjohn, 14.05.2012, 21:42
- indirect far jmp - calling old INT problem - ecm, 14.05.2012, 20:21
- indirect far jmp - calling old INT problem - bretjohn, 14.05.2012, 20:16
- indirect far jmp - calling old INT problem - bretjohn, 14.05.2012, 18:30
- indirect far jmp - calling old INT problem - bretjohn, 13.05.2012, 17:05
- indirect far jmp - calling old INT problem - RayeR, 13.05.2012, 15:33
- indirect far jmp - calling old INT problem - ecm, 13.05.2012, 04:27
- indirect far jmp - Arjay, 12.05.2012, 01:07
- indirect far jmp - RayeR, 12.05.2012, 00:33
- indirect far jmp - ecm, 11.05.2012, 22:33
- indirect far jmp - bretjohn, 11.05.2012, 22:31
- indirect far jmp - RayeR, 11.05.2012, 19:31
- indirect far jmp - RayeR, 11.05.2012, 00:47
- indirect far jmp - ecm, 10.05.2012, 15:17
- indirect far jmp in NASM - RayeR, 10.05.2012, 14:07
- indirect far jmp in NASM - RayeR, 10.05.2012, 13:16
Mix view