Beruflich Dokumente
Kultur Dokumente
Linkage Editor
Link objective code into executable file (*.obj *.exe)
17-May-12
FIGURE 71
Assembler
FIGURE 72
17-May-12
FIGURE 73
Assembly program
Machine instructions
MOV A, #0
Assembler Directives
Like Variable declaration in high-level language
Assembler controls
Conditional compiling
Comments
After ; to EOL . ; this is a comment
17-May-12
Example :
PAR EQU JNB 500 TI, $ ; #define symbol ; HERE: JNB TI, HERE
Constant expression
Implement by assembler Examples: MOV A, 9-0
17-May-12
Precedence of constant
() HIGH LOW / MOD SHR SHL +EQ NE LT LE GT GE = NOT AND OR XOR
Examples : ORG 100H ORG $+100H USING 3 PUSH AR7 ; now AR7 means $23H . END
17-May-12
segment_type can be one of CODE (program) XDATA (the extended data segment) DATA (direct address space, 00-7fH) IDATA (indirect address space, 00-7FH 80-FFH for 8052) BIT (bit address space) CSEG AT (equivalent to SEGMENT CODE) DSEG AT XSEG AT ISEG AT BSEG AT
17-May-12
(B) EQU
like the named constant define in C (#define)
10
Example 1: DSEG AT 30H EQU 40 DS LENGTH SEGMENT MOV MOV MOV BJNZ END CODE
LOOP: .
17-May-12
Example 2: XSEG AT 4000H EQU 1000 DS XLENGTH SEGMENT MOV CLR MOVX INC MOV CJNE MOV CJNE END CODE
FIGURE 74
17-May-12
FIGURE 75
FIGURE 76
17-May-12
FIGURE 76 (continued)
FIGURE 77
Linker operation
10
17-May-12
FIGURE 78a Annotated example: linking relocatable segments and modules. (a) ECHO.LST. (b) IO.LST. (c) EXAMPLE.M51.
FIGURE 78a Annotated example: linking relocatable segments and modules. (a) ECHO.LST. (b) IO.LST. (c) EXAMPLE.M51.
Symbol Table
11
17-May-12
Annotated example: linking relocatable segments and modules. (a) ECHO.LST. (b) IO.LST.
Output of linkage editor -Symbol table -Reallocatable address were computed already
12