Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
22 views34 pages

209 Combined

The document provides an overview of the IBM 8086 PC architecture, detailing components such as the CPU, memory types (RAM and ROM), and the organization of data and segment registers. It explains memory operations, instruction execution, and the role of the clock in synchronizing these processes. Additionally, it covers programming languages from machine language to high-level languages, along with memory management concepts like segment:offset addressing.

Uploaded by

asif
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views34 pages

209 Combined

The document provides an overview of the IBM 8086 PC architecture, detailing components such as the CPU, memory types (RAM and ROM), and the organization of data and segment registers. It explains memory operations, instruction execution, and the role of the clock in synchronizing these processes. Additionally, it covers programming languages from machine language to high-level languages, along with memory management concepts like segment:offset addressing.

Uploaded by

asif
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 34

IBM 8086 PC

• System Unit often referred to as Computer


• Keyboard, Display often refers to
peripherals Display

• Computers are constructed with IC chips


• IC chips are digital circuits, build up with
millions of transistors and operates on System Unit
digital signals 0 and 1.
• These symbols, 0 and 1 are called binary Keyboard
digits or bits.
CPU
• CPU
System Board
• Mother board
• Microprocessor
• Memory Circuits
• Expansion slots
Memory
• Bit: ‘0’ and ‘1’ is called bit (BInary digit)
• Byte: Bits are grouped into 8. 8 bits comprises a BYTE
• Address: each byte to memory is identified by an address. Which
starts from 0.
• Content: data stored in a memory byte is called content.
• Value: the numerical value of a byte content is called value.
• Address vs Value: Address of a memory is fixed and it is different from
address of another memory. However, the value of a memory is
changed over time.
Pictorial
Address length
Value of a memory is always 1 byte (Max value 11111111 = 256).
However address of a memory depends on the computer system. For
8086 computer address is 20 bit.

Quiz: How many memory can be addressed in 8086 computer?


Byte vs Word
• In typical microcomputer 2 bytes forms a word.
• In 8086 microcomputer, allows a pair of bytes together as a memory
word. The address of the lower byte is used as the address of the
memory word.

Quiz: what is the max value of a word?


Bit position in a word
Memory Operations
• Read: In read operation, the processor gets the copy of the data in at
a specific location. So after the read operation, the data of the
location remains unchanged.
• Write: In a write operation, the data is written in the mentioned
location. So the previous data is over written, thus lost.
Types of Memory
• RAM: Random Access memory. We can write in this memory and also
read. Programs and data are loaded into Ram and lost when we turn
off the computer.
• ROM: Read Only Memory. We can only read from this memory. ROM
values are retained when we turn off the computer. ROM is used by
the computer manufacturers to store system programs known as
firmware
Buses
• Address Bus
• Data Bus
• Control Bus
The CPU
Instruction Execution (Page 22, 1.2 section)
• Instruction Format: OPCODE Operand1[, Operand2]
• Fetch Cycle:
1. Fetch an instruction from Memory
2. Decode the instruction and determine the operation
3. Fetch data from memory
• Execute Cycle
4. Perform the operation on the data
5. Store the result in the memory if needed
Sample Execution
The instruction will add the contents of Register AX to the contents of
memory word at address 0. The CPU adds the two numbers in the ALU
and then stores the result back to memory word at 0.

An instruction is always 4 bytes or 2 words

The execution always takes place from the address stored in IP

00000001 00000110 00000000 00000000


Step by step execution
• Fetch Instruction:
• Decode Instruction:
• Fetch Data:
• Performs Operation:
• Store the result:
Computer Clock
• Clock Pulse: A train of pulse controls the execution timing.
• Clock Period: The interval between two pulses
• Clock Speed: number of pulses in a second. Measured in MHz
• Initial IBM PC had clock pulse 4.77 MHz
Instruction vs Clock pulse
• Instruction execution is synchronized with the clock pulse.
• Different instruction takes different number of clock pulses to
complete the execution.
• A memory read operation takes 4 clock pulse to complete
• A multiplication operation takes 70+ clocks to complete.
• It is possible to use higher speed clock to increase execution speed.
Programming Languages
Machine Language
Example
10100001 00000000 00000000
Fetch the contents of memory word 0 and put it in Register AX
00000101 00000100 00000000
Add 4 to AX
10100011 00000000 00000000
Store the contents of AX in memory word 0
Programming Languages
Assembly Language
Example
MOV AX, A; fetch the contents of location
A and out it in register AX
ADD AX, 4; add 4 to AX
MOV A, AX; move the contents of AX into
location A
Programming Languages
High level Language
Example
C, C++, C#,
Example Language
.MODEL SMALL
.STACK 100H
.DATA
A DW 2
B DW 5
SUM DW ?
.CODE
MAIN PROC
; initialize DS
MOV AX, @DATA
MOV DS, AX
;add the numbers
MOV AX, A ;AX has A
ADD AX, B ;AX has A+B
MOV AX, 4000H ;SUM = A+B
; exit to DOS
MOV AX, 4000H
INT 21H
MAIN ENDP
END MAIN
Organization of 8086(Page 52, 3.2 section)
• Registers
• Data registers: holds data for operations
• Address registers: holds address of an instruction or memory
• Status register: holds the current status of the processors
Data Registers
Data registers are 16 bit divided into 2 parts. Each 8 bits.
• AX (Accumulator Register):
• AX is preferred register to perform arithmetic, logic and data transfer
operation because its use generates shortest machine codes.
• In multiplication and division operations one of the number involved must be
in AX or AL register.
• Input and output operations also require the use of AL and AX
• BX (Base Register)
• In addition to use as data register, BX is also serves as an address register
Data Registers
• CX (Count Register):
• Used as data register
• Program loop constructions are facilitated by the use of CX, serves as loop
counter
• Used as counter in REP operations. Used for string operations
• CL is used as a count in instructions that shifts and rotate bits
• DX (Data Register)
• Used in multiplication and division operations.
• Used in I/O operations
Segment Registers
In 8086, memory is used in 4 segments and start of each segment is
pointed by one register:
• CS (Code Segment)
• DS (Data Segment)
• SS (stack Segment)
• EX (Extra Segment), Used for additional data segment
Pointers and Index Registers
These registers are used to point to a memory location in combination of the
segment registers. These can also be used in arithmetic and other
operations.
• SP (Stack Pointer): used in conjunction with SS for accessing the stack
segment.
• BP (Base Pointer): used primarily to access data on the stack. Unlike SP, it
can also be used to access data in other segments.
• SI (Source Index): used to point memory locations in the data segment
addressed by DS. We can access consequitive memory locations by
increasing contents of SI.
• DI (Destination Index): works similar to SI but specially used in string
operations and accessing memory in extra segment (ES)
Instruction Pointer
• IP (Instruction pointer)
• Along with CS IP is used to access next instruction to be executed.
• IP is updated every time an instruction is executed, so that it can point the
next instruction to be executed.
• Unlike other registers, IP cannot be directly manipulated by an instruction,
that is, IP cannot used as operand in any instruction.
Flag Register
• Flag register indicates the status of the microprocessor.
• Each bit if this register indicates a specific meaning.
• Bits are categorized as
• Status Flag
• Control Flag
• Status flags reflects the results of an instruction executed by the
processor (Zero Flag)
• Control flags enables or disable certain operations of the processor
(Interrupt Flag)
Memory Management
Constrains:
• 8086 is a 16 bit microprocessor. Hence, all the registers are 16 bit.
• IBM PC has 20 bit address system. Up to 1 MB.

Resolution
• Introduced the concept of Segment register.
• 1 MB memory is divided into 16 segments. Among those, 10 can be
accesses by the programmers as RAM.
• 1 Segment of memory can be at most up to 64 KB. Can be addressed by
one 16 bit register.
Memory Segment
• A memory segment is a block of 216 (64 K) consecutive memory bytes.
• Each segment is identified by a segment number, starting with 0.
• A segment number is 16 bits. Hence can be total 64K
Segment:Offset Address
• A memory is addressed by a logical address, which is written as
Segment:Offset.
• A4FB:4872h means offset 4872h within Segment A4FB.
• To obtain the 20 bit physical address, 8086 microprocessor first shifts
the segment address 4 bits to the left and then adds the offset.
• The physical address of A4FB:4872h is A4FB0h + 4872h = A9822h
Location of Segments:
• Segments start from 10h = 16 bytes
• Starting address of a segment always ends with 0
• 16 bytes is called paragraph

You might also like