0% found this document useful (0 votes)
498 views392 pages

10 M1 C2 SIC XE Assembler SolvedProblem

The document describes generating the object program for a SIC/XE assembly language program. It provides the opcode values for instructions and lists the program with labels, opcodes, and operands. The object program is generated in a multi-pass assembler process where addresses and machine-level instructions are assigned.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
498 views392 pages

10 M1 C2 SIC XE Assembler SolvedProblem

The document describes generating the object program for a SIC/XE assembly language program. It provides the opcode values for instructions and lists the program with labels, opcodes, and operands. The object program is generated in a multi-pass assembler process where addresses and machine-level instructions are assigned.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 392

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 72
Machine dependent assembler features
LABEL OPCODE OPERAND

SUM START 0

FIRST CLEAR X

LDA #0

+LDB #TOTAL

BASE TOTAL

LOOP ADD TABLE, X

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

TABLE RESW 2000

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

LOOP ADD TABLE, X

TIX COUNT

7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 75
PASS 1
LOCCTR LABEL OPCODE OPERAND

SUM START 0 Assembler Directive


Starting Address - 0
FIRST CLEAR X

LDA #0

+LDB #TOTAL

BASE TOTAL

LOOP ADD TABLE, X

TIX COUNT

7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 76
PASS 1
LOCCTR LABEL OPCODE OPERAND

SUM START 0 Assembler Directive


Starting Address - 0
0000 FIRST CLEAR X

LDA #0

+LDB #TOTAL

BASE TOTAL

LOOP ADD TABLE, X

TIX COUNT

7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 77
PASS 1
LOCCTR LABEL OPCODE OPERAND

SUM START 0 Assembler Directive


Starting Address - 0
0000 FIRST CLEAR X

LDA #0

+LDB #TOTAL

BASE TOTAL

LOOP ADD TABLE, X

TIX COUNT

7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 78
PASS 1
LOCCTR LABEL OPCODE OPERAND

SUM START 0 Assembler Directive


Starting Address - 0
0000 FIRST CLEAR X

LDA #0

+LDB #TOTAL

BASE TOTAL

LOOP ADD TABLE, X

TIX COUNT

7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 79
PASS 1
LOCCTR LABEL OPCODE OPERAND

SUM START 0 Assembler Directive


Starting Address - 0
0000 FIRST CLEAR X

LDA #0

+LDB #TOTAL

BASE TOTAL

LOOP ADD TABLE, X

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

SUM START 0 Assembler Directive


Starting Address - 0
0000 FIRST CLEAR X 2 byte instruction
Register-Register Instruction
LDA #0

+LDB #TOTAL

BASE TOTAL

LOOP ADD TABLE, X

TIX COUNT

7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 82
PASS 1
LOCCTR LABEL OPCODE OPERAND

SUM START 0 Assembler Directive


Starting Address - 0
0000 FIRST CLEAR X 2 byte instruction
Register-Register Instruction
0002 LDA #0

+LDB #TOTAL

BASE TOTAL

LOOP ADD TABLE, X

TIX COUNT

7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 83
PASS 1
LOCCTR LABEL OPCODE OPERAND

SUM START 0 Assembler Directive


Starting Address - 0
0000 FIRST CLEAR X 2 byte instruction
Register-Register Instruction
0002 LDA #0 3 byte instruction

+LDB #TOTAL

BASE TOTAL

LOOP ADD TABLE, X

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

SUM START 0 Assembler Directive


Starting Address - 0
0000 FIRST CLEAR X 2 byte instruction
Register-Register Instruction
0002 LDA #0 3 byte instruction

0005 +LDB #TOTAL

BASE TOTAL

LOOP ADD TABLE, X

TIX COUNT

7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 86
PASS 1
LOCCTR LABEL OPCODE OPERAND

SUM START 0 Assembler Directive


Starting Address - 0
0000 FIRST CLEAR X 2 byte instruction
Register-Register Instruction
0002 LDA #0 3 byte instruction

0005 +LDB #TOTAL

BASE TOTAL

LOOP ADD TABLE, X

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

SUM START 0 Assembler Directive


Starting Address - 0
0000 FIRST CLEAR X 2 byte instruction
Register-Register Instruction
0002 LDA #0 3 byte instruction

0005 +LDB #TOTAL Instruction is prefixed with +


4 byte instruction
BASE TOTAL

LOOP ADD TABLE, X

TIX COUNT
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 89
PASS 1
LOCCTR LABEL OPCODE OPERAND

SUM START 0 Assembler Directive


Starting Address - 0
0000 FIRST CLEAR X 2 byte instruction
Register-Register Instruction
0002 LDA #0 3 byte instruction

0005 +LDB #TOTAL Instruction is prefixed with +


4 byte instruction
0009 BASE TOTAL

LOOP ADD TABLE, X

TIX COUNT
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 90
PASS 1
LOCCTR LABEL OPCODE OPERAND

SUM START 0 Assembler Directive


Starting Address - 0
0000 FIRST CLEAR X 2 byte instruction
Register-Register Instruction
0002 LDA #0 3 byte instruction

