Is there any difference between them? I am using this code to jump from real mode to protected mode. the second one works.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Other than the length of the instruction (due to the longer absolute address encoded in it and any possibly required instruction prefixes) there’s no difference between the two whatsoever.
The two versions of the instruction behave identically.
You’re not restricted to using only the shorter version in 16-bit mode or only the longer version in 32-bit mode. As long as the address is valid (per the relevant segment descriptor in the GDT and then the underlying page tables, if any), the jump will just work.
UPDATE: Actually (found by trial and error:), you want to request the proper operand size specifically if the offset doesn’t fit into 16 bits.
Sample code:
Assembled as
nasm -f bin -l jmpabs.lst jmpabs.asm -o jmpabs.binproduces the following listing file: