Professional Documents
Culture Documents
Lecture-2
Introduction to Assembly Language
12/23/2019 1
Basic Computer Organization
REGISTERS
12/23/2019 2
Types of Registers
There two categories of registers
General purpose register
Special purpose registers
12/23/2019 3
General Purpose Registers
Function of GPR
Use to store data as will as addresses
They combine data and address registers
12/23/2019 4
General Purpose Registers
Commonly used general purpose registers
Accumulator register (AX)
Base register (BX)
12/23/2019 5
General Purpose Registers
Accumulator register:
General purpose register
Use for arithmetic and logic operations
12/23/2019 6
General Purpose Registers
Bits 15……………………………………………………….0
16 bits AX Register
12/23/2019 7
General Purpose Registers
Base/index/pointer register
Perform arithmetic and data movement
Holds the Address of Operands but not data
12/23/2019 8
Cont..
Bits 15……………………………………………………….0
16 bits BX Register
12/23/2019 9
Cont..
Counter register:
Act as counter for repeating or looping
instruction
The instruction given are automatically
repeated and decrement the value of CX
And quite when it is equal to 0
12/23/2019 10
Cont..
Bits 15……………………………………………………….0
16 bits CX Register
12/23/2019 11
Cont..
Data register:
Special role in multiply & divide operations
Work like buffer
12/23/2019 12
Cont..
Bits 15……………………………………………………….0
16 bits DX Register
12/23/2019 13
GPR
12/23/2019 14
Cont..
Function:
Collection of different boolean
information each bit has an
independent meaning
12/23/2019 15
Registers
Flag / Program Status Word
C O P D Z I A S
Direction Interrupt Auxalry
Carry Over Parity Zero Sign
carry
flow bit
12/23/2019 16
12/23/2019 17
12/23/2019 18
12/23/2019 19
12/23/2019 20
12/23/2019 21
12/23/2019 22
12/23/2019 23
12/23/2019 24
Registers
Carry Flag
1111111111111111
+1111111111111111
0000000000000001
0000000000000000
16 – bit Accumulator
Carry Flag = CF
12/23/2019 25
Special Purpose Register
These register hold state of program
They are use
By CU to control operation of CPU
By OS to control execution of program
12/23/2019 26
Special Purpose Register
Types of SPR
Instruction Register IR
Program Counter PC
12/23/2019 27
Cont..
Instruction Register:
Part of CU
Store the instructions currently being executed
12/23/2019 28
Cont..
Memory Address Register:
Holds the memory address
The memory address from which data will be
provided to CPU
The address to which the data will be sent & store
Work as buffer
Allow processor and memory units to act
independently
12/23/2019 30
Cont...
Program Counter:
Also called instruction pointer
Contain address of next instruction to be fetch
12/23/2019 31
Registers
General Purpose
Function:
Temporary Storage
of
Intermediate Results
12/23/2019 32
Segments Registers
12/23/2019 33
Index Registers
12/23/2019 34
MNEMONIC
12/23/2019 35
Instruction Groups
12/23/2019 36
Data Movement
12/23/2019 37
Arithmetic and Logic Instructions
12/23/2019 39
Special Instructions
12/23/2019 40