JMP to a Far Address Lists Segment First in Listing File

ID Number: Q69540

6.00 | 6.00

MS-DOS | OS/2

Summary:

In the Macro Assembler (MASM) version 6.00, the opcode for a JMP to a

far address is shown in the listing file with the segment first, then

the offset. In the actual .OBJ file, the address is stored in the

reversed order (offset then segment).

More Information:

The following is the encoding for the JMP instruction from the listing

(.LST) file generated from the sample program below:

0000 EA ---- 0000 E jmp faddr

The above address for faddr (---- 0000) is displayed with the segment

listed first (----), then the offset(0000). Because the linker

resolves this address at link time, the actual segment and offset is

not known at assemble time, and is not listed in this file.

If you then look at the actual .OBJ or .EXE file produced by the above

code (by using CodeView, for example), you will see the offset first

in the file, then the segment.

This is expected behavior with MASM version 6.00 and is designed to

make the segment:offset more readable. This is different from MASM

version 5.10, which displayed the addresses for far JMP instructions

in the reversed (offset then segment) form.

Sample Code

-----------

; Assemble options needed: /c /Fl

.MODEL LARGE

EXTRN faddr:far

.CODE

jmp faddr

END