Elements of Assembly Language Programming
Elements of Assembly Language Programming
ASSEMBLER
Elements of Assembly
Language Programming
Assembly Language: Assembly Language is a machine dependent, low level
programming language which is specific to certain computer system.
qSymbolic Operand:
Ex: DS – Declare as storage
DC – Declare as Constant
qData Declaration:
Ex: X DC ‘-10.5’
Statement Format:
[label] <opcode> <operand spec> [< operand spec >,…..]
1.Declarative statements
Ex: [Label] DS <constant> [Label] DC ‘<value>’
DS (Declare as Storage): Allots memory word of block value same as tha
of the constant mentioned in the statement.
DC (Declare as constant): Constructs memory word containing the value.
1.Assembler directives
Ex: Start <constant>
Mnemonic Table
Mnemonic Opcode Length
ADD 01 1
SUB 02 1
Source Target
Program
Analysis Phase Synthesis Phase Program
Symbol Address
N 113 Data Access
01/26/10 Chapter 4: Assembler Control Transfer5
Symbol Table
Mnemonics Table is a fixed table which is merely accessed by the analysis and
synthesis phases, while the Symbol table is constructed during analysis and
used during synthesis
Yes
Label Present ? Enter (Lable, LC) in SYMTAB
No
Search in OPTAB
LC = LC + Length No
No
No DC/DS ?
Literal Used ?
Type of Directive
Yes
Yes
LTORG ORIGIN END
Calculate Storage Size
Enter into LITTAB
A
01/26/10 Chapter 4: Assembler
B C D 8
E A B C D
Yes
END ?
No
Go to Pass II
Update LC
Search in OPTAB
Yes
M/C Instruction ?
No
A
B
01/26/10 Chapter 4: Assembler 10