Download Assemblers and Loaders

Transcript
164 The Listing File
Ch. 5
The subtitle is different on each of our pages. This is the effect of the SUBTTL
directive, which itself is not listed.
The object code is simple and short. It occupies between one and three bytes
per source line and can therefore be easily included in the listing line. On other
computers, the object code may be longer and may have very different sizes for each
source line. In such cases, the assembler may devote, say, 8 printing positions to
the object code per listing line and, if the object code is longer, print the rest on a
second, and even a third, line. This is the situation on the VAX computer (see next
example) where each source line can generate between one and three 32-bit words.
Source line 00454 produces several constants. Its listing is, therefore, long, consisting of two lines.
5.2 A VAX Example
The next example is a typical listing produced by Macro, the VAX assembler.
It was produced by the single command:
MACRO /LIST /CROSS REFERENCE=(ALL) /NOOBJECT TEST
which itself deserves a few words:
The /LIST option is self explainable. The default value of this parameter is
/NOLIST.
The /CROSS REFERENCE=(ALL) produces a lot of cross-reference information. In
practice this is rarely needed, and the default value of this option is
/CROSS REFERENCE=(SYMBOLS,MACROS). The only important cross reference information is that of symbols. It can point to unused symbols that are, perhaps, the
result of mistyping.
The default value of /NOOBJECT is, of course, /OBJECT. The object file is normally
the most important output.
The word TEST is the name of the source file (its full name is TEST.MAR).
FIBONACCIS
30-OCT-1991 19:43:55 VAX MACRO V5.0-8
30-OCT-1991 18:38:08 SYS$USER3:[VACSC0HN]TEST.MAR;1
00000000’EF
00000000’EF
0000
00000000
0001 0000
0005 0002
00000000
0000 0000
0002
0002
0002
0002
B0 0002
1
2
3
4
5
6
7
8
9
10
11
one:
five:
.title Fibonaccis
.psect cons noexe,nowrt
.word 1
.word 5
.psect code exe,wrt
.entry fib,0
.macro move x,y,z
movw y,x
movw z,y
.endm move
movw one,a
Page 1
(1)