0005 +LDB #TOTAL Instruction is prefixed with +


4 byte instruction
0009 BASE TOTAL

LOOP ADD TABLE, X

TIX COUNT
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 91
PASS 1
LOCCTR LABEL OPCODE OPERAND

SUM START 0 Assembler Directive


Starting Address - 0
0000 FIRST CLEAR X 2 byte instruction
Register-Register Instruction
0002 LDA #0 3 byte instruction

0005 +LDB #TOTAL Instruction is prefixed with +


4 byte instruction
0009 BASE TOTAL Assembler Directive-No Translation
Indicates assembler - Register B has
the value corresponding to TOTAL
LOOP ADD TABLE, X

TIX COUNT
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 92
PASS 1
LOCCTR LABEL OPCODE OPERAND

SUM START 0 Assembler Directive


Starting Address - 0
0000 FIRST CLEAR X 2 byte instruction
Register-Register Instruction
0002 LDA #0 3 byte instruction

0005 +LDB #TOTAL Instruction is prefixed with +


4 byte instruction
0009 BASE TOTAL Assembler Directive-No Translation
Register B has the value corresponding
to TOTAL
0009 LOOP ADD TABLE, X No update in the address

TIX COUNT
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 93
PASS 1
LOCCTR LABEL OPCODE OPERAND

SUM START 0 Assembler Directive


Starting Address - 0
0000 FIRST CLEAR X 2 byte instruction
Register-Register Instruction
0002 LDA #0 3 byte instruction

0005 +LDB #TOTAL Instruction is prefixed with +


4 byte instruction
0009 BASE TOTAL Assembler Directive-No Translation
Register B has the value corresponding
to TOTAL
0009 LOOP ADD TABLE, X

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

SUM START 0 Assembler Directive


Starting Address - 0
0000 FIRST CLEAR X 2 byte instruction
Register-Register Instruction
0002 LDA #0 3 byte instruction

0005 +LDB #TOTAL Instruction is prefixed with +


4 byte instruction
0009 BASE TOTAL Assembler Directive-No Translation
Register B has the value corresponding
to TOTAL
0009 LOOP ADD TABLE, X 3 byte instruction

TIX COUNT
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 96
PASS 1
LOCCTR LABEL OPCODE OPERAND

SUM START 0 Assembler Directive


Starting Address - 0
0000 FIRST CLEAR X 2 byte instruction
Register-Register Instruction
0002 LDA #0 3 byte instruction

0005 +LDB #TOTAL Instruction is prefixed with +


4 byte instruction
0009 BASE TOTAL Assembler Directive-No Translation
Register B has the value corresponding
to TOTAL
0009 LOOP ADD TABLE, X 3 byte instruction

000C TIX COUNT


7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 97
PASS 1
LOCCTR LABEL OPCODE OPERAND

SUM START 0 Assembler Directive


Starting Address - 0
0000 FIRST CLEAR X 2 byte instruction
Register-Register Instruction
0002 LDA #0 3 byte instruction

0005 +LDB #TOTAL Instruction is prefixed with +


4 byte instruction
0009 BASE TOTAL Assembler Directive-No Translation
Register B has the value corresponding
to TOTAL
0009 LOOP ADD TABLE, X 3 byte instruction

000C TIX COUNT


7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 98
SIC/XE Instruction Set Table

7/10/2022 99
Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru
PASS 1
LOCCTR LABEL OPCODE OPERAND

SUM START 0 Assembler Directive


Starting Address - 0
0000 FIRST CLEAR X 2 byte instruction
Register-Register Instruction
0002 LDA #0 3 byte instruction

0005 +LDB #TOTAL Instruction is prefixed with +


4 byte instruction
0009 BASE TOTAL Assembler Directive-No Translation
Register B has the value corresponding
to TOTAL
0009 LOOP ADD TABLE, X 3 byte instruction

000C TIX COUNT 3 byte instruction


7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 100
PASS 1
LOCCTR LABEL OPCODE OPERAND

000F JLT TOTAL

STA TOTAL

COUNT RESW 1

TABLE RESW 2000

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

000F JLT TOTAL

STA TOTAL

COUNT RESW 1

TABLE RESW 2000

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

000F JLT TOTAL 3 Byte instruction

STA TOTAL

COUNT RESW 1

TABLE RESW 2000

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

000F JLT TOTAL 3 Byte instruction

0012 STA TOTAL

COUNT RESW 1

TABLE RESW 2000

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

000F JLT TOTAL 3 Byte instruction

0012 STA TOTAL

COUNT RESW 1

TABLE RESW 2000

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

000F JLT TOTAL 3 Byte instruction

0012 STA TOTAL 3 Byte instruction

COUNT RESW 1

TABLE RESW 2000

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

000F JLT TOTAL 3 Byte instruction

0012 STA TOTAL 3 Byte instruction

0015 COUNT RESW 1

TABLE RESW 2000

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

000F JLT TOTAL 3 Byte instruction

0012 STA TOTAL 3 Byte instruction

