Expressions and Program Blocks1
Expressions and Program Blocks1
blocks
Expressions
• Individual terms constants, user defined
symbols or special terms(current value of LOCCTR
designated by *)
• Eg:
106 BUFEND EQU *
Function
• Assembler passes the general info to loader.
• Loader perform linking operations.
Example :
• 3 CS are used in the program
• One for main program
• One for each subroutine
Example
15 0003 CLOOP +JSUB RDREC 48100000
• Operand RDREC – EXTREF. Assembler has no idea
where CS containing RDREC is loaded.
• Assembler inserts an address of zero and pass to
loader.
• No predictable relationship – no relative addressing is
possible. Hence extended format instruction.
190 0028 MAXLEN WORD BUFEND-BUFFER 000000
• When loaded, the loader will add to the data area the
address of BUFEND and subtract from it the address
of BUFFER to get the desired value.
Two records.
REFER RECORD
Col 1 -R
Col 2-7 - name of the symbol referred.
Col 8-73 - name of other ext reference
MODIFICATION RECORD
Col 1 -M
Col 2-7 - starting address of the field to be modified
relative to the beginning address of CS
Col 8-9 - length of the field to be modified in half byte
Col 10 - modification flag(+ or -)
Col 11-16 - external symbol whose value is to added to
or subtracted from the indicated field.
M 000004 05 + RDREC
BUFEND-BUFFER
RDREC-COPY.
ONE PASS ASSEMBLER
TWO TYPES
1. Produces object code directly in memory for immediate
execution
2. Produces object code for later execution
First type
• No object program is written, no loader is needed.
• Load and go – used for program development and
testing
Ex : university computing system for student use.
• Handling forward reference becomes less difficult.