Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 8

Module 2

ASSEMBLERS AND MACRO PROCESSORS


Syllabus
Content Duration Self Study
Assemblers: Elements of Assembly Language 2 Lecture 2 hours
Programming

Basic Assembler functions , Design of the Assembler, 1 Lecture 2 hours


Types of Assembler

Two pass assembler – IBM 360/370, Format of 2 Lecture 3 hours


databases, Algorithm

Single pass Assembler for Intel x86. 1 Lecture 2 hours


Macro Processors: Macros, Basic Functions of 2 Lecture 2 hours
Macro Processor, Features of Macro Facility

Design of Two pass Macro Processor, Format of 2 Lecture 4 hours


Databases and Algorithm.
Assembler:

Assembler : An assembler is a program that accepts as input an assembly language program &
produces its machine language equivalent along with information for the loader.

ALP m/c language &


Other information for the loaders
Databases

• Functions of Assembler:

- Convert mnemonic operation codes to their machine language equivalents


- Convert symbolic operands to their equivalent machine addresses

- Decide the proper instruction format


- Convert the data constants to internal machine representations

- Write the object program and the assembly listing


Features of assembly language programming:

1) Mnemonic opcode specification:


Instead of using the binary opcodes mnemonics can be used.
E.g. L- load
A- Add
ST- Store
BR- Branch

2) Symbolic Operand Specification:


Instead of referring to instruction or data by its address, symbol can be used.
(Symbolic name can be associated with data or instructions).
It is function of assembler to replace each symbol by its address.

3) Storage Area specification:


Declaration of data & storage areas.
Assembly language can be used to specify some part of memory can be used for
storage.
Statements in ALP:

1. Imperative statement:
Understood by m/c & executed by m/c.
e.g. All the instructions.
1. Declarative statements:
DC statement: Declare Constant
Label Opcode Operand
FOUR DC F ‘4’

2. Assembler Directive statement:


These are neither executable nor declarative.
They direct the assembler to perform the specific task.
e.g. a) START statement:
-These statement indicates the start of assembly language program.
b) END statement: END of ALP.
c) BYTE, WORD, RESB, RESW
Design of Assembler: For IBM 360/370 Machine

1) Registers:-

-There are 16 general purpose register of 32 bit each.

- There are 4 floating point register of 64 bit each.

- There is 1 program status word of 64 bits.

2) Memory:-
Unit Of Memory Bytes Bits
Byte 1 8
-Basic unit Bytes.
Half Word 2 16
Full Word 4 32
Double Word 8 64
Instruction Formats:

a) RR Format:-
In this format the first & second operands present in the registers.
Format:
Opcode R1 (OP1) R2 (OP2)
0 7 8 11 12 15
e.g AR 3,4
3) RX format:
-In this format first operand is in the register & second operand is external (
present in the memory location).
-The address of second operand is given by-
C (B2) + C(X2) + D2
Contents of Base Reg. + Contents of Index Reg. + Displacement

Format:
Opcode R1 X1 B2 D2
0 7 8 11 12 15 16 19 20 31
e.g A 1, 90(2,15)
i.e. C(15) + C(2) +90
Thank You

You might also like