Professional Documents
Culture Documents
Microprocessors and Assembly Language: Instructor: Mubashra Manzoor Contact Email
Microprocessors and Assembly Language: Instructor: Mubashra Manzoor Contact Email
Microprocessors and Assembly Language: Instructor: Mubashra Manzoor Contact Email
Language
Flip-flop
Registers Cont…
A register is a set of flip-flops with
combinational logic to implement state
transitions that allow information to be stored
and retrieved from them. In the simplest form,
a flip-flop is a one-bit register.
Basic Computer Architecture
Registers
are Built
in
memory
locations
in the
processor
Registers Cont..
Data formats in Registers
Data can be entered in serial or in parallel form
Parallel out
1 0 0 1
1001 1001
FF3 FF2 FF1 FF0
Serial in Serial out
D3 = 1 D2 = 0 D1= 0 D0= 1
Parallel in
Registers Cont…
Classifications of Registers (based on input/output)
Serial Input Serial Output (SISO)
Serial Input Serial Output (SIPO)
Parallel Input Serial Output (PISO)
Parallel Input Parallel Output (PIPO)
Classification of Registers (Based on applications)
Shift Registers
Storage Registers
Registers and Processor types
In computing, 16-bit, 32-bit and 64-bit are different
types of processors. The bit number (usually 8, 16,
32, or 64) refers to how much memory a processor
can access from the CPU register.
The 16-bits generally refers to the size of the data
registers inside the CPU, and the internal data bus. So the
arithmetic logic unit (ALU) would be able to do 16-bit
math, either signed (-32768 to +32767) or unsigned (0 to
65535).
Recall: Compilation Process
. • Assembly Code
Assembler
Object
code
• Object File
Linker
• Machine Code
• Hardware
• Assembly Language helps reducing compilation time
• Registers also help in optimization of processing time during the hardware
and software interaction
Registers Con…
Hard
Registers Cache RAM
disk
Register =
Record collection
of Information
• Concept of registers is there since the inception of first Intel Microprocessor 4004
in 1971 by Federico Faggin
AX
Types of Registers
There are 14 types
Accumulator Register
8-bit a
ax
16-bits ah al
Eax ah al
32- bits
Rax Eax ah al
• X – Extended to 16 bits
• E – Extended to 32 bits
• R – Rich register to 64 bits CPU
1. Accumulator Register
An accumulator is a register for short-term,
intermediate storage of arithmetic and logic data in a
computer's CPU
General Purpose Registers
They accumulate the results of
instructions
Used for input and output
Used while performing operations
a register or registers that are dedicated to take the result
of operations
In modern computers, any register can function as
an accumulator.
AX
2. Base Register
BX
8-bit b
bx
16-bits bh bl
Ebx bh bl
32- bits
Rbx Ebx bh bl
64- bits
CPU
2. Base Register
Holds addresses of data
In computing, a base address is an address serving as a reference
point ("base") for other addresses.
In computers using relative addressing scheme, to obtain an absolute
address, the relevant base address is taken and offset ( displacement)
is added to it.
It is used to store the value of the offset
AX
3. Counter Register
BX
CX
8-bit c
cx
16-bits ch cl
Ecx ch cl
32- bits
Rcx Ecx ch cl
64- bits
CPU
Counter Register
Edx dh dl
32- bits
Rdx Edx dh dl
64- bits
CPU
Data Register
Add dl, bl
Source
Destination
AX
General Purpose Registers BX
CX
DX
CS
Segment Registers DS
SS
ES
Index Registers
SI
DI
Special Purpose IP
Registers SP
CPU
Look at the following simple program to understand the use of registers in
assembly programming. This program displays 9 stars on the screen along
with a simple message