10 M1 C2 SIC XE Assembler SolvedProblem
10 M1 C2 SIC XE Assembler SolvedProblem
Example 2: Generate the complete object program for SIC/XE program below.
Assume Opcode for LDA=00 CLEAR=B4 LDB=68 ADD=18 TIX=2C
JLT=38 STA=0C
SUM START 0
FIRST CLEAR X
LDA #0
+LDB #TOTAL
BASE TOTAL
LOOP ADD TABLE, X
TIX COUNT
JLT TOTAL
STA TOTAL
COUNTRESW 1
TABLE RESW 2000
TOTAL RESW 1
END FIRST
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 72
Machine dependent assembler features
LABEL OPCODE OPERAND
SUM START 0
FIRST CLEAR X
LDA #0
+LDB #TOTAL
BASE TOTAL
TIX COUNT
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 73
Machine dependent assembler features
LABEL OPCODE OPERAND
JLT TOTAL
STA TOTAL
COUNT RESW 1
TOTAL RESW 1
END FIRST
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 74
PASS 1
LOCCTR LABEL OPCODE OPERAND
SUM START 0
FIRST CLEAR X
LDA #0
+LDB #TOTAL
BASE TOTAL
TIX COUNT
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 75
PASS 1
LOCCTR LABEL OPCODE OPERAND
LDA #0
+LDB #TOTAL
BASE TOTAL
TIX COUNT
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 76
PASS 1
LOCCTR LABEL OPCODE OPERAND
LDA #0
+LDB #TOTAL
BASE TOTAL
TIX COUNT
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 77
PASS 1
LOCCTR LABEL OPCODE OPERAND
LDA #0
+LDB #TOTAL
BASE TOTAL
TIX COUNT
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 78
PASS 1
LOCCTR LABEL OPCODE OPERAND
LDA #0
+LDB #TOTAL
BASE TOTAL
TIX COUNT
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 79
PASS 1
LOCCTR LABEL OPCODE OPERAND
LDA #0
+LDB #TOTAL
BASE TOTAL
TIX COUNT
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 80
Object Program
7/10/2022 81
Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru
PASS 1
LOCCTR LABEL OPCODE OPERAND
+LDB #TOTAL
BASE TOTAL
TIX COUNT
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 82
PASS 1
LOCCTR LABEL OPCODE OPERAND
+LDB #TOTAL
BASE TOTAL
TIX COUNT
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 83
PASS 1
LOCCTR LABEL OPCODE OPERAND
+LDB #TOTAL
BASE TOTAL
TIX COUNT
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 84
SIC/XE Instruction Set Table
7/10/2022 85
Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru
PASS 1
LOCCTR LABEL OPCODE OPERAND
BASE TOTAL
TIX COUNT
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 86
PASS 1
LOCCTR LABEL OPCODE OPERAND
BASE TOTAL
TIX COUNT
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 87
SIC/XE Instruction Set Table
7/10/2022 88
Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru
PASS 1
LOCCTR LABEL OPCODE OPERAND
TIX COUNT
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 89
PASS 1
LOCCTR LABEL OPCODE OPERAND
TIX COUNT
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 90
PASS 1
LOCCTR LABEL OPCODE OPERAND
TIX COUNT
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 91
PASS 1
LOCCTR LABEL OPCODE OPERAND
TIX COUNT
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 92
PASS 1
LOCCTR LABEL OPCODE OPERAND
TIX COUNT
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 93
PASS 1
LOCCTR LABEL OPCODE OPERAND
TIX COUNT
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 94
Object Program
7/10/2022 95
Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru
PASS 1
LOCCTR LABEL OPCODE OPERAND
TIX COUNT
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 96
PASS 1
LOCCTR LABEL OPCODE OPERAND
7/10/2022 99
Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru
PASS 1
LOCCTR LABEL OPCODE OPERAND
STA TOTAL
COUNT RESW 1
TOTAL RESW 1
END FIRST
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 101
PASS 1
LOCCTR LABEL OPCODE OPERAND
STA TOTAL
COUNT RESW 1
TOTAL RESW 1
END FIRST
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 102
SIC/XE Instruction Set Table
7/10/2022 103
Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru
PASS 1
LOCCTR LABEL OPCODE OPERAND
STA TOTAL
COUNT RESW 1
TOTAL RESW 1
END FIRST
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 104
PASS 1
LOCCTR LABEL OPCODE OPERAND
COUNT RESW 1
TOTAL RESW 1
END FIRST
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 105
PASS 1
LOCCTR LABEL OPCODE OPERAND
COUNT RESW 1
TOTAL RESW 1
END FIRST
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 106
SIC/XE Instruction Set Table
7/10/2022 107
Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru
PASS 1
LOCCTR LABEL OPCODE OPERAND
COUNT RESW 1
TOTAL RESW 1
END FIRST
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 108
PASS 1
LOCCTR LABEL OPCODE OPERAND
TOTAL RESW 1
END FIRST
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 109
PASS 1
LOCCTR LABEL OPCODE OPERAND
TOTAL RESW 1
END FIRST
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 110
PASS 1
LOCCTR LABEL OPCODE OPERAND
TOTAL RESW 1
END FIRST
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 111
PASS 1
LOCCTR LABEL OPCODE OPERAND
TOTAL RESW 1
END FIRST
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 112
PASS 1
LOCCTR LABEL OPCODE OPERAND
TOTAL RESW 1
END FIRST
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 113
PASS 1
LOCCTR LABEL OPCODE OPERAND
END FIRST
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 114
PASS 1
LOCCTR LABEL OPCODE OPERAND
END FIRST
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 115
PASS 1
LOCCTR LABEL OPCODE OPERAND
END FIRST
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 116
PASS 1
LOCCTR LABEL OPCODE OPERAND
SYMBOL TABLE
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 122
Machine dependent assembler features
Example 2: Generate the complete object program for SIC/XE program below.
Assume Opcode for LDA=00 CLEAR=B4 LDB=68 ADD=18 TIX=2C
JLT=38 STA=0C
SUM START 0
FIRST CLEAR X
LDA #0
+LDB #TOTAL
BASE TOTAL
LOOP ADD TABLE, X
TIX COUNT
JLT TOTAL
STA TOTAL
COUNTRESW 1
TABLE RESW 2000
TOTAL RESW 1
END FIRST
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 123
Machine dependent assembler features
LABEL OPCODE OPERAND
SUM START 0
0002 LDA #0
TIX COUNT
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 124
Machine dependent assembler features
LABEL OPCODE OPERAND
SYMBOL TABLE
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 126
Machine dependent assembler features
LABEL OPCODE OPERAND
SUM START 0
0002 LDA #0
TIX COUNT
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 127
Machine dependent assembler features
LABEL OPCODE OPERAND OBJECT CODES
SUM START 0
0002 LDA #0
TIX COUNT
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 128
Machine dependent assembler features
LABEL OPCODE OPERAND OBJECT CODES
SUM START 0
0002 LDA #0
TIX COUNT
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 129
Machine dependent assembler features
LABEL OPCODE OPERAND OBJECT CODES
SUM START 0 -
0002 LDA #0
TIX COUNT
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 130
Machine dependent assembler features
LABEL OPCODE OPERAND OBJECT CODES
SUM START 0 -
0002 LDA #0
TIX COUNT
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 131
PASS 2
Symbol Value
CLEAR X (Label) (Address)
SUM 0000
FIRST 0000
LOOP 0009
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 132
PASS 2
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 133
PASS 2
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 134
PASS 2
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 135
PASS 2
Symbol Value
CLEAR X (Label) (Address)
SUM 0000
FIRST 0000
LOOP 0009
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 136
PASS 2
Symbol Value
CLEAR X (2 byte format) (Label) (Address)
SUM 0000
FIRST 0000
LOOP 0009
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 137
PASS 2
Symbol Value
CLEAR X (2 byte format) (Label) (Address)
SUM 0000
8 4 4 FIRST 0000
LOOP 0009
OPCODE r1 r2
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 138
PASS 2
Symbol Value
CLEAR X (2 byte format) (Label) (Address)
SUM 0000
8 4 4 FIRST 0000
LOOP 0009
OPCODE r1 r2
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 139
PASS 2
Symbol Value
CLEAR X (2 byte format) (Label) (Address)
SUM 0000
8 4 4 FIRST 0000
LOOP 0009
OPCODE r1 r2
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 140
PASS 2
Symbol Value
CLEAR X (2 byte format) (Label) (Address)
SUM 0000
8 4 4 FIRST 0000
LOOP 0009
OPCODE r1 r2
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 141
PASS 2
Symbol Value
CLEAR X (2 byte format) (Label) (Address)
SUM 0000
8 4 4 FIRST 0000
LOOP 0009
OPCODE r1 r2
COUNT 0015
TABLE 0018
1011 0100 TOTAL 1788
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 142
PASS 2
Symbol Value
CLEAR X (2 byte format) (Label) (Address)
SUM 0000
8 4 4 FIRST 0000
LOOP 0009
OPCODE r1 r2
COUNT 0015
TABLE 0018
1011 0100 TOTAL 1788
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 143
PASS 2
Symbol Value
CLEAR X (2 byte format) (Label) (Address)
SUM 0000
8 4 4 FIRST 0000
LOOP 0009
OPCODE r1 r2
COUNT 0015
TABLE 0018
1011 0100 TOTAL 1788
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 144
PASS 2
Symbol Value
CLEAR X (2 byte format) (Label) (Address)
SUM 0000
8 4 4 FIRST 0000
LOOP 0009
OPCODE r1 r2
COUNT 0015
TABLE 0018
1011 0100 0001 TOTAL 1788
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 145
PASS 2
Symbol Value
CLEAR X (2 byte format) (Label) (Address)
SUM 0000
8 4 4 FIRST 0000
LOOP 0009
OPCODE r1 r2
COUNT 0015
TABLE 0018
1011 0100 0001 TOTAL 1788
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 146
Note: r2 is not present in
the instruction
PASS 2
Symbol Value
CLEAR X (2 byte format) (Label) (Address)
SUM 0000
8 4 4 FIRST 0000
LOOP 0009
OPCODE r1 r2
COUNT 0015
TABLE 0018
1011 0100 0001 TOTAL 1788
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 147
Note: Encode the missing
operand with all 4 bits set to
PASS 2 zeros.
Symbol Value
CLEAR X (2 byte format) (Label) (Address)
SUM 0000
8 4 4 FIRST 0000
LOOP 0009
OPCODE r1 r2
COUNT 0015
TABLE 0018
1011 0100 0001 0000 TOTAL 1788
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 148
Generated target code
in Binary form
PASS 2
Symbol Value
CLEAR X (2 byte format) (Label) (Address)
SUM 0000
8 4 4 FIRST 0000
LOOP 0009
OPCODE r1 r2
COUNT 0015
TABLE 0018
1011 0100 0001 0000 TOTAL 1788
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 149
Generated target code
in Hexadecimal
PASS 2
Symbol Value
CLEAR X (2 byte format) (Label) (Address)
SUM 0000
8 4 4 FIRST 0000
LOOP 0009
OPCODE r1 r2
COUNT 0015
TABLE 0018
1011 0100 0001 0000 TOTAL 1788
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
B4 ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 150
Generated target code
in Hexadecimal
PASS 2
Symbol Value
CLEAR X (2 byte format) (Label) (Address)
SUM 0000
8 4 4 FIRST 0000
LOOP 0009
OPCODE r1 r2
COUNT 0015
TABLE 0018
1011 0100 0001 0000 TOTAL 1788
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
B4 1 ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 151
Generated target code
in Hexadecimal
PASS 2
Symbol Value
CLEAR X (2 byte format) (Label) (Address)
SUM 0000
8 4 4 FIRST 0000
LOOP 0009
OPCODE r1 r2
COUNT 0015
TABLE 0018
1011 0100 0001 0000 TOTAL 1788
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
B4 1 0 ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 152
Generated target code
in Hexadecimal
PASS 2
Symbol Value
CLEAR X (2 byte format) (Label) (Address)
SUM 0000
8 4 4 FIRST 0000
LOOP 0009
OPCODE r1 r2
COUNT 0015
TABLE 0018
1011 0100 0001 0000 TOTAL 1788
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
B4 1 0 ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 153
Machine dependent assembler features
LABEL OPCODE OPERAND OBJECT CODES
SUM START 0 -
0002 LDA #0
TIX COUNT
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 154
Machine dependent assembler features
LABEL OPCODE OPERAND OBJECT CODES
SUM START 0 -
0002 LDA #0
TIX COUNT
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 155
Machine dependent assembler features
LABEL OPCODE OPERAND OBJECT CODES
SUM START 0 -
0002 LDA #0
TIX COUNT
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 156
PASS 2
Symbol Value
LDA #0 (Label) (Address)
SUM 0000
FIRST 0000
LOOP 0009
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 158
PASS 2
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 159
PASS 2
• Not format 1 as
operand exists.
• Not format 2 as
operand is not a
register.
• Not format 4 as
operand is not
prefixed with +
LDA #0
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 160
PASS 2
Symbol Value
LDA #0 (Label) (Address)
SUM 0000
FIRST 0000
LOOP 0009
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
Symbol Value
LDA #0 ( 3 byte format ) (Label) (Address)
SUM 0000
FIRST 0000
LOOP 0009
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
Symbol Value
LDA #0 ( 3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Displacement/Data
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
Symbol Value
LDA #0 ( 3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Displacement/Data
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
Symbol Value
LDA #0 ( 3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Displacement/Data
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
Symbol Value
LDA #0 ( 3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Displacement/Data
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
Symbol Value
LDA #0 ( 3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Displacement/Data
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
Symbol Value
LDA #0 ( 3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Displacement/Data
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
Symbol Value
LDA #0 ( 3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Displacement/Data
COUNT 0015
TABLE 0018
0000 00 TOTAL 1788
SYMBOL TABLE
Symbol Value
LDA #0 ( 3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Displacement/Data
COUNT 0015
TABLE 0018
0000 00 TOTAL 1788
SYMBOL TABLE
Symbol Value
LDA #0 ( 3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Displacement/Data
COUNT 0015
TABLE 0018
0000 00 TOTAL 1788
SYMBOL TABLE
Symbol Value
LDA #0 ( 3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Displacement/Data
COUNT 0015
TABLE 0018
0000 00 TOTAL 1788
SYMBOL TABLE
Symbol Value
LDA #0 ( 3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Displacement/Data
COUNT 0015
TABLE 0018
0000 00 TOTAL 1788
SYMBOL TABLE
Symbol Value
LDA #0 ( 3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Displacement/Data
COUNT 0015
TABLE 0018
0000 00 0 1 TOTAL 1788
SYMBOL TABLE
register X
Symbol Value
LDA #0 ( 3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Displacement/Data
COUNT 0015
TABLE 0018
0000 00 0 1 TOTAL 1788
SYMBOL TABLE
Symbol Value
LDA #0 ( 3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Displacement/Data
COUNT 0015
TABLE 0018
0000 00 0 1 TOTAL 1788
SYMBOL TABLE
Symbol Value
LDA #0 ( 3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Displacement/Data
COUNT 0015
TABLE 0018
0000 00 0 1 0 TOTAL 1788
SYMBOL TABLE
Symbol Value
LDA #0 ( 3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Displacement/Data
COUNT 0015
TABLE 0018
0000 00 0 1 0 TOTAL 1788
SYMBOL TABLE
Symbol Value
LDA #0 ( 3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Displacement/Data
COUNT 0015
TABLE 0018
0000 00 0 1 0 TOTAL 1788
SYMBOL TABLE
Symbol Value
LDA #0 ( 3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Displacement/Data
COUNT 0015
TABLE 0018
0000 00 0 1 0 0 0 TOTAL 1788
SYMBOL TABLE
Symbol Value
LDA #0 ( 3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Displacement/Data
COUNT 0015
TABLE 0018
0000 00 0 1 0 0 0 TOTAL 1788
SYMBOL TABLE
Symbol Value
LDA #0 ( 3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Displacement/Data
COUNT 0015
TABLE 0018
0000 00 0 1 0 0 0 TOTAL 1788
SYMBOL TABLE
Symbol Value
LDA #0 ( 3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Displacement/Data
COUNT 0015
TABLE 0018
0000 00 0 1 0 0 0 TOTAL 1788
SYMBOL TABLE
Symbol Value
LDA #0 ( 3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Displacement/Data
COUNT 0015
TABLE 0018
0000 00 0 1 0 0 0 TOTAL 1788
SYMBOL TABLE
Symbol Value
LDA #0 ( 3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Displacement/Data
COUNT 0015
TABLE 0018
0000 00 0 1 0 0 0 TOTAL 1788
SYMBOL TABLE
Symbol Value
LDA #0 ( 3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Displacement/Data
COUNT 0015
TABLE 0018
0000 00 0 1 0 0 0 0 TOTAL 1788
SYMBOL TABLE
Symbol Value
LDA #0 ( 3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Displacement/Data
COUNT 0015
TABLE 0018
0000 00 0 1 0 0 0 0 TOTAL 1788
SYMBOL TABLE
Symbol Value
LDA #0 ( 3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Displacement/Data
COUNT 0015
TABLE 0018
0000 00 0 1 0 0 0 0 TOTAL 1788
SYMBOL TABLE
Symbol Value
LDA #0 ( 3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Displacement/Data
COUNT 0015
TABLE 0018
0000 00 0 1 0 0 0 0 0000 0000 0000 TOTAL 1788
SYMBOL TABLE
Symbol Value
LDA #0 ( 3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Displacement/Data
COUNT 0015
TABLE 0018
0000 00 0 1 0 0 0 0 0000 0000 0000 TOTAL 1788
SYMBOL TABLE
Symbol Value
LDA #0 ( 3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Displacement/Data
COUNT 0015
TABLE 0018
0000 00 0 1 0 0 0 0 0000 0000 0000 TOTAL 1788
SYMBOL TABLE
Symbol Value
LDA #0 ( 3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Displacement/Data
COUNT 0015
TABLE 0018
0000 00 0 1 0 0 0 0 0000 0000 0000 TOTAL 1788
SYMBOL TABLE
Symbol Value
LDA #0 ( 3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Displacement/Data
COUNT 0015
TABLE 0018
0000 00 0 1 0 0 0 0 0000 0000 0000 TOTAL 1788
SYMBOL TABLE
Symbol Value
LDA #0 ( 3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Displacement/Data
COUNT 0015
TABLE 0018
0000 00 0 1 0 0 0 0 0000 0000 0000 TOTAL 1788
SYMBOL TABLE
SUM START 0 -
0002 LDA #0
TIX COUNT
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 195
Machine dependent assembler features
LABEL OPCODE OPERAND OBJECT CODES
SUM START 0 -
TIX COUNT
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 196
Machine dependent assembler features
LABEL OPCODE OPERAND OBJECT CODES
SUM START 0 -
TIX COUNT
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 197
PASS 2
Symbol Value
+LDB #TOTAL (Label) (Address)
SUM 0000
FIRST 0000
LOOP 0009
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 199
PASS 2
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 200
PASS 2
• Format 4 as operand
is prefixed with +
+LDB #TOTAL
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 201
PASS 2
Symbol Value
+LDB #TOTAL (Label) (Address)
SUM 0000
FIRST 0000
LOOP 0009
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
Symbol Value
+LDB #TOTAL (4 byte format ) (Label) (Address)
SUM 0000
FIRST 0000
LOOP 0009
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
Symbol Value
+LDB #TOTAL (4 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 20 FIRST 0000
LOOP 0009
OPCODE n i x b p e Address
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
Symbol Value
+LDB #TOTAL (4 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 20 FIRST 0000
LOOP 0009
OPCODE n i x b p e Address
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
Symbol Value
+LDB #TOTAL (4 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 20 FIRST 0000
LOOP 0009
OPCODE n i x b p e Address
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
Symbol Value
+LDB #TOTAL (4 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 20 FIRST 0000
LOOP 0009
OPCODE n i x b p e Address
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
Symbol Value
+LDB #TOTAL (4 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 20 FIRST 0000
LOOP 0009
OPCODE n i x b p e Address
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
Symbol Value
+LDB #TOTAL (4 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 20 FIRST 0000
LOOP 0009
OPCODE n i x b p e Address
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
Symbol Value
+LDB #TOTAL (4 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 20 FIRST 0000
LOOP 0009
OPCODE n i x b p e Address
COUNT 0015
TABLE 0018
0110 10 1788
TOTAL
SYMBOL TABLE
Symbol Value
+LDB #TOTAL (4 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 20 FIRST 0000
LOOP 0009
OPCODE n i x b p e Address
COUNT 0015
TABLE 0018
0110 10 1788
TOTAL
SYMBOL TABLE
Symbol Value
+LDB #TOTAL (4 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 20 FIRST 0000
LOOP 0009
OPCODE n i x b p e Address
COUNT 0015
TABLE 0018
0110 10 1788
TOTAL
SYMBOL TABLE
Symbol Value
+LDB #TOTAL (4 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 20 FIRST 0000
LOOP 0009
OPCODE n i x b p e Address
COUNT 0015
TABLE 0018
0110 10 1788
TOTAL
SYMBOL TABLE
Symbol Value
+LDB #TOTAL (4 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 20 FIRST 0000
LOOP 0009
OPCODE n i x b p e Address
COUNT 0015
TABLE 0018
0110 10 1788
TOTAL
SYMBOL TABLE
Symbol Value
+LDB #TOTAL (4 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 20 FIRST 0000
LOOP 0009
OPCODE n i x b p e Address
COUNT 0015
TABLE 0018
0110 10 1788
TOTAL
SYMBOL TABLE
Symbol Value
+LDB #TOTAL (4 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 20 FIRST 0000
LOOP 0009
OPCODE n i x b p e Address
COUNT 0015
TABLE 0018
0000 0001 0111
0110 10 TOTAL 1788
1000 1000
SYMBOL TABLE
Symbol Value
+LDB #TOTAL (4 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 20 FIRST 0000
LOOP 0009
OPCODE n i x b p e Address
COUNT 0015
TABLE 0018
0000 0001 0111
0110 10 TOTAL 1788
1000 1000
SYMBOL TABLE
Symbol Value
+LDB #TOTAL (4 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 20 FIRST 0000
LOOP 0009
OPCODE n i x b p e Address
COUNT 0015
TABLE 0018
0000 0001 0111
0110 10 TOTAL 1788
1000 1000
SYMBOL TABLE
Symbol Value
+LDB #TOTAL (4 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 20 FIRST 0000
LOOP 0009
OPCODE n i x b p e Address
COUNT 0015
TABLE 0018
0000 0001 0111
0110 10 TOTAL 1788
1000 1000
SYMBOL TABLE
Symbol Value
+LDB #TOTAL (4 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 20 FIRST 0000
LOOP 0009
OPCODE n i x b p e Address
COUNT 0015
TABLE 0018
0000 0001 0111
0110 10 0 1 TOTAL 1788
1000 1000
SYMBOL TABLE
Symbol Value
+LDB #TOTAL (4 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 20 FIRST 0000
LOOP 0009
OPCODE n i x b p e Address
COUNT 0015
TABLE 0018
0000 0001 0111
0110 10 0 1 TOTAL 1788
1000 1000
SYMBOL TABLE
Symbol Value
+LDB #TOTAL (4 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 20 FIRST 0000
LOOP 0009
OPCODE n i x b p e Address
COUNT 0015
TABLE 0018
0000 0001 0111
0110 10 0 1 TOTAL 1788
1000 1000
SYMBOL TABLE
Symbol Value
+LDB #TOTAL (4 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 20 FIRST 0000
LOOP 0009
OPCODE n i x b p e Address
COUNT 0015
TABLE 0018
0000 0001 0111
0110 10 0 1 0 TOTAL 1788
1000 1000
SYMBOL TABLE
Symbol Value
+LDB #TOTAL (4 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 20 FIRST 0000
LOOP 0009
OPCODE n i x b p e Address
COUNT 0015
TABLE 0018
0000 0001 0111
0110 10 0 1 0 TOTAL 1788
1000 1000
SYMBOL TABLE
Symbol Value
+LDB #TOTAL (4 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 20 FIRST 0000
LOOP 0009
OPCODE n i x b p e Address
COUNT 0015
TABLE 0018
0000 0001 0111
0110 10 0 1 0 TOTAL 1788
1000 1000
SYMBOL TABLE
Symbol Value
+LDB #TOTAL (4 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 20 FIRST 0000
LOOP 0009
OPCODE n i x b p e Address
COUNT 0015
TABLE 0018
0000 0001 0111
0110 10 0 1 0 TOTAL 1788
1000 1000
SYMBOL TABLE
Symbol Value
+LDB #TOTAL (4 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 20 FIRST 0000
LOOP 0009
OPCODE n i x b p e Address
COUNT 0015
TABLE 0018
0000 0001 0111
0110 10 0 1 0 0 0 TOTAL 1788
1000 1000
SYMBOL TABLE
Symbol Value
+LDB #TOTAL (4 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 20 FIRST 0000
LOOP 0009
OPCODE n i x b p e Address
COUNT 0015
TABLE 0018
0000 0001 0111
0110 10 0 1 0 0 0 TOTAL 1788
1000 1000
SYMBOL TABLE
Symbol Value
+LDB #TOTAL (4 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 20 FIRST 0000
LOOP 0009
OPCODE n i x b p e Address
COUNT 0015
TABLE 0018
0000 0001 0111
0110 10 0 1 0 0 0 TOTAL 1788
1000 1000
SYMBOL TABLE
Symbol Value
+LDB #TOTAL (4 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 20 FIRST 0000
LOOP 0009
OPCODE n i x b p e Address
COUNT 0015
TABLE 0018
0000 0001 0111
0110 10 0 1 0 0 0 TOTAL 1788
1000 1000
SYMBOL TABLE
Symbol Value
+LDB #TOTAL (4 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 20 FIRST 0000
LOOP 0009
OPCODE n i x b p e Address
COUNT 0015
TABLE 0018
0000 0001 0111
0110 10 0 1 0 0 0 TOTAL 1788
1000 1000
SYMBOL TABLE
Symbol Value
+LDB #TOTAL (4 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 20 FIRST 0000
LOOP 0009
OPCODE n i x b p e Address
COUNT 0015
TABLE 0018
0000 0001 0111
0110 10 0 1 0 0 0 TOTAL 1788
1000 1000
SYMBOL TABLE
Symbol Value
+LDB #TOTAL (4 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 20 FIRST 0000
LOOP 0009
OPCODE n i x b p e Address
COUNT 0015
TABLE 0018
0000 0001 0111
0110 10 0 1 0 0 0 TOTAL 1788
1000 1000
SYMBOL TABLE
Symbol Value
+LDB #TOTAL (4 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 20 FIRST 0000
LOOP 0009
OPCODE n i x b p e Address
COUNT 0015
TABLE 0018
0000 0001 0111
0110 10 0 1 0 0 0 TOTAL 1788
1000 1000
SYMBOL TABLE
Symbol Value
+LDB #TOTAL (4 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 20 FIRST 0000
LOOP 0009
OPCODE n i x b p e Address
COUNT 0015
TABLE 0018
0000 0001 0111
0110 10 0 1 0 0 0 1 TOTAL 1788
1000 1000
SYMBOL TABLE
Symbol Value
+LDB #TOTAL (4 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 20 FIRST 0000
LOOP 0009
OPCODE n i x b p e Address
COUNT 0015
TABLE 0018
0000 0001 0111
0110 10 0 1 0 0 0 1 TOTAL 1788
1000 1000
SYMBOL TABLE
Symbol Value
+LDB #TOTAL (4 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 20 FIRST 0000
LOOP 0009
OPCODE n i x b p e Address
COUNT 0015
TABLE 0018
0000 0001 0111
0110 10 0 1 0 0 0 1 TOTAL 1788
1000 1000
SYMBOL TABLE
Symbol Value
+LDB #TOTAL (4 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 20 FIRST 0000
LOOP 0009
OPCODE n i x b p e Address
COUNT 0015
TABLE 0018
0000 0001 0111
0110 10 0 1 0 0 0 1 TOTAL 1788
1000 1000
SYMBOL TABLE
Symbol Value
+LDB #TOTAL (4 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 20 FIRST 0000
LOOP 0009
OPCODE n i x b p e Address
COUNT 0015
TABLE 0018
0000 0001 0111
0110 10 0 1 0 0 0 1 TOTAL 1788
1000 1000
SYMBOL TABLE
Symbol Value
+LDB #TOTAL (4 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 20 FIRST 0000
LOOP 0009
OPCODE n i x b p e Address
COUNT 0015
TABLE 0018
0000 0001 0111
0110 10 0 1 0 0 0 1 TOTAL 1788
1000 1000
SYMBOL TABLE
SUM START 0 -
TIX COUNT
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 241
Machine dependent assembler features
LABEL OPCODE OPERAND OBJECT CODES
SUM START 0 -
TIX COUNT
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 242
Machine dependent assembler features
LABEL OPCODE OPERAND OBJECT CODES
SUM START 0 -
TIX COUNT
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 243
Machine dependent assembler features
SIC/XE assembler
A few improvisations over SIC (already understood in the machine architectures)
1. PC relative vs Base Relative addressing
The assembler knows the content of PC
How does the assembler update PC?
Base Relative - under the control of the programmer
How to know the contents of Base register – BASE
Uses the same content until next BASE.
Why to use NOBASE?
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 244
Machine dependent assembler features
BASE
An assembler directive that informs the assembler what the base register will
contain.
The assembler assumes for addressing purposes that register B contains this
address until it encounters another BASE statement.
The statement BASE TOTAL informs the assembler that the base register will
contain the address of TOTAL.
The preceding instruction (LDB #TOTAL) loads this value into the register
during program execution.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 245
Machine dependent assembler features
NOBASE
Assembler directive informs the assembler what the base register will contain.
Later in the program it might be desirable to use register B for another purpose
(ex., as a temporary storage for a data value)
BASE and NOBASE are assembler directives and produce no executable code.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 246
Machine dependent assembler features
LABEL OPCODE OPERAND OBJECT CODES
SUM START 0 -
TIX COUNT
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 247
Machine dependent assembler features
LABEL OPCODE OPERAND OBJECT CODES
SUM START 0 -
TIX COUNT
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 248
Machine dependent assembler features
LABEL OPCODE OPERAND OBJECT CODES
SUM START 0 -
TIX COUNT
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 249
PASS 2
Symbol Value
ADD TABLE, X (Label) (Address)
SUM 0000
FIRST 0000
LOOP 0009
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 251
PASS 2
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 252
PASS 2
• Not format 1 as
operand exists.
• Not format 2 as
operand is not a
register.
• Not format 4 as
operand is not
prefixed with +
ADD TABLE, X
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 253
PASS 2
Symbol Value
ADD TABLE, X (Label) (Address)
SUM 0000
FIRST 0000
LOOP 0009
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 254
PASS 2
Symbol Value
ADD TABLE, X (3 byte format ) (Label) (Address)
SUM 0000
FIRST 0000
LOOP 0009
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 255
PASS 2
Symbol Value
ADD TABLE, X (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
Symbol Value
ADD TABLE, X (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
Symbol Value
ADD TABLE, X (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
Symbol Value
ADD TABLE, X (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
Symbol Value
ADD TABLE, X (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
Symbol Value
ADD TABLE, X (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0001 10 1788
TOTAL
SYMBOL TABLE
Symbol Value
ADD TABLE, X (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0001 10 1788
TOTAL
SYMBOL TABLE
Symbol Value
ADD TABLE, X (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0001 10 1788
TOTAL
SYMBOL TABLE
Symbol Value
ADD TABLE, X (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0001 10 1788
TOTAL
SYMBOL TABLE
Symbol Value
ADD TABLE, X (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0001 10 1788
TOTAL
SYMBOL TABLE
Symbol Value
ADD TABLE, X (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0001 10 1788
TOTAL
SYMBOL TABLE
Symbol Value
ADD TABLE, X (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0001 10 1788
TOTAL
SYMBOL TABLE
Symbol Value
ADD TABLE, X (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0001 10 1788
TOTAL
SYMBOL TABLE
Displacement = Target Address – PC
LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 268
PASS 2 - PC-relative
Symbol Value
ADD TABLE, X (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0001 10 1788
TOTAL
SYMBOL TABLE
Displacement = Target Address – PC
= TABLE – PC LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 269
PASS 2 - PC-relative
Symbol Value
ADD TABLE, X (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0001 10 1788
TOTAL
SYMBOL TABLE
Displacement = Target Address – PC
= TABLE – PC LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 270
PASS 2 - PC-relative
Symbol Value
ADD TABLE, X (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0001 10 1788
TOTAL
SYMBOL TABLE
Displacement = Target Address – PC
= TABLE – PC LDA=00 CLEAR=B4 LDB=68
= 0018 - PC ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 271
PASS 2 - PC-relative
Symbol Value
ADD TABLE, X (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0001 10 1788
TOTAL
SYMBOL TABLE
Displacement = Target Address – PC
= TABLE – PC LDA=00 CLEAR=B4 LDB=68
= 0018 - PC ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 272
Machine dependent assembler features
LABEL OPCODE OPERAND OBJECT CODES
SUM START 0 -
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 273
Machine dependent assembler features
LABEL OPCODE OPERAND OBJECT CODES
SUM START 0 -
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 274
PASS 2 - PC-relative
Symbol Value
ADD TABLE, X (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0001 10 1788
TOTAL
SYMBOL TABLE
Displacement = Target Address – PC
= TABLE – PC LDA=00 CLEAR=B4 LDB=68
= 0018 - PC ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 275
PASS 2 - PC-relative
Symbol Value
ADD TABLE, X (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0001 10 1788
TOTAL
SYMBOL TABLE
Displacement = Target Address – PC
= TABLE – PC LDA=00 CLEAR=B4 LDB=68
= 0018 - 000C ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 276
PASS 2 - PC-relative
Symbol Value
ADD TABLE, X (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0001 10 1788
TOTAL
SYMBOL TABLE
Displacement = Target Address – PC
= TABLE – PC LDA=00 CLEAR=B4 LDB=68
= 0018 - 000C ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
= 000C A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 277
PASS 2 - PC-relative
Symbol Value
ADD TABLE, X (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0001 10 0000 0000 1100 1788
TOTAL
SYMBOL TABLE
Displacement = Target Address – PC
= TABLE – PC LDA=00 CLEAR=B4 LDB=68
= 0018 - 000C ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
= 0 00C A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 278
PASS 2 - PC-relative
Symbol Value
ADD TABLE, X (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0001 10 0000 0000 1100 1788
TOTAL
SYMBOL TABLE
Displacement = Target Address – PC
= TABLE – PC LDA=00 CLEAR=B4 LDB=68
= 0018 - 000C ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
= 0 00C A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 279
PC relative
mode: b=0, p=1
PASS 2 - PC-relative
Symbol Value
ADD TABLE, X (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0001 10 0000 0000 1100 1788
TOTAL
SYMBOL TABLE
Displacement = Target Address – PC
= TABLE – PC LDA=00 CLEAR=B4 LDB=68
= 0018 - 000C ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
= 0 00C A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 280
PC relative
mode: b=0, p=1
PASS 2 - PC-relative
Symbol Value
ADD TABLE, X (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0001 10 0 1 0000 0000 1100 1788
TOTAL
SYMBOL TABLE
Displacement = Target Address – PC
= TABLE – PC LDA=00 CLEAR=B4 LDB=68
= 0018 - 000C ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
= 0 00C A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 281
PASS 2 - PC-relative
Symbol Value
ADD TABLE, X (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0001 10 0 1 0000 0000 1100 1788
TOTAL
SYMBOL TABLE
Displacement = Target Address – PC
= TABLE – PC LDA=00 CLEAR=B4 LDB=68
= 0018 - 000C ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
= 0 00C A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 282
PASS 2 - PC-relative
Symbol Value
ADD TABLE, X (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0001 10 0 1 0000 0000 1100 1788
TOTAL
SYMBOL TABLE
Displacement = Target Address – PC
= TABLE – PC LDA=00 CLEAR=B4 LDB=68
= 0018 - 000C ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
= 0 00C A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 283
No # or @
PASS 2 - PC-relative
Symbol Value
ADD TABLE, X (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0001 10 0 1 0000 0000 1100 1788
TOTAL
SYMBOL TABLE
Displacement = Target Address – PC
= TABLE – PC LDA=00 CLEAR=B4 LDB=68
= 0018 - 000C ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
= 0 00C A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 284
Neither
Indirect not
PASS 2 - PC-relative immediate
Symbol Value
ADD TABLE, X (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0001 10 1 1 0 1 0000 0000 1100 1788
TOTAL
SYMBOL TABLE
Displacement = Target Address – PC
= TABLE – PC LDA=00 CLEAR=B4 LDB=68
= 0018 - 000C ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
= 0 00C A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 285
Indexed
Mode ?
PASS 2 - PC-relative
Symbol Value
ADD TABLE, X (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0001 10 1 1 0 1 0000 0000 1100 1788
TOTAL
SYMBOL TABLE
Displacement = Target Address – PC
= TABLE – PC LDA=00 CLEAR=B4 LDB=68
= 0018 - 000C ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
= 0 00C A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 286
First operand is Ref. to memory
PASS 2 - PC-relative
Symbol Value
ADD TABLE, X (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0001 10 1 1 0 1 0000 0000 1100 1788
TOTAL
SYMBOL TABLE
Displacement = Target Address – PC
= TABLE – PC LDA=00 CLEAR=B4 LDB=68
= 0018 - 000C ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
= 0 00C A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 287
2nd Operand is Register X.
An indexed mode of addressing.
PASS 2 - PC-relative
Symbol Value
ADD TABLE, X (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0001 10 1 1 0 1 0000 0000 1100 1788
TOTAL
SYMBOL TABLE
Displacement = Target Address – PC
= TABLE – PC LDA=00 CLEAR=B4 LDB=68
= 0018 - 000C ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
= 0 00C A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 288
2nd Operand is Register X.
An indexed mode of addressing.
PASS 2 - PC-relative So, set flag x=1
Symbol Value
ADD TABLE, X (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0001 10 1 1 1 0 1 0000 0000 1100 1788
TOTAL
SYMBOL TABLE
Displacement = Target Address – PC
= TABLE – PC LDA=00 CLEAR=B4 LDB=68
= 0018 - 000C ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
= 0 00C A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 289
PASS 2 - PC-relative
Symbol Value
ADD TABLE, X (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0001 10 1 1 1 0 1 0000 0000 1100 1788
TOTAL
SYMBOL TABLE
Displacement = Target Address – PC
= TABLE – PC LDA=00 CLEAR=B4 LDB=68
= 0018 - 000C ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
= 0 00C A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 290
PASS 2 - PC-relative
Symbol Value
ADD TABLE, X (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0001 10 1 1 1 0 1 0000 0000 1100 1788
TOTAL
SYMBOL TABLE
Displacement = Target Address – PC
= TABLE – PC LDA=00 CLEAR=B4 LDB=68
= 0018 - 000C ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
= 0 00C A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 291
+ =>Format 4 => Flag e=1
No + =>Format 3 => Flag e=0
PASS 2 - PC-relative
Symbol Value
ADD TABLE, X (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0001 10 1 1 1 0 1 0000 0000 1100 1788
TOTAL
SYMBOL TABLE
Displacement = Target Address – PC
= TABLE – PC LDA=00 CLEAR=B4 LDB=68
= 0018 - 000C ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
= 0 00C A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 292
+ =>Format 4 => Flag e=1
No + =>Format 3 => Flag e=0
PASS 2 - PC-relative
Symbol Value
ADD TABLE, X (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0001 10 1 1 1 0 1 0 0000 0000 1100 1788
TOTAL
SYMBOL TABLE
Displacement = Target Address – PC
= TABLE – PC LDA=00 CLEAR=B4 LDB=68
= 0018 - 000C ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
= 0 00C A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 293
Generated target code
in Binary form
PASS 2 - PC-relative
Symbol Value
ADD TABLE, X (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0001 10 1 1 1 0 1 0 0000 0000 1100 1788
TOTAL
SYMBOL TABLE
Symbol Value
ADD TABLE, X (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0001 10 1 1 1 0 1 0 0000 0000 1100 1788
TOTAL
SYMBOL TABLE
Symbol Value
ADD TABLE, X (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0001 10 1 1 1 0 1 0 0000 0000 1100 1788
TOTAL
SYMBOL TABLE
Symbol Value
ADD TABLE, X (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0001 10 1 1 1 0 1 0 0000 0000 1100 1788
TOTAL
SYMBOL TABLE
Symbol Value
ADD TABLE, X (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0001 10 1 1 1 0 1 0 0000 0000 1100 1788
TOTAL
SYMBOL TABLE
SUM START 0 -
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 299
Machine dependent assembler features
LABEL OPCODE OPERAND OBJECT CODES
SUM START 0 -
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 300
Machine dependent assembler features
LABEL OPCODE OPERAND OBJECT CODES
SUM START 0 -
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 301
PASS 1
Symbol Value
TIX COUNT (Label) (Address)
SUM 0000
FIRST 0000
LOOP 0009
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 302
PASS 1
Symbol Value
TIX COUNT (3 byte format ) (Label) (Address)
SUM 0000
FIRST 0000
LOOP 0009
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 303
PASS 2
• Not format 1 as
operand exists.
• Not format 2 as
operand is not a
register.
• Not format 4 as
operand is not
prefixed with +
TIX COUNT
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 304
PASS 2
Symbol Value
TIX COUNT (Label) (Address)
SUM 0000
FIRST 0000
LOOP 0009
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 305
PASS 2
Symbol Value
TIX COUNT (3 byte format ) (Label) (Address)
SUM 0000
FIRST 0000
LOOP 0009
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 306
PASS 2
Symbol Value
TIX COUNT (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 307
PASS 2
Symbol Value
TIX COUNT (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 308
PASS 2
Symbol Value
TIX COUNT (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 309
PASS 2
Symbol Value
TIX COUNT (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 310
PASS 2
Symbol Value
TIX COUNT (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
0010 1100 The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 311
PASS 2
Symbol Value
TIX COUNT (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
0010 1100 The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 312
PASS 2
Symbol Value
TIX COUNT (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0010 11 1788
TOTAL
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
0010 1100 The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 313
PASS 2
Symbol Value
TIX COUNT (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0010 11 1788
TOTAL
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 314
No # or @
PASS 2
Symbol Value
TIX COUNT (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0010 11 1788
TOTAL
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 315
Neither
Indirect not
PASS 2 immediate
Symbol Value
TIX COUNT (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0010 11 1 1 1788
TOTAL
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 316
Indexed
Mode ?
PASS 2
Symbol Value
TIX COUNT (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0010 11 1 1 1788
TOTAL
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 317
Register X is not
present as a 2nd operand
PASS 2
Symbol Value
TIX COUNT (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0010 11 1 1 1788
TOTAL
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 318
Not Indexed Mode
PASS 2
Symbol Value
TIX COUNT (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0010 11 1 1 0 1788
TOTAL
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 319
Assemble
Operand
PASS 2
Symbol Value
TIX COUNT (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0010 11 1 1 0 1788
TOTAL
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 320
Assemble
Operand
PASS 2
Symbol Value
TIX COUNT (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0010 11 1 1 0 1788
TOTAL
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 321
Assemble
Operand
PASS 2
Symbol Value
TIX COUNT (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0010 11 1 1 0 1788
TOTAL
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 322
Assemble
Operand
PASS 2
Symbol Value
TIX COUNT (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0010 11 1 1 0 1788
TOTAL
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 323
Assemble
Operand
PASS 2 – PC Relative Mode ?
Symbol Value
TIX COUNT (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0010 11 1 1 0 1788
TOTAL
SYMBOL TABLE
Displacement = Target Address – PC
LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 324
Assemble
Operand
PASS 2 – PC Relative Mode ?
Symbol Value
TIX COUNT (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0010 11 1 1 0 1788
TOTAL
SYMBOL TABLE
Displacement = Target Address – PC
LDA=00 CLEAR=B4 LDB=68
= COUNT - PC ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 325
Assemble
Operand
PASS 2 – PC Relative Mode ?
Symbol Value
TIX COUNT (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0010 11 1 1 0 1788
TOTAL
SYMBOL TABLE
Displacement = Target Address – PC
LDA=00 CLEAR=B4 LDB=68
= COUNT - PC ADD=18 TIX=2C JLT=38 STA=0C
= The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 326
Assemble
Operand
PASS 2 – PC Relative Mode ?
Symbol Value
TIX COUNT (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0010 11 1 1 0 1788
TOTAL
SYMBOL TABLE
Displacement = Target Address – PC
LDA=00 CLEAR=B4 LDB=68
= COUNT - PC ADD=18 TIX=2C JLT=38 STA=0C
= 0015 - PC The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 327
Assemble
Operand
PASS 2 – PC Relative Mode ?
Symbol Value
TIX COUNT (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0010 11 1 1 0 1788
TOTAL
SYMBOL TABLE
Displacement = Target Address – PC
LDA=00 CLEAR=B4 LDB=68
= COUNT - PC ADD=18 TIX=2C JLT=38 STA=0C
= 0015 - PC The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 328
Machine dependent assembler features
LABEL OPCODE OPERAND OBJECT CODES
SUM START 0 -
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 329
Machine dependent assembler features
LABEL OPCODE OPERAND
Symbol Value
TIX COUNT (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0010 11 1 1 0 1788
TOTAL
SYMBOL TABLE
Displacement = Target Address – PC
LDA=00 CLEAR=B4 LDB=68
= COUNT - PC ADD=18 TIX=2C JLT=38 STA=0C
= 0015 - PC The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 331
Assemble
Operand
PASS 2 – PC Relative Mode ?
Symbol Value
TIX COUNT (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0010 11 1 1 0 1788
TOTAL
SYMBOL TABLE
Displacement = Target Address – PC
LDA=00 CLEAR=B4 LDB=68
= COUNT - PC ADD=18 TIX=2C JLT=38 STA=0C
= 0015 - 000F The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 332
Assemble
Operand
PASS 2 – PC Relative Mode ?
Symbol Value
TIX COUNT (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0010 11 1 1 0 1788
TOTAL
SYMBOL TABLE
Displacement = Target Address – PC
LDA=00 CLEAR=B4 LDB=68
= COUNT - PC ADD=18 TIX=2C JLT=38 STA=0C
= 0015 - 000F The mnemonic values for registers are:
= 0006 A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 333
Assemble
Operand
PASS 2 – PC Relative Mode ?
Symbol Value
TIX COUNT (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0010 11 1 1 0 1788
TOTAL
SYMBOL TABLE
Displacement = Target Address – PC
LDA=00 CLEAR=B4 LDB=68
= COUNT - PC ADD=18 TIX=2C JLT=38 STA=0C
= 0015 - 000F The mnemonic values for registers are:
= 0 006 A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 334
Assemble
Operand
PASS 2 – PC Relative Mode ?
Symbol Value
TIX COUNT (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0010 11 1 1 0 0000 0000 0110 1788
TOTAL
SYMBOL TABLE
Displacement = Target Address – PC
LDA=00 CLEAR=B4 LDB=68
= COUNT - PC ADD=18 TIX=2C JLT=38 STA=0C
= 0015 - 000F The mnemonic values for registers are:
= 0 006 A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 335
Assemble
Operand
PASS 2 – PC Relative Mode
Symbol Value
TIX COUNT (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0010 11 1 1 0 0000 0000 0110 1788
TOTAL
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 336
PASS 2 – PC Relative Mode
Symbol Value
TIX COUNT (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0010 11 1 1 0 0000 0000 0110 1788
TOTAL
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 337
PC relative
mode: b=0, p=1
PASS 2 – PC Relative Mode
Symbol Value
TIX COUNT (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0010 11 1 1 0 0000 0000 0110 1788
TOTAL
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 338
PC relative
mode: b=0, p=1
PASS 2 – PC Relative Mode
Symbol Value
TIX COUNT (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0010 11 1 1 0 0 1 0000 0000 0110 1788
TOTAL
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 339
+ =>Format 4 => Flag e=1
No + =>Format 3 => Flag e=0
PASS 2 – PC Relative Mode
Symbol Value
TIX COUNT (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0010 11 1 1 0 0 1 0000 0000 0110 1788
TOTAL
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 340
+ =>Format 4 => Flag e=1
No + =>Format 3 => Flag e=0
PASS 2 – PC Relative Mode
Symbol Value
TIX COUNT (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0010 11 1 1 0 0 1 0 0000 0000 0110 1788
TOTAL
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 341
Generated target code
in Binary form
PASS 2 – PC Relative Mode
Symbol Value
TIX COUNT (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0010 11 1 1 0 0 1 0 0000 0000 0110 1788
TOTAL
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 342
Generated target code
in Hexadecimal
PASS 2 – PC Relative Mode
Symbol Value
TIX COUNT (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0010 11 1 1 0 0 1 0 0000 0000 0110 1788
TOTAL
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
2F ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 343
Generated target code
in Hexadecimal
PASS 2 – PC Relative Mode
Symbol Value
TIX COUNT (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0010 11 1 1 0 0 1 0 0000 0000 0110 1788
TOTAL
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
2F 2 ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 344
Generated target code
in Hexadecimal
PASS 2 – PC Relative Mode
Symbol Value
TIX COUNT (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0010 11 1 1 0 0 1 0 0000 0000 0110 1788
TOTAL
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
2F 2 006 ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 345
Generated target code
in Hexadecimal
PASS 2 – PC Relative Mode
Symbol Value
TIX COUNT (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0010 11 1 1 0 0 1 1 0000 0000 0110 1788
TOTAL
SYMBOL TABLE
LDA=00 CLEAR=B4 LDB=68
2F 2 006 ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 346
Machine dependent assembler features
LABEL OPCODE OPERAND OBJECT CODES
SUM START 0 -
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 347
Machine dependent assembler features
LABEL OPCODE OPERAND OBJECT CODES
SUM START 0 -
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 348
Machine dependent assembler features
LABEL OPCODE OPERAND
Symbol Value
JLT TOTAL (Label) (Address)
SUM 0000
FIRST 0000
LOOP 0009
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
Symbol Value
JLT TOTAL (3 byte format ) (Label) (Address)
SUM 0000
FIRST 0000
LOOP 0009
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
Symbol Value
JLT TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
Symbol Value
JLT TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
Symbol Value
JLT TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
Symbol Value
JLT TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
Symbol Value
JLT TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
Symbol Value
JLT TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
Symbol Value
JLT TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0 01 1 1 0
TOTAL 1788
SYMBOL TABLE
Symbol Value
JLT TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0 01 1 1 0
TOTAL 1788
SYMBOL TABLE
Symbol Value
JLT TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0 01 1 1 0 1 1
TOTAL 1788
SYMBOL TABLE
Symbol Value
JLT TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0 01 1 1 0 1 1
TOTAL 1788
SYMBOL TABLE
Symbol Value
JLT TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0 01 1 1 0 1 1
TOTAL 1788
SYMBOL TABLE
Symbol Value
JLT TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0 01 1 1 0 1 1 0
TOTAL 1788
SYMBOL TABLE
Symbol Value
JLT TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0 01 1 1 0 1 1 0
TOTAL 1788
SYMBOL TABLE
Symbol Value
JLT TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0 01 1 1 0 1 1 0
TOTAL 1788
SYMBOL TABLE
Symbol Value
JLT TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0 01 1 1 0 1 1 0
TOTAL 1788
SYMBOL TABLE
Symbol Value
JLT TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0 01 1 1 0 1 1 0
TOTAL 1788
SYMBOL TABLE
Symbol Value
JLT TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0 01 1 1 0 1 1 0
TOTAL 1788
SYMBOL TABLE
Symbol Value
JLT TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0 01 1 1 0 1 1 0
TOTAL 1788
SYMBOL TABLE
Displacement = Target Address – PC
LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 369
Assemble
Operand
PASS 2 – PC Relative Mode?
Symbol Value
JLT TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0 01 1 1 0 1 1 0
TOTAL 1788
SYMBOL TABLE
Displacement = Target Address – PC
= TOTAL - PC LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 370
Assemble
Operand
PASS 2 – PC Relative Mode?
Symbol Value
JLT TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0 01 1 1 0 1 1 0
TOTAL 1788
SYMBOL TABLE
Displacement = Target Address – PC
= TOTAL - PC LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 371
Assemble
Operand
PASS 2 – PC Relative Mode?
Symbol Value
JLT TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0 01 1 1 0 1 1 0
TOTAL 1788
SYMBOL TABLE
Displacement = Target Address – PC
= TOTAL - PC LDA=00 CLEAR=B4 LDB=68
= 1788 - PC ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 372
Assemble
Operand
PASS 2 – PC Relative Mode?
Symbol Value
JLT TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0 01 1 1 0 1 1 0
TOTAL 1788
SYMBOL TABLE
Displacement = Target Address – PC
= TOTAL - PC LDA=00 CLEAR=B4 LDB=68
= 1788 - PC ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 373
Machine dependent assembler features
LABEL OPCODE OPERAND
Symbol Value
JLT TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0 01 1 1 0 1 1 0
TOTAL 1788
SYMBOL TABLE
Displacement = Target Address – PC
= TOTAL - PC LDA=00 CLEAR=B4 LDB=68
= 1788 - PC ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 376
Assemble
Operand
PASS 2 – PC Relative Mode?
Symbol Value
JLT TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0 01 1 1 0 1 1 0
TOTAL 1788
SYMBOL TABLE
Displacement = Target Address – PC
= TOTAL - PC LDA=00 CLEAR=B4 LDB=68
= 1788 - 0012 ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 377
Assemble
Operand
PASS 2 – PC Relative Mode?
Symbol Value
JLT TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0 01 1 1 0 1 1 0
TOTAL 1788
SYMBOL TABLE
Displacement = Target Address – PC
= TOTAL - PC LDA=00 CLEAR=B4 LDB=68
= 1788 – 0012 ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
= 1776 A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 378
1776 (16) does not fit
PASS 2 – PC Relative Mode? in 12-bit filed
Symbol Value
JLT TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0 01 1 1 0 1 1 0
TOTAL 1788
SYMBOL TABLE
Displacement = Target Address – PC
= TOTAL - PC LDA=00 CLEAR=B4 LDB=68
= 1788 – 0012 ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
= 1776 A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 379
PC-relative mode
PASS 2 – PC Relative Mode? cannot be used.
Symbol Value
JLT TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0 01 1 1 0 1 1 0
TOTAL 1788
SYMBOL TABLE
Displacement = Target Address – PC
= TOTAL - PC LDA=00 CLEAR=B4 LDB=68
= 1788 – 0012 ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
= 1776 A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 380
PASS 2 – Base Relative Mode?
Symbol Value
JLT TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0 01 1 1 0 1 1 0
TOTAL 1788
SYMBOL TABLE
Displacement = Target Address – (B)
LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 381
PASS 2 – Base Relative Mode?
Symbol Value
JLT TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0 01 1 1 0 1 1 0
TOTAL 1788
SYMBOL TABLE
Displacement = Target Address – (B)
= TOTAL - (B) LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 382
PASS 2 – Base Relative Mode?
Symbol Value
JLT TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0 01 1 1 0 1 1 0
TOTAL 1788
SYMBOL TABLE
Displacement = Target Address – (B)
= TOTAL - (B) LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 383
PASS 2 – Base Relative Mode?
Symbol Value
JLT TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0 01 1 1 0 1 1 0
TOTAL 1788
SYMBOL TABLE
Displacement = Target Address – (B)
= TOTAL - (B) LDA=00 CLEAR=B4 LDB=68
= 1788 – (B) ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 384
PASS 2 – Base Relative Mode?
Symbol Value
JLT TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0 01 1 1 0 1 1 0
TOTAL 1788
SYMBOL TABLE
Displacement = Target Address – (B)
= TOTAL - (B) LDA=00 CLEAR=B4 LDB=68
= 1788 – (B) ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 385
Base register B holds
address of
Machine dependent assembler features TOTAL=1788(16)
LABEL OPCODE OPERAND OBJECT CODES
SUM START 0 -
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 386
Loads register B with value of TOTAL Base register B holds
address of
Machine dependent assembler features TOTAL=1788(16)
LABEL OPCODE OPERAND OBJECT CODES
SUM START 0 -
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 387
(B) = 1788 Base register B holds
address of
Machine dependent assembler features TOTAL=1788(16)
LABEL OPCODE OPERAND OBJECT CODES
SUM START 0 -
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 388
PASS 2 – Base Relative Mode?
Symbol Value
JLT TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0 01 1 1 0 1 1 0
TOTAL 1788
SYMBOL TABLE
Displacement = Target Address – (B)
= TOTAL - (B) LDA=00 CLEAR=B4 LDB=68
= 1788 – (B) ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 389
PASS 2 – Base Relative Mode?
Symbol Value
JLT TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0 01 1 1 0 1 1 0
TOTAL 1788
SYMBOL TABLE
Displacement = Target Address – (B)
= TOTAL - (B) LDA=00 CLEAR=B4 LDB=68
= 1788 – 1788 ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 390
PASS 2 – Base Relative Mode?
Symbol Value
JLT TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0 01 1 1 0 1 1 0
TOTAL 1788
SYMBOL TABLE
Displacement = Target Address – (B)
= TOTAL - (B) LDA=00 CLEAR=B4 LDB=68
= 1788 – 1788 ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
= 0000 A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 391
PASS 2 – Base Relative Mode?
Symbol Value
JLT TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0 01 1 1 0 1 1 0
TOTAL 1788
SYMBOL TABLE
Displacement = Target Address – (B)
= TOTAL - (B) LDA=00 CLEAR=B4 LDB=68
= 1788 – 1788 ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
= 0 000 A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 392
PASS 2 – Base Relative Mode?
Symbol Value
JLT TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0 01 1 1 0 1 1 0 0000 0000 0000
TOTAL 1788
SYMBOL TABLE
Displacement = Target Address – (B)
= TOTAL - (B) LDA=00 CLEAR=B4 LDB=68
= 1788 – 1788 ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
= 0 000 A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 393
PASS 2 – Base Relative Mode?
Symbol Value
JLT TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0 01 1 1 0 1 1 0 0000 0000 0000
TOTAL 1788
SYMBOL TABLE
Displacement = Target Address – (B)
= TOTAL - (B) LDA=00 CLEAR=B4 LDB=68
= 1788 – 1788 ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
= 0000 A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 394
PASS 2 – Base Relative Mode
Symbol Value
JLT TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0 01 1 1 0 1 1 0 0000 0000 0000
TOTAL 1788
SYMBOL TABLE
Displacement = Target Address – (B)
= TOTAL - (B) LDA=00 CLEAR=B4 LDB=68
= 1788 – 1788 ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
= 0000 A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 395
PASS 2 – Base Relative Mode
Symbol Value
JLT TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0 01 1 1 0 1 1 0 1 0 0000 0000 0000
TOTAL 1788
SYMBOL TABLE
Displacement = Target Address – (B)
= TOTAL - (B) LDA=00 CLEAR=B4 LDB=68
= 1788 – 1788 ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
= 0000 A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 396
PASS 2 – Base Relative Mode
Symbol Value
JLT TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0 01 1 1 0 1 1 0 1 0 0000 0000 0000
TOTAL 1788
SYMBOL TABLE
Symbol Value
JLT TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0 01 1 1 0 1 1 0 1 0 0000 0000 0000
TOTAL 1788
SYMBOL TABLE
Symbol Value
JLT TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0 01 1 1 0 1 1 0 1 0 0 0000 0000 0000
TOTAL 1788
SYMBOL TABLE
Symbol Value
JLT TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0 01 1 1 0 1 1 0 1 0 0 0000 0000 0000
TOTAL 1788
SYMBOL TABLE
Symbol Value
JLT TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0 01 1 1 0 1 1 0 1 0 0 0000 0000 0000
TOTAL 1788
SYMBOL TABLE
Symbol Value
JLT TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0 01 1 1 0 1 1 0 1 0 0 0000 0000 0000
TOTAL 1788
SYMBOL TABLE
Symbol Value
JLT TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0 01 1 1 0 1 1 0 1 0 0 0000 0000 0000
TOTAL 1788
SYMBOL TABLE
Symbol Value
JLT TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0 01 1 1 0 1 1 0 1 0 0 0000 0000 0000
TOTAL 1788
SYMBOL TABLE
Symbol Value
STA TOTAL (Label) (Address)
SUM 0000
FIRST 0000
LOOP 0009
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
Symbol Value
STA TOTAL (3 byte format ) (Label) (Address)
SUM 0000
FIRST 0000
LOOP 0009
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
Symbol Value
STA TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
Symbol Value
STA TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
Symbol Value
STA TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
Symbol Value
STA TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
Symbol Value
STA TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
Symbol Value
STA TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
TOTAL 1788
SYMBOL TABLE
Symbol Value
STA TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0000 11 1788
TOTAL
SYMBOL TABLE
Symbol Value
STA TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0000 11 1788
TOTAL
SYMBOL TABLE
Symbol Value
STA TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0000 11 1788
TOTAL
SYMBOL TABLE
Symbol Value
STA TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0000 11 1788
TOTAL
SYMBOL TABLE
Symbol Value
STA TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0000 11 1 1 1788
TOTAL
SYMBOL TABLE
Symbol Value
STA TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0000 11 1 1 1788
TOTAL
SYMBOL TABLE
Symbol Value
STA TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0000 11 1 1 1788
TOTAL
SYMBOL TABLE
Symbol Value
STA TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0000 11 1 1 1788
TOTAL
SYMBOL TABLE
Symbol Value
STA TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0000 11 1 1 0 1788
TOTAL
SYMBOL TABLE
Symbol Value
STA TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0000 11 1 1 0 1788
TOTAL
SYMBOL TABLE
Symbol Value
STA TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0000 11 1 1 0 1788
TOTAL
SYMBOL TABLE
Symbol Value
STA TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0000 11 1 1 0 1788
TOTAL
SYMBOL TABLE
Symbol Value
STA TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0000 11 1 1 0 1788
TOTAL
SYMBOL TABLE
Symbol Value
STA TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0000 11 1 1 0 1788
TOTAL
SYMBOL TABLE
Displacement = Target Address – (PC)
= TOTAL - (PC) LDA=00 CLEAR=B4 LDB=68
ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 428
Assemble
Operand
PASS 2 – PC Relative ?
Symbol Value
STA TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0000 11 1 1 0 1788
TOTAL
SYMBOL TABLE
Displacement = Target Address – (PC)
= TOTAL - (PC) LDA=00 CLEAR=B4 LDB=68
= 1788 - (PC) ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 429
Assemble
Operand
PASS 2 – PC Relative ?
Symbol Value
STA TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0000 11 1 1 0 1788
TOTAL
SYMBOL TABLE
Displacement = Target Address – (PC)
= TOTAL - (PC) LDA=00 CLEAR=B4 LDB=68
= 1788 - (PC) ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 430
Machine dependent assembler features
LABEL OPCODE OPERAND
Symbol Value
STA TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0000 11 1 1 0 1788
TOTAL
SYMBOL TABLE
Displacement = Target Address – (PC)
= TOTAL - (PC) LDA=00 CLEAR=B4 LDB=68
= 1788 - (PC) ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 433
Assemble
Operand
PASS 2 – PC Relative ?
Symbol Value
STA TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0000 11 1 1 0 1788
TOTAL
SYMBOL TABLE
Displacement = Target Address – (PC)
= TOTAL - (PC) LDA=00 CLEAR=B4 LDB=68
= 1788 - 0015 ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 434
Assemble
Operand
PASS 2 – PC Relative ?
Symbol Value
STA TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0000 11 1 1 0 1788
TOTAL
SYMBOL TABLE
Displacement = Target Address – (PC)
= TOTAL - (PC) LDA=00 CLEAR=B4 LDB=68
= 1788 - 0015 ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
= 1773 A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 435
1773 (16) does not fit
PASS 2 – PC Relative ? in 12-bit filed
Symbol Value
STA TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0000 11 1 1 0 1788
TOTAL
SYMBOL TABLE
Displacement = Target Address – (PC)
= TOTAL - (PC) LDA=00 CLEAR=B4 LDB=68
= 1788 - 0015 ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
= 1773 A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 436
PASS 2 – Base Relative ?
Symbol Value
STA TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0000 11 1 1 0 1788
TOTAL
SYMBOL TABLE
Displacement = Target Address – (B)
= TOTAL - (B) LDA=00 CLEAR=B4 LDB=68
= 1788 - 1788 ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
= 0000 A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 437
PASS 2 – Base Relative ?
Symbol Value
STA TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0000 11 1 1 0 1788
TOTAL
SYMBOL TABLE
Displacement = Target Address – (B)
= TOTAL - (B) LDA=00 CLEAR=B4 LDB=68
= 1788 - 1788 ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
= 0000 A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 438
PASS 2 – Base Relative
Symbol Value
STA TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0000 11 1 1 0 0000 0000 0000 1788
TOTAL
SYMBOL TABLE
Displacement = Target Address – (B)
= TOTAL - (B) LDA=00 CLEAR=B4 LDB=68
= 1788 - 1788 ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
= 0000 A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 439
PASS 2 – Base Relative ?
Symbol Value
STA TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0000 11 1 1 0 0000 0000 0000 1788
TOTAL
SYMBOL TABLE
Displacement = Target Address – (B)
= TOTAL - (B) LDA=00 CLEAR=B4 LDB=68
= 1788 - 1788 ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
= 0000 A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 440
PASS 2 – Base Relative
Symbol Value
STA TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0000 11 1 1 0 1 0 0000 0000 0000 1788
TOTAL
SYMBOL TABLE
Displacement = Target Address – (B)
= TOTAL - (B) LDA=00 CLEAR=B4 LDB=68
= 1788 - 1788 ADD=18 TIX=2C JLT=38 STA=0C
The mnemonic values for registers are:
= 0000 A=0, X=1, L=2, B=3, S=4, T=5, F=6, PC=8, SW=9.
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 441
PASS 2 – Base Relative
Symbol Value
STA TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0000 11 1 1 0 1 0 0000 0000 0000 1788
TOTAL
SYMBOL TABLE
Symbol Value
STA TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0000 11 1 1 0 1 0 0000 0000 0000 1788
TOTAL
SYMBOL TABLE
Symbol Value
STA TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0000 11 1 1 0 1 0 0 0000 0000 0000 1788
TOTAL
SYMBOL TABLE
Symbol Value
STA TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0000 11 1 1 0 1 0 0 0000 0000 0000 1788
TOTAL
SYMBOL TABLE
Symbol Value
STA TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0000 11 1 1 0 1 0 0 0000 0000 0000 1788
TOTAL
SYMBOL TABLE
Symbol Value
STA TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0000 11 1 1 0 1 0 0 0000 0000 0000 1788
TOTAL
SYMBOL TABLE
Symbol Value
STA TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0000 11 1 1 0 1 0 0 0000 0000 0000 1788
TOTAL
SYMBOL TABLE
Symbol Value
STA TOTAL (3 byte format ) (Label) (Address)
SUM 0000
6 1 1 1 1 1 1 12 FIRST 0000
LOOP 0009
OPCODE n i x b p e Disp/Data
COUNT 0015
TABLE 0018
0000 11 1 1 0 1 0 0 0000 0000 0000 1788
TOTAL
SYMBOL TABLE
SUM START 0 -
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 461
Machine dependent assembler features
LABEL OPCODE OPERAND
Length Indicator
H^SUM ^000000^0178B
7/10/2022 463
Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru