Monday, November 15, 2010

ljmp, outb

ljmp 0xa000, 0x0000
this instruction will set the CS to 0xa000 and set the EIP 0x0000. Bascially, it will start to execute code at location CS*16 + EIP = 0xa0000

in real mode, if you write:
jmp 0xa0000, it won't work, it will have compile errors. because there is only 16 bits.

see first part is CS, second part is EIP
http://docs.sun.com/app/docs/doc/805-4693/6j4emccqq?l=ru&a=view

please also see wiki jmp instruction
http://en.wikipedia.org/wiki/JMP_%28x86_instruction%29


outb %al, (%dx)
outb %al, %dx
outb %al, 0x80

oub instruction only could out to value stores at dx, or immeidate values.
please see more inforamtion from
"Intel Architecture Software Developer's Manual, Volume 2: Instruction Set Reference Manual

No comments: