Lec 1
Lec 1
Assembly Language
CSC 325
Introduction to 8086 &
Programming Model
Outline
Introduction to MPU System
History of Microprocessors
Basic Concepts of Microprocessor Architecture
Registers and Flags
Introduction
MICROCOMPUTERS AND MICROPROCESSORS
There are three major parts of a Computer System.
Central Processing Unit (CPU): Also simply called as the
microprocessor acts as the brain coordinating all activities within a
computer.
The Memory: The program instructions and data are primarily stored.
The Input/output (I/O) Devices: Allow the computer to input
information for processing and then output the results. I/O Devices
are also known as computer peripherals.
The integrated Circuit (IC) chip containing the CPU is called
the microprocessor and the entire computer including the
microprocessor, memory and I/O is called a
microcomputer.
Introduction
The CPU is connected to memory and I/O devices
through a strip of wires called a bus. The bus inside
a computer carries information from place to place.
In every computer there are three types of busses:
Address Bus: The address bus is used to identify the
memory location or I/O device the processor intends to
communicate with
Data Bus: Data bus is used by the CPU to get data from /
to send data to the memory or the I/O devices.
Control Bus: Each time the processor outputs an
address it also activates one of the four control bus
signals: Memory Read, Memory Write, I/O Read and I/O
Write.
Introduction
The address and control bus contains output lines only,
therefore it is unidirectional, but the data bus is
bidirectional.
There two types of memory used in microcomputers:
RAM (Random Access Memory/ Read-Write memory) is used by
the computer for the temporary storage of the programs that is
running. Data is lost when the computer is turned off. So known as
volatile memory.
ROM (Read Only Memory) the information in ROM is permanent
and not lost when the power is turned off. Therefore, it is called
nonvolatile memory.
Note that RAM is sometimes referred as primary storage,
where magnetic /optical disks are called secondary
storage.
Introduction
Introduction
Inside the CPU:
A program stored in the memory provides instructions to the
CPU to perform a specific action. This action can be a
simple addition. It is function of the CPU to fetch the
program instructions from the memory and execute them.
1. The CPU contains a number of registers to store
information inside the CPU temporarily.
Registers inside the CPU can be 8-bit, 16-bit, 32-bit or even 64-bit
depending on the CPU.
2. The CPU also contains Arithmetic and Logic Unit
(ALU). The ALU performs arithmetic (add, subtract, multiply,
divide) and logic (AND, OR, NOT) functions.
Introduction
3. The CPU contains a program counter also known as the
Instruction Pointer to point the address of the next
instruction to be executed.
4. Instruction Decoder is a kind of dictionary which is used
to interpret the meaning of the instruction fetched into the
CPU. Appropriate control signals are generated according to
the meaning of the instruction.
Introduction
Introduction
I/O Device 0 Data
Data
Code
Memory
Address
CPU
I/O Device 1 Data
Address
Data
I/O Device N Data
Memory
Data
History
Pinout of 8086 & 8088
Architecture
Example:
This flag is set, when the This flag is set, if the result of This flag is set to 1, if the lower
result of any computation the computation or comparison byte of the result contains even
is negative performed by an instruction is number of 1’s ; for odd number
zero of 1’s set to zero.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
OF DF IF TF SF ZF AF PF CF
Tarp Flag
Over flow Flag If this flag is set, the processor
This flag is set, if an overflow occurs, i.e, if the result of a signed
enters the single step execution
operation is large enough to accommodate in a destination
mode by generating internal
register. The result is of more than 7-bits in size in case of 8-bit
signed operation and more than 15-bits in size in case of 16-bit interrupts after the execution of
sign operations, then the overflow will be set. each instruction
into 4 groups OF DF IF TF SF ZF AF PF CF
AX 16-bit Accumulator Stores the 16-bit results of arithmetic and logic operations
AL 8-bit Accumulator Stores the 8-bit results of arithmetic and logic operations
CX Count Register Used to hold the count value in SHIFT, ROTATE and LOOP
instructions
DX Data Register Used to hold data for multiplication and division operations
SP Stack Pointer Used to hold the offset address of top stack memory
BP Base Pointer Used to hold the base value in base addressing using SS
register to access data from stack memory
SI Source Index Used to hold index value of source operand (data) for string
instructions
DI Data Index Used to hold the index value of destination operand (data)
for string operations