Computer Architectutre Manual 1 2019-Cpe-27 Muhammad Usama Saghar

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

Manual lab no 1:

Subject teacher:
Engr. Yasir Anwar
Lab Engineer:
Engr. Abdul rehman
Submitted by:
Muhammad Usama Saghar
Roll no:
2019-CPE-27
Subject:
Computer Architecture

Department of computer engineering


Lab No 1
Objective:
Introduction to 8086 register.

Theory:
A register is a very small amount of fast memory, that is build in the CPU or processor in
order to speed up the operation.

 Register is the very fast and efficient than the other memories. Like,
 RAM
 Rom
 External memories
 That is why resgister occupied the high and top position in memory model.
 The 8086 microprocessor has a total of fourteen registers that are accessible to the
programmer.
 All these registers are 16-bits in size.
 The registers of 8086 are categories into five different group,

1. General register
2. Index register
3. Pointer register
4. Status register
5. Segment register
8086 resisters

Ac c umu la tor AX AH AL
Ba s e re gis te r BX BH BL
Ge ne ra l R e gis te rs
Co unt re gis te r CX CH CL
Da ta re gis te r DX DH DL

S o urc e SI
In de x R e gis te rs
De s tin a tion DI

Ba s e BP
S ta c k SP P o inte r R e gs ite rs
In s truc tion IP

SF S ta tus Fla gs

Co de CS
Da ta DS
S e gme n t R e gis te rs
Extra ES
S ta c k SS

1) General Purpose Registers:

The use of general-purpose registers is to store temporary data.


While the instructions are executed in the control unit, they may work on some numeric value or
some operands. These registers are used in these cases. There are 4 general-purpose registers of
16-bit length each.

i. AX = [AH:AL]
ii. BX = [BH:BL]
iii. CX = [CH:CL]
iv. DX = [DH:DL] \

Each of them is further divided into two subparts of 8-bit length each: one high, which stores the
higher-order bits and another low which stores the lower order bits.

i. Accumulator register AX:


It is used for logic and arithmetic instruction.
ii. Base register BX:

It is used to store value of asset.


iii. Count register CX:

It is used for looping and rotation counting.


iv. Data register DX:
It is used for data transfer.

16 bits

2) Index register:

These registers contain the offsets Distances of a variable, label, or instruction


from its base segment of data and instructions. The offset refers to the distance of a variable,
label, or instruction from its base segment.
3) Pointer register:

The Instruction Pointer, IP, contains the offset address of the next instruction to be
executed,

1. Instruction Pointer (IP):


The instruction pointer usually stores the address of the next
instruction that is to be executed. Apart from this, it also acts as an offset for CS register.

2. Base Pointer (BP):


The Base pointer stores the base address of the memory. Also, it
acts as an offset for Stack Segment (SS). Base Pointer is used to access data in the stack
segment

3. Stack Pointer (SP):


Stack Pointer contains the offset address of the top of the stack.

4.

4) Flag or Status Register

The Flag or Status register is a 16-bit register which contains 9 flags,


and the remaining 7 bits are idle in this register. These flags tell about the status of the processor
after any arithmetic or logical operation. IF the flag value is 1, the flag is set, and if it is 0, it is
said to be reset
5) Segment Registers:

There are 4 segment registers in 8086 Microprocessor and each of them is of 16 bit. The code
and instructions are stored inside these different segments.

1. Code Segment (CS) Register:


The Code segment contains the program being executed.

2. Data Segment (DS) Register:


The Data segment contains data (variables).

3. Stack Segment (SS) Registers:


The Stack segment contains the stack.

4. Extra Segment (ES) Register:


The Extra segment can be used for anything.

Comment / result:
In this lab we study 8086 register and its type and its working.

You might also like