8085 Architecture
8085 Architecture
I 40-pin
I 8-bit CPU (8-bit data)
I 16-bit address bus - Max. addressable memory : 64KB
I Clock speed - 3 MHz or 5 MHz
I 12 addressable 8-bit registers
I 6 (8-bit) or 3 (16-bit) general purpose registers
I Accumulator (8-bit), flags (8-bit)
I Program counter (16-bit), Stack pointer (16-bit)
I Interrupts - 4 maskable and 1 non-maskable
Functional block diagram of 8085
Data path
I Arithmetic logic unit (ALU)
I Instruction register and decoder
I Register array
Control path
I Timing and Control unit
I Interrupt control
I Serial I/O control
ALU
Stack pointer
I 16-bit register, whose content points to beginning of stack
I Decremented by two during PUSH or POP instructions
Stack
I a LIFO memory location in read/write memory
I used to store temporary information (address or data) during
program execution
I Storage starts in address one-less than that address in the SP
register
I Data bytes from register-pair (Rp) can be stored in the stack
in reverse order
I Used by both user and CPU
Pinout Diagram of 8085
Buses
I Address bus - 16 bits wide
I AD7 − AD0 - bidirectional, data and address
I AD8 − AD15 - unidirectional, address
I Data bus - 8 bits wide
I AD7 − AD0 - bidirectional, data and address
I AD7 − AD0
I Carries address bits during the early part of the operation
I Carries data bits during the later stage of execution
I Address bits are saved ( latched) before they become data bits
Buses and Signals
Signals
I Control signals
I RD & WR - active-low signals, indicating selected I/O or
Memory device to be read or written
I Status signals
I IO/M - Distinguish between I/O & Memory operations
I S1, S0 - Distinguishes type of operations (eg., read or write)
I Special signal
I ALE - Address Latch Enable - used to enable a latch to save
the low-order address from the multiplexed bus
I ALE positive going pulse - indicates that bits AD7 − AD0 are
address bits
Buses and Signals
Interrupts
I We will look at this later
Other externally initiated signals
I RESET IN - CPU is reset, PC is set to zero, buses are
tri-stated
I RESET OUT - indicates CPU is being reset, used to reset
other devices
I HOLD - peripheral is requesting use of address and data bus
I HLDA - acknowledge HOLD request
I READY - signal used to delay the microprocessors read or
write cycles - used by a slow-responding peripheral device -
microprocessor will be in WAIT state until this signal goes
high
Fetching an Instruction from Memory
AD15−AD8
AD15−AD8
8085 ALE
EN
AD7−AD0 Memory
LATCH
WR RD IO/M
RD WR
MEMR
MEMW
Address bus
Data bus
Fetching from Memory
AD15−AD8
AD15−AD8
8085 ALE
EN
AD7−AD0 Memory
LATCH AD0−AD7
WR RD IO/M
RD WR
MEMR
MEMW
Address bus
Data bus
Fetching from Memory
AD15−AD8
AD15−AD8
8085 ALE
EN
AD7−AD0 Memory
LATCH AD0−AD7
WR RD IO/M
D7−D0
RD WR
MEMR
MEMW
Address bus
Data bus
Do you know ?
Types of architecture
I Accumulator arch.
I Extended accumulator or special-purpose register arch.
I Intel’s 8085 and 8086
I General-purpose register arch.
I register-memory, e.g., AMD64
I load-store or Register-register, e.g., MIPS, SPARC, Intel IA-64
I memory-memory, DEC (Digital Equip.) - not very popular
I Stack architecture, e.g., Calculators (HP)
Registers: Assembly Variables
I Decide on operation/algorithm
I Outline the algorithm Flowchart, Pseudocode, etc.,
I High-level language to implement the algorithm
I Compile, assemble, link to generate machine language
program
Performing operations - 8085 processor
Comments
I Documentation for a program
I Separated by a ’;’ from the instruction on the same line
Label (optional)
I Pseudo-Operand
I 5 characters, 1st character must be character,@ or ?
Endianess (Byte Order)
Numbering bytes within a word - byte with the lowest number is
either the leftmost or rightmost one
Little endian
I Increasing significance with increasing memory address
Byte #
3 2 1 0
MSB LSB
I In 8085, a 16-bit data 2007H, will be stored as
Address Data
3000 07
3001 20
Big endian
I Decreasing significance with increasing memory address
Byte #
0 1 2 3
MSB LSB
Data Formats
I ASCII
I 7-bit alpha numeric code
I To represent decimal numbers, alphabets, special characters
I Recently - 8-bit extended ASCII
I BCD
I Binary-Coded Decimal - decimal numbers 0 to 9
I need four bits to represent each digit
I Signed Integer
I +ve or -ve number.
I Largest +ve number 7FH, Smallest -ve number FFH
I Unsigned Integer
I No sign bit
I Largest number FFH, smallest number 0H
Instruction Size
One byte - just the Opcode
Mnemonic Opcode
MOV A, B; 78H
DCX SP ; 3BH
RRC ; 0FH
Two bytes - Opcode followed by 8-bit (byte) data
Mnemonic Opcode
MVI A, 8-bit ; 3E, 8-bit
ADI 8-bit ; C6, 8-bit
Three bytes - Opcode followed by 16-bit addr. or data
Mnemonic Opcode
LXI B, 16-bit(data) ; 0A, 16-bit
JNZ 16-bit(addr.) ; C2, addr.
CALL 16-bit(addr.) ; CD, addr.
Addressing Modes