ODD One out Quiz

Saturday, 8 February 2014

Algorithm of Pass1 Assembler In System Programming.



Algorithm of Pass1 Assembler
Step1:- Start
Step2:- Set Location Counter (LC)=0
Step3:- Read Card   [Read1]
Step4:- If Pseudo-opcode is Present [POTGET1]
            Then Go to step 5.
            Else
a)      Search Machine-opcode [MOTGET]
b)      Set L <- Length
c)      Process any literal, enter into literal table[LTSTO]
d)     Go to step6
Step5:- While (P-opcode !=END)                  //P-opcode means Pseudo-Opcode
            do
If(P–opcode ==DS || P-opcode ==DC)
Then
a)      Adjust LC to proper Alignment.
b)      Set L= Length of data field
c)      Go to Step 6
Else If(P-opcode == EQU) then
a)      Evaluate operand field (EVAL)
b)      Assign the value to symbol in label field[STSTO]
c)      Go to step 7
Else
a)      Go to step 7 and save the Using and Drop cards for pass 2.
End While
Step 6:- If(any symbol) then
a)      Assign current value of LC to symbol
b)      Set LC= LC+L
Else
a)      Set LC=LC+L
Step 7:- Write copy of card on file for use by pass 2 [Write 1] and Go to step3. Repeat this step (Go to step3) until all instructions are not processed.
Step 8:- If (P-opcode ==End)
               Then
a)      Assign storage location to literals [LITASS].
b)      Rewind and reset copy file.
c)      Move to Pass2.
Step 9:- Exit.

1 comment: