03-01-2013, 04:41 PM
System Software
1System Software.ppt (Size: 711 KB / Downloads: 35)
Introduction to Assemblers
Fundamental functions
translating mnemonic operation codes to their machine language equivalents
assigning machine addresses to symbolic labels
Machine dependency
different machine instruction formats and codes
Data transfer (RD, WD)
a buffer is used to store record
buffering is necessary for different I/O rates
the end of each record is marked with a null character (0016)
the end of the file is indicated by a zero-length record
Subroutines (JSUB, RSUB)
RDREC, WRREC
save link register first before nested jump
Assembler’s functions
Convert mnemonic operation codes to their machine language equivalents
Convert symbolic operands to their equivalent machine addresses
Build the machine instructions in the proper format
Convert the data constants to internal machine representations
Write the object program and the assembly listing
Literal - Implementation (1/3)
Literal pools
Normally literals are placed into a pool at the end of the program
see Fig. 2.10 (END statement)
In some cases, it is desirable to place literals into a pool at some other location in the object program
assembler directive LTORG
reason: keep the literal operand close to the instruction
Program Readability
Program readability
No extended format instructions on lines 15, 35, 65
No needs for base relative addressing (line 13, 14)
LTORG is used to make sure the literals are placed ahead of any large data areas (line 253)
Object code
It is not necessary to physically rearrange the generated code in the object program
see Fig. 2.13, Fig. 2.14
Load-and-go Assembler
Characteristics
Useful for program development and testing
Avoids the overhead of writing the object program out and reading it back
Both one-pass and two-pass assemblers can be designed as load-and-go.
However one-pass also avoids the over head of an additional pass over the source program
For a load-and-go assembler, the actual address must be known at assembly time, we can use an absolute program