0015 COUNT RESW 1

TABLE RESW 2000

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

000F JLT TOTAL 3 Byte instruction

0012 STA TOTAL 3 Byte instruction

0015 COUNT RESW 1 Assembler Directive-Only reserve space.


No object code generated.
Reserve 1 word = 3 bytes
TABLE RESW 2000

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

000F JLT TOTAL 3 Byte instruction

0012 STA TOTAL 3 Byte instruction

0015 COUNT RESW 1 Assembler Directive-Only reserve space.


No object code generated.
Reserve 1 word = 3 bytes
0018 TABLE RESW 2000

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

000F JLT TOTAL 3 Byte instruction

0012 STA TOTAL 3 Byte instruction

0015 COUNT RESW 1 Assembler Directive-Only reserve space.


No object code generated.
Reserve 1 word = 3 bytes
0018 TABLE RESW 2000

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

000F JLT TOTAL 3 Byte instruction

0012 STA TOTAL 3 Byte instruction

0015 COUNT RESW 1 Assembler Directive-Only reserve space.


No object code generated.
Reserve 1 word = 3 bytes
0018 TABLE RESW 2000 Assembler Directive-Only reserve space.
No object code generated.
2000 words = 6000 bytes=1770(16)
TOTAL RESW 1

END FIRST

7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 114
PASS 1
LOCCTR LABEL OPCODE OPERAND

000F JLT TOTAL 3 Byte instruction

0012 STA TOTAL 3 Byte instruction

0015 COUNT RESW 1 Assembler Directive-Only reserve space.


No object code generated.
Reserve 1 word = 3 bytes
0018 TABLE RESW 2000 Assembler Directive-Only reserve space.
No object code generated.
2000 words = 6000 bytes=1770(16)
1788 TOTAL RESW 1

END FIRST

7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 115
PASS 1
LOCCTR LABEL OPCODE OPERAND

000F JLT TOTAL 3 Byte instruction

0012 STA TOTAL 3 Byte instruction

0015 COUNT RESW 1 Assembler Directive-Only reserve space.


No object code generated.
Reserve 1 word = 3 bytes
0018 TABLE RESW 2000 Assembler Directive-Only reserve space.
No object code generated.
2000 words = 6000 bytes=1770(16)
1788 TOTAL RESW 1

END FIRST

7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 116
PASS 1
LOCCTR LABEL OPCODE OPERAND

000F JLT TOTAL 3 Byte instruction

0012 STA TOTAL 3 Byte instruction

0015 COUNT RESW 1 Assembler Directive-Only reserve space.


No object code generated.
Reserve 1 word = 3 bytes
0018 TABLE RESW 2000 Assembler Directive-Only reserve space.
No object code generated.
2000 words = 6000 bytes=1770(16)
1788 TOTAL RESW 1 Assembler Directive-Only reserve space.
No object code generated.
Reserve 1 word = 3 bytes
END FIRST
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 117
PASS 1
LOCCTR LABEL OPCODE OPERAND

000F JLT TOTAL 3 Byte instruction

0012 STA TOTAL 3 Byte instruction

0015 COUNT RESW 1 Assembler Directive-Only reserve space.


No object code generated.
Reserve 1 word = 3 bytes
0018 TABLE RESW 2000 Assembler Directive-Only reserve space.
No object code generated.
2000 words = 6000 bytes=1770(16)
1788 TOTAL RESW 1 Assembler Directive-Only reserve space.
No object code generated.
Reserve 1 word = 3 bytes
178B END FIRST
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 118
PASS 1
LOCCTR LABEL OPCODE OPERAND

000F JLT TOTAL 3 Byte instruction

0012 STA TOTAL 3 Byte instruction

0015 COUNT RESW 1 Assembler Directive-Only reserve space.


No object code generated.
Reserve 1 word = 3 bytes
0018 TABLE RESW 2000 Assembler Directive-Only reserve space.
No object code generated.
2000 words = 6000 bytes=1770(16)
1788 TOTAL RESW 1 Assembler Directive-Only reserve space.
No object code generated.
Reserve 1 word = 3 bytes
178B END FIRST
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 119
Program Length = Last LOCCTR – Starting Address
= 178B – 0000
PASS 1 = 178B bytes
LOCCTR LABEL OPCODE OPERAND

000F JLT TOTAL 3 Byte instruction

0012 STA TOTAL 3 Byte instruction

0015 COUNT RESW 1 Assembler Directive-Only reserve space.


No object code generated.
Reserve 1 word = 3 bytes
0018 TABLE RESW 2000 Assembler Directive-Only reserve space.
No object code generated.
2000 words = 6000 bytes=1770(16)
1788 TOTAL RESW 1 Assembler Directive-Only reserve space.
No object code generated.
Reserve 1 word = 3 bytes
178B END FIRST
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 120
PASS 1
LOCCTR LABEL OPCODE OPERAND

000F JLT TOTAL 3 Byte instruction

0012 STA TOTAL 3 Byte instruction

0015 COUNT RESW 1 Assembler Directive-Only reserve space.


