indirect far jmp (Developers)
> > That doesn't seem to have any advantages over just executing the
> > corresponding int opcode?
> Under normal circumstances I agree. There are times when it can be useful,
> e.g. see
> Art
> Of Assembly - Chapter Seventeen: Interrupts Traps and Exeptions for
> more info / better examples to use.
I was referring specifically to the case where you call an address stored in the IVT anyway; in that case, you'd generally need a reason to prefer the longer call form, for example because you specifically want to bypass a V86 Mode monitor's additional interrupt handling; or because you don't want the flags for the handler set the way the int instruction would by default. (The debugger sources that I have, from Japheth's simpler debugger (as used by FreeDOS), usually do this if to trace into an interrupt handler's code.)
> Also can be useful for obscuration / basic anti-disassembler trickery.
Of course, but that's not something I usually consider a concern ;)
> > where a jmp far is) sequence is useful when calling an interrupt handler
> > that isn't actually stored in the IVT.)
> Yup. e.g. under runcom etc.
Well, basically, to call the original one whenever any interrupt handler has been intercepted.
> > Hahah~ (You really shouldn't use the stack at 10000h though.)
> Indeed. That particular quick and dirty demo was to give a few friends a
> little puzzle a number of years ago; with a normal version of the same
> thing.
>
> Interestingly last night whilst quickly digging that out I did note a DOS
> compatibility bug in the versions of both DOSEmu and DOSBox that are on
> this little box. One of several Easter eggs that I expect you spotted in
> that code is to print my initials over the PS if the .COM program is typed
> from the DOS prompt, "TYPE MSG2MARK.COM"
Actually, I only looked at the machine code. But you're right, writing a 13 (CR) code to the console without a 10 (LF) code should just return to the start of the line, readying it for overwriting.
> however I noted it fails on both of the old versions of DOSEmu
> and DOSBox that are on this box.
That's a very basic compatibility thing (if unimportant) and it surprises me that it shouldn't work in those? (Even though DOSBox's support of DOS functions (especially internal ones) is known terrible generally.) Maybe they fixed it in the newer versions? I'm fairly certain that for private testing I fixed the CPU emulation of DOSBox ~0.74 orso at some point, and I didn't notice issues with my programs that sometimes use codes 10 and 13 separately. Then again, I always would boot an actual (hence, better) DOS kernel inside it instead of using the bad built-in one, so results might vary then.
> e.g. under DOSBox v0.73 EOF (1Ah) is ignored.
That is inside the TYPE command's implementation I think. If you use FreeCOM's TYPE instead, maybe it'd work. (I don't know whether FreeCOM properly runs on DOSBox's built-in DOS though.)
> Likewise the DOSEmu ignores the CR
> (0Dh) - as both are older versions (due to this box) I will at some point
> test to see if bugs present in newer versions. Obviously not critical bugs
> however there are a number of programs/data that use character tricks (inc.
> 08h) as "type" easter eggs.
Well, in actual program output, I use 13 without 10 to overwrite a more-type prompt when it has been acknowledged, and I often use 10 without 13 in stored messages when several consecutive linebreaks are to be displayed. I'm not yet using code 8, but I might enhance my programs' output with LESS-style highlighting which heavily employs 8, which will either cause the normal "unenhanced" output to be visible, or make the LESS-compatible display highlight the output in whatever way it does. (The highlighting methods are called "underlined" and "bold", but the simple text-mode parser that I use will instead display the highlighted parts in yellow and green respectively.)
---
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