Hi..
GD> can someone tell me what this means please:
GD> jmp $+2
Yup..
$ represents the IP register. So, since the JMP instruction is 3 bytes long,
(1 byte opcode and 2 bytes destination) basicly this instruction will jump to
the next instruction that follows.
Why do you see this strange behaviour in code? If you jump to the next
instruction, why not just leave it out all together, or perhaps use NOP?
Bascily, JMP is used as a slightly longer delay than NOP. JMP flushes the
instruction prefetch queue and serialises pentium+ pipelines, so it acts as a
slightly longer delay than a NOP (which doesnt). JMP modifies no registers so
it is a more 'useful' delay than one built around LOOP, or dec + jnz
utines.
Some code does not function correctly (especially port accesses) unless
these very small delays are inserted into code. Some examples include driving
the parallel port Strobe line, Controlling A20, 8250 serial port chips, 8 bit
VGA's... etc etc.
Craig
--- FMail/386 1.20+
---------------
* Origin: Communications Barrier BBS (03) 9585 1112, 24hrs (3:632/533)
|