PRB: Jumping to an Absolute Address with MASM (49900)
The information in this article applies to:
- Microsoft Macro Assembler (MASM) 5.0
- Microsoft Macro Assembler (MASM) 5.1
- Microsoft Macro Assembler (MASM) 5.1a
- Microsoft Macro Assembler (MASM) 6.0
- Microsoft Macro Assembler (MASM) 6.0a
- Microsoft Macro Assembler (MASM) 6.0b
This article was previously published under Q49900 SYMPTOMS
The Microsoft Macro Assembler (MASM) will not let you jump directly to a
hexadecimal address. If you try to assemble:
jmp 0FFFFh:0000h
You will receive the error message:
A2038: left operand must have segment
CAUSE
This is the expected behavior for MASM. To make a jump to an absolute
address you must create a pointer to point to the offset inside of the
segment.
RESOLUTION
To create a pointer to point to the offset inside of the segment in
question you would create a segment at a specific location. For example:
bios SEGMENT AT 0FFFFh
ORG 0
reset LABEL FAR
bios ENDS
Then, any one of the following three jump instructions will perform the
jump to offset 0000h within segment FFFFh:
jmp FAR PTR reset
jmp bios:reset
jmp reset
Note that the opcode that is generated in the listing file is EA 0000 ----
Modification Type: | Major | Last Reviewed: | 10/17/2003 |
---|
Keywords: | KB49900 |
---|
|