No object code generated.
Reserve 1 word = 3 bytes
0018 TABLE RESW 2000 Assembler Directive-Only reserve space.
No object code generated.
2000 words = 6000 bytes=1770(16)
1788 TOTAL RESW 1 Assembler Directive-Only reserve space.
No object code generated.
Reserve 1 word = 3 bytes
178B END FIRST
7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 121
Program Length = 178B Bytes
PASS 1

Symbol (Label) Value (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 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

0000 FIRST CLEAR X

0002 LDA #0

0005 +LDB #TOTAL

0009 BASE TOTAL

0009 LOOP ADD TABLE, X

TIX COUNT

7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 124
Machine dependent assembler features
LABEL OPCODE OPERAND

000F JLT TOTAL

0012 STA TOTAL

0015 COUNT RESW 1

0018 TABLE RESW 2000

1788 TOTAL RESW 1

178B END FIRST

Program Length = 178B Bytes


7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 125
PASS 1

Symbol (Label) Value (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 126
Machine dependent assembler features
LABEL OPCODE OPERAND

SUM START 0

0000 FIRST CLEAR X

0002 LDA #0

0005 +LDB #TOTAL

0009 BASE TOTAL

0009 LOOP ADD TABLE, X

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

0000 FIRST CLEAR X

0002 LDA #0

0005 +LDB #TOTAL

0009 BASE TOTAL

0009 LOOP ADD TABLE, X

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

0000 FIRST CLEAR X

0002 LDA #0

0005 +LDB #TOTAL

0009 BASE TOTAL

0009 LOOP ADD TABLE, X

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 -

0000 FIRST CLEAR X

0002 LDA #0

0005 +LDB #TOTAL

0009 BASE TOTAL

0009 LOOP ADD TABLE, X

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 -

0000 FIRST CLEAR X

0002 LDA #0

0005 +LDB #TOTAL

0009 BASE TOTAL

0009 LOOP ADD TABLE, X

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

First operand following


the OPCODE is a register
=> Register (2 byte
instruction)

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 -

0000 FIRST CLEAR X

0002 LDA #0

0005 +LDB #TOTAL

0009 BASE TOTAL

0009 LOOP ADD TABLE, X

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 -

0000 FIRST CLEAR X B410

0002 LDA #0

0005 +LDB #TOTAL

0009 BASE TOTAL

0009 LOOP ADD TABLE, X

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 -

0000 FIRST CLEAR X B410

0002 LDA #0

0005 +LDB #TOTAL

0009 BASE TOTAL

0009 LOOP ADD TABLE, X

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

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 157
PASS 2

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

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 161
PASS 2

Symbol Value
LDA #0 ( 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 162
PASS 2

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

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 163
PASS 2

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

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 164
PASS 2

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

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 165
PASS 2

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

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 166
PASS 2

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

0000 0000 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 167
PASS 2

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

0000 0000 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 168
PASS 2

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

0000 0000 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 169
PASS 2

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

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 170
PASS 2

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

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 171
# - Immediate Mode
PASS 2

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

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 172
# - Immediate Mode
n=0, i=1
PASS 2

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

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 173
# - Immediate Mode
PASS 2

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

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 174
Indexed Mode??
x=1, if
PASS 2 2 operand is
nd

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

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 175
But, 2nd operand absent.
Not Indexed mode
PASS 2 So, set x = 0

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

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 176
But, 2nd operand absent.
Not Indexed mode
PASS 2 So, set x = 0

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

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 177
Relative Mode ?
PASS 2

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

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 178
No memory
reference.
PASS 2

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

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 179
Neither PC-relative nor
base-relative
PASS 2 So, set b=0, p=0

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

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 180
Should we set e =0 or 1 ?
PASS 2

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

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 181
Is the instruction a 4-byte extended
instruction ?
PASS 2 Look for + before the opcode

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

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 182
+ =>Format 4 => Flag e=1
No + =>Format 3 => Flag e=0
PASS 2

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

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 183
+ =>Format 4 => Flag e=1
No + =>Format 3 => Flag e=0
PASS 2

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

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 184
No + => Not 4-byte instruction.
So, set e =0
PASS 2

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

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 185
No + => Not 4-byte instruction.
So, set e =0
PASS 2

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

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 186
PASS 2

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

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 187
PASS 2

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

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 188
PASS 2

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

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 189
Generated target code
in Binary form
PASS 2

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

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 190
Generated target code
in Hexadecimal
PASS 2

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

LDA=00 CLEAR=B4 LDB=68


01
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 191
Generated target code
in Hexadecimal
PASS 2

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

LDA=00 CLEAR=B4 LDB=68


01 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 192
Generated target code
in Hexadecimal
PASS 2

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

LDA=00 CLEAR=B4 LDB=68


01 0 000
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 193
Generated target code
in Hexadecimal
PASS 2

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

LDA=00 CLEAR=B4 LDB=68


01 0 000
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 194
Machine dependent assembler features
LABEL OPCODE OPERAND OBJECT CODES

SUM START 0 -

0000 FIRST CLEAR X B410

0002 LDA #0

0005 +LDB #TOTAL

0009 BASE TOTAL

0009 LOOP ADD TABLE, X

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 -

0000 FIRST CLEAR X B410

0002 LDA #0 010000

0005 +LDB #TOTAL

0009 BASE TOTAL

0009 LOOP ADD TABLE, X

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 -

0000 FIRST CLEAR X B410

0002 LDA #0 010000

0005 +LDB #TOTAL

0009 BASE TOTAL

0009 LOOP ADD TABLE, X

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

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 198
PASS 2

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

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 202
PASS 2

Symbol Value
+LDB #TOTAL (4 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 203
PASS 2

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

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 204
PASS 2

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

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 205
PASS 2

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

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 206
PASS 2

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

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 207
PASS 2

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

0 11 0 1 0 0 0 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 208
PASS 2

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

0 11 0 1 0 0 0 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 209
PASS 2

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

0 11 0 1 0 0 0 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 210
PASS 2

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

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 211
PASS 2

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

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 212
PASS 2

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

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 213
PASS 2

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

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 214
PASS 2

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

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 215
PASS 2

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

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 216
PASS 2

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

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 217
# - Immediate Mode
PASS 2

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

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 218
# - Immediate Mode
n=0, i=1
PASS 2

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

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 219
# - Immediate Mode
n=0, i=1
PASS 2

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

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 220
Indexed Mode??
x=1, if
2nd operand is
PASS 2 register X

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

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 221
But, 2nd operand absent.
Not Indexed mode
PASS 2 So, set x = 0

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

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 222
But, 2nd operand absent.
Not Indexed mode
PASS 2 So, set x = 0

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

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 223
Relative Mode ?
PASS 2

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

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 224
Format 4 –-
20-bit Direct
PASS 2 Address is used.

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

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 225
Not a Relative mode.
So, set b=0, p=0.
PASS 2

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

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 226
Not a Relative mode.
So, set b=0, p=0.
PASS 2

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

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 227
Should we set e =0 or 1 ?
PASS 2

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

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 228
Is the instruction a 4-byte extended
instruction ?
PASS 2 Look for + before the opcode

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

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 229
Is the instruction a 4-byte extended
instruction ?
PASS 2 Look for + before the opcode

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

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 230
Is the instruction a 4-byte extended
instruction ?
PASS 2 Look for + before the opcode

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

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 231
+ =>Format 4 => Flag e=1
No + =>Format 3 => Flag e=0
PASS 2

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

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 232
+ =>Format 4 => Flag e=1
No + =>Format 3 => Flag e=0
PASS 2

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

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 233
+ present => A 4-byte instruction.
So, set e = 1
PASS 2

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

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 234
+ present => A 4-byte instruction.
So, set e = 1
PASS 2

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

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 235
Generated target code
in Binary form
PASS 2

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

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 236
Generated target code
in Hexadecimal
PASS 2

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

LDA=00 CLEAR=B4 LDB=68


69
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 237
Generated target code
in Hexadecimal
PASS 2

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

LDA=00 CLEAR=B4 LDB=68


69 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 238
Generated target code
in Hexadecimal
PASS 2

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

LDA=00 CLEAR=B4 LDB=68


69 1 01788
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 239
Generated target code
in Hexadecimal
PASS 2

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

LDA=00 CLEAR=B4 LDB=68


69 1 01788
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 240
Machine dependent assembler features
LABEL OPCODE OPERAND OBJECT CODES

SUM START 0 -

0000 FIRST CLEAR X B410

0002 LDA #0 010000

0005 +LDB #TOTAL

0009 BASE TOTAL

0009 LOOP ADD TABLE, X

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 -

0000 FIRST CLEAR X B410

0002 LDA #0 010000

0005 +LDB #TOTAL 69101788

0009 BASE TOTAL

0009 LOOP ADD TABLE, X

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 -

0000 FIRST CLEAR X B410

0002 LDA #0 010000

0005 +LDB #TOTAL 69101788

0009 BASE TOTAL

0009 LOOP ADD TABLE, X

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.

Example: LDB #TOTAL


BASE TOTAL

 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)

 NOBASE is an assembler directive used to inform the assembler that the


content of base register can no longer be relied upon for addressing.

 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 -

0000 FIRST CLEAR X B410

0002 LDA #0 010000

0005 +LDB #TOTAL 69101788

0009 BASE TOTAL

0009 LOOP ADD TABLE, X

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 -

0000 FIRST CLEAR X B410

0002 LDA #0 010000

0005 +LDB #TOTAL 69101788

0009 BASE TOTAL -

0009 LOOP ADD TABLE, X

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 -

0000 FIRST CLEAR X B410

0002 LDA #0 010000

0005 +LDB #TOTAL 69101788

0009 BASE TOTAL -

0009 LOOP ADD TABLE, X

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

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 250
PASS 2

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

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 256
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

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 257
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

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 258
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

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 259
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

LDA=00 CLEAR=B4 LDB=68


0 0 01 1 0 0 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 260
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
0001 10 1788
TOTAL
SYMBOL TABLE

LDA=00 CLEAR=B4 LDB=68


0 0 01 1 0 0 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 261
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
0001 10 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 262
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
0001 10 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 263
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

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 264
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

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 265
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

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 266
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

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 267
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
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 -

0000 FIRST CLEAR X B410

0002 LDA #0 010000

0005 +LDB #TOTAL 69101788

0009 BASE TOTAL -

0009 LOOP ADD TABLE, X

000C TIX COUNT

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 -

0000 FIRST CLEAR X B410

0002 LDA #0 010000

0005 +LDB #TOTAL 69101788

0009 BASE TOTAL -

0009 LOOP ADD TABLE, X

PC 000C TIX COUNT

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

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 294
Generated target code
in Hexadecimal
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

LDA=00 CLEAR=B4 LDB=68


1B
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 295
Generated target code
in Hexadecimal
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

LDA=00 CLEAR=B4 LDB=68


1B A
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 296
Generated target code
in Hexadecimal
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

LDA=00 CLEAR=B4 LDB=68


1B A 00C
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 297
Generated target code
in Hexadecimal
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

LDA=00 CLEAR=B4 LDB=68


1B A 00C
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 298
Machine dependent assembler features
LABEL OPCODE OPERAND OBJECT CODES

SUM START 0 -

0000 FIRST CLEAR X B410

0002 LDA #0 010000

0005 +LDB #TOTAL 69101788

0009 BASE TOTAL -

0009 LOOP ADD TABLE, X

000C TIX COUNT

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 -

0000 FIRST CLEAR X B410

0002 LDA #0 010000

0005 +LDB #TOTAL 69101788

0009 BASE TOTAL -

0009 LOOP ADD TABLE, X 1BA00C

000C TIX COUNT

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 -

0000 FIRST CLEAR X B410

0002 LDA #0 010000

0005 +LDB #TOTAL 69101788

0009 BASE TOTAL -

0009 LOOP ADD TABLE, X 1BA00C

000C TIX COUNT

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 -

0000 FIRST CLEAR X B410

0002 LDA #0 010000

0005 +LDB #TOTAL 69101788

0009 BASE TOTAL -

0009 LOOP ADD TABLE, X 1BA00C

000C TIX COUNT

7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 329
Machine dependent assembler features
LABEL OPCODE OPERAND

PC 000F JLT TOTAL

0012 STA TOTAL

0015 COUNT RESW 1

0018 TABLE RESW 2000

1788 TOTAL RESW 1

178B END FIRST

Program Length = 178B Bytes


7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 330
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 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 -

0000 FIRST CLEAR X B410

0002 LDA #0 010000

0005 +LDB #TOTAL 69101788

0009 BASE TOTAL -

0009 LOOP ADD TABLE, X 1BA00C

000C TIX COUNT

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 -

0000 FIRST CLEAR X B410

0002 LDA #0 010000

0005 +LDB #TOTAL 69101788

0009 BASE TOTAL -

0009 LOOP ADD TABLE, X 1BA00C

000C TIX COUNT 2F2006

7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 348
Machine dependent assembler features
LABEL OPCODE OPERAND

000F JLT TOTAL

0012 STA TOTAL

0015 COUNT RESW 1

0018 TABLE RESW 2000

1788 TOTAL RESW 1

178B END FIRST

Program Length = 178B Bytes


7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 349
PASS 2

Symbol Value
JLT TOTAL (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 350
PASS 2

Symbol Value
JLT TOTAL (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 351
PASS 2

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

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 352
PASS 2

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

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 353
PASS 2

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

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 354
PASS 2

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

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 355
PASS 2

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

LDA=00 CLEAR=B4 LDB=68


ADD=18 TIX=2C JLT=38 STA=0C
0011 1000
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 356
PASS 2

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

LDA=00 CLEAR=B4 LDB=68


ADD=18 TIX=2C JLT=38 STA=0C
0 01 1 1 0 0 0 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 357
PASS 2

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

LDA=00 CLEAR=B4 LDB=68


ADD=18 TIX=2C JLT=38 STA=0C
0 01 1 1 0 0 0 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 358
No # or @
PASS 2

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

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 359
Neither
Indirect not
PASS 2 immediate

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

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 360
PASS 2

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

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 361
Register X is not
present as a 2nd operand
PASS 2

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

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 362
Not an indexed mode.
Set x=0
PASS 2

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

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 363
Assemble
Operand
PASS 2

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

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 364
Assemble
Operand
PASS 2

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

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 365
Assemble
Operand
PASS 2

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

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 366
Assemble
Operand
PASS 2

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

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 367
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

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 368
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
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

000F JLT TOTAL

0012 STA TOTAL

0015 COUNT RESW 1

0018 TABLE RESW 2000

1788 TOTAL RESW 1

178B END FIRST

Program Length = 178B Bytes


7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 374
Machine dependent assembler features
LABEL OPCODE OPERAND

000F JLT TOTAL

PC 0012 STA TOTAL

0015 COUNT RESW 1

0018 TABLE RESW 2000

1788 TOTAL RESW 1

178B END FIRST

Program Length = 178B Bytes


7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 375
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 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 -

0000 FIRST CLEAR X B410

0002 LDA #0 010000

0005 +LDB #TOTAL 69101788

0009 BASE TOTAL -

0009 LOOP ADD TABLE, X 1BA00C

000C TIX COUNT 2F2006

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 -

0000 FIRST CLEAR X B410

0002 LDA #0 010000

0005 +LDB #TOTAL 69101788

0009 BASE TOTAL -

0009 LOOP ADD TABLE, X 1BA00C

000C TIX COUNT 2F2006

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 -

0000 FIRST CLEAR X B410

0002 LDA #0 010000

0005 +LDB #TOTAL 69101788

0009 BASE TOTAL -

0009 LOOP ADD TABLE, X 1BA00C

000C TIX COUNT 2F2006

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

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 397
+ =>Format 4 => Flag e=1
No + =>Format 3 => Flag e=0
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

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 398
+ =>Format 4 => Flag e=1
No + =>Format 3 => Flag e=0
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 0 0000 0000 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 399
Generated target code
in Binary form
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 0 0000 0000 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 400
Generated target code
in Hexadecimal
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 0 0000 0000 0000
TOTAL 1788

SYMBOL TABLE

LDA=00 CLEAR=B4 LDB=68


3B
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 401
Generated target code
in Hexadecimal
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 0 0000 0000 0000
TOTAL 1788

SYMBOL TABLE

LDA=00 CLEAR=B4 LDB=68


3B 4
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 402
Generated target code
in Hexadecimal
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 0 0000 0000 0000
TOTAL 1788

SYMBOL TABLE

LDA=00 CLEAR=B4 LDB=68


3B 4 000
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 403
Generated target code
in Hexadecimal
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 0 0000 0000 0000
TOTAL 1788

SYMBOL TABLE

LDA=00 CLEAR=B4 LDB=68


3B 4 000
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 404
Machine dependent assembler features
LABEL OPCODE OPERAND

000F JLT TOTAL

0012 STA TOTAL

0015 COUNT RESW 1

0018 TABLE RESW 2000

1788 TOTAL RESW 1

178B END FIRST

Program Length = 178B Bytes


7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 405
Machine dependent assembler features
LABEL OPCODE OPERAND

000F JLT TOTAL 3B4000

0012 STA TOTAL

0015 COUNT RESW 1

0018 TABLE RESW 2000

1788 TOTAL RESW 1

178B END FIRST

Program Length = 178B Bytes


7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 406
PASS 2

Symbol Value
STA TOTAL (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 407
PASS 2

Symbol Value
STA TOTAL (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 408
PASS 2

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

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 409
PASS 2

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

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 410
PASS 2

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

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 411
PASS 2

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

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 412
PASS 2

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

LDA=00 CLEAR=B4 LDB=68


ADD=18 TIX=2C JLT=38 STA=0C
0000 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 413
PASS 2

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

LDA=00 CLEAR=B4 LDB=68


ADD=18 TIX=2C JLT=38 STA=0C
0000 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 414
PASS 2

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

LDA=00 CLEAR=B4 LDB=68


ADD=18 TIX=2C JLT=38 STA=0C
0000 11 00 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 415
PASS 2

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

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 416
PASS 2

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

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 417
No # or @
PASS 2

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

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 418
Neither
Indirect not
PASS 2 immediate

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

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 419
PASS 2

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

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 420
PASS 2

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

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 421
Register X is not
present as a 2nd operand
PASS 2

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

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 422
Not Indexed mode
PASS 2

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

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 423
Assemble
Operand
PASS 2

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

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 424
Assemble
Operand
PASS 2

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

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 425
Assemble
Operand
PASS 2

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

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 426
Assemble
Operand
PASS 2

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

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 427
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
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

000F JLT TOTAL 3B4000

0012 STA TOTAL

0015 COUNT RESW 1

0018 TABLE RESW 2000

1788 TOTAL RESW 1

178B END FIRST

Program Length = 178B Bytes


7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 431
Machine dependent assembler features
LABEL OPCODE OPERAND

000F JLT TOTAL 3B4000

0012 STA TOTAL

PC 0015 COUNT RESW 1

0018 TABLE RESW 2000

1788 TOTAL RESW 1

178B END FIRST

Program Length = 178B Bytes


7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 432
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 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

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 442
+ =>Format 4 => Flag e=1
No + =>Format 3 => Flag e=0
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

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 443
+ =>Format 4 => Flag e=1
No + =>Format 3 => Flag e=0
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 0 0000 0000 0000 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 444
Generated target code
in Binary form
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 0 0000 0000 0000 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 445
Generated target code
in Hexadecimal
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 0 0000 0000 0000 1788
TOTAL
SYMBOL TABLE

LDA=00 CLEAR=B4 LDB=68


0F
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 446
Generated target code
in Hexadecimal
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 0 0000 0000 0000 1788
TOTAL
SYMBOL TABLE

LDA=00 CLEAR=B4 LDB=68


0F 4
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 447
Generated target code
in Hexadecimal
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 0 0000 0000 0000 1788
TOTAL
SYMBOL TABLE

LDA=00 CLEAR=B4 LDB=68


0F 4 000
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 448
Generated target code
in Hexadecimal
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 0 0000 0000 0000 1788
TOTAL
SYMBOL TABLE

LDA=00 CLEAR=B4 LDB=68


0F 4 000
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 449
Machine dependent assembler features
LABEL OPCODE OPERAND

000F JLT TOTAL 3B4000

0012 STA TOTAL

0015 COUNT RESW 1

0018 TABLE RESW 2000

1788 TOTAL RESW 1

178B END FIRST

Program Length = 178B Bytes


7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 450
Machine dependent assembler features
LABEL OPCODE OPERAND

000F JLT TOTAL 3B4000

0012 STA TOTAL 0F4000

0015 COUNT RESW 1

0018 TABLE RESW 2000

1788 TOTAL RESW 1

178B END FIRST

Program Length = 178B Bytes


7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 451
Machine dependent assembler features
LABEL OPCODE OPERAND

000F JLT TOTAL 3B4000

0012 STA TOTAL 0F4000

0015 COUNT RESW 1

0018 TABLE RESW 2000

1788 TOTAL RESW 1

178B END FIRST

Program Length = 178B Bytes


7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 452
Machine dependent assembler features
LABEL OPCODE OPERAND

000F JLT TOTAL 3B4000

0012 STA TOTAL 0F4000

0015 COUNT RESW 1 Assembler Directive


Only reserve space.
No object code
0018 TABLE RESW 2000

1788 TOTAL RESW 1

178B END FIRST

Program Length = 178B Bytes


7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 453
Machine dependent assembler features
LABEL OPCODE OPERAND

000F JLT TOTAL 3B4000

0012 STA TOTAL 0F4000

0015 COUNT RESW 1 -

0018 TABLE RESW 2000

1788 TOTAL RESW 1

178B END FIRST

Program Length = 178B Bytes


7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 454
Machine dependent assembler features
LABEL OPCODE OPERAND

000F JLT TOTAL 3B4000

0012 STA TOTAL 0F4000

0015 COUNT RESW 1 -

0018 TABLE RESW 2000

1788 TOTAL RESW 1

178B END FIRST

Program Length = 178B Bytes


7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 455
Machine dependent assembler features
LABEL OPCODE OPERAND

000F JLT TOTAL 3B4000

0012 STA TOTAL 0F4000

0015 COUNT RESW 1 -

0018 TABLE RESW 2000 -

1788 TOTAL RESW 1

178B END FIRST

Program Length = 178B Bytes


7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 456
Machine dependent assembler features
LABEL OPCODE OPERAND

000F JLT TOTAL 3B4000

0012 STA TOTAL 0F4000

0015 COUNT RESW 1 -

0018 TABLE RESW 2000 -

1788 TOTAL RESW 1

178B END FIRST

Program Length = 178B Bytes


7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 457
Machine dependent assembler features
LABEL OPCODE OPERAND

000F JLT TOTAL 3B4000

0012 STA TOTAL 0F4000

0015 COUNT RESW 1 -

0018 TABLE RESW 2000 -

1788 TOTAL RESW 1 -

178B END FIRST

Program Length = 178B Bytes


7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 458
Machine dependent assembler features
LABEL OPCODE OPERAND

000F JLT TOTAL 3B4000

0012 STA TOTAL 0F4000

0015 COUNT RESW 1 -

0018 TABLE RESW 2000 -

1788 TOTAL RESW 1 -

178B END FIRST

Program Length = 178B Bytes


7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 459
Machine Dependent Assembler Features

7/10/202 Dr Kavitha K Mahesh Dept. of 46


2 0
Computer Science & Engineering, SJEC
Machine dependent assembler features
LABEL OPCODE OPERAND OBJECT CODES

SUM START 0 -

0000 FIRST CLEAR X B410

0002 LDA #0 010000

0005 +LDB #TOTAL 69101788

0009 BASE TOTAL -

0009 LOOP ADD TABLE, X 1BA00C

000C TIX COUNT 2F2006

7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 461
Machine dependent assembler features
LABEL OPCODE OPERAND

000F JLT TOTAL 3B4000

0012 STA TOTAL 0F4000

0015 COUNT RESW 1 -

0018 TABLE RESW 2000 -

1788 TOTAL RESW 1 -

178B END FIRST

Program Length = 178B Bytes


7/10/2022 Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru 462
PASS 2 –Object Program
Object Program
Program Name Starting Address
Program Length

Length Indicator
H^SUM ^000000^0178B

T^000000^15^B410 ^ 010000 ^ 69101788 ^ 1BA00C 2F2006 ^ 3B4000 ^


0F4000
E 000000

7/10/2022 463
Dr Kavitha K Mahesh Dept. of Computer Science & Engineering, SJEC Mangaluru

You might also like