5.2 microprocessors ii: 8085 - philadelphia
TRANSCRIPT
5.2 Microprocessors II:
8085
Dr. Tarek A. TutunjiMechatronics Engineering Department
Philadelphia University, Jordan
Microprocessors II: 8085
In the previous sequence, a general introduction to microprocessors was given
In this sequence, the 8085 microprocessor will be described and will be used to illustrate microprocessors functionality, architecture, and programming
8085
The 8085 Microprocessor is an 8-bit general purpose microprocessor, capable of addressing 64K of memory• 8-bit data bus
• 16-bit address bus
The device has 40 pins, operates at frequency between 1 to 5MHz and requires +5V supply
8085 is an Intel microprocessor
First built in 1976
Simple architecture and therefore suitable to illustrate microprocessor functionality
8085 Architecture
MPU needs to• Identify peripheral or memory location with address• Transfer binary information (data and instructions)• Provide timing and control signals
8085 Buses
Address Bus: a group of 16 lines identified as A0 to A15. The address bus flows in one direction – from MPU to peripherals (or memory)
The 8085 has 16-address lines and therefore can address up to 216= 65,536 (64K)
Data Bus: a group of 8 lines used for data transfer. The bus is bidirectional – data flows in both directions between MPU and peripherals (or memory)
Control Bus: lines that carry synchronization signals to provide timing and control
8085 Architecture
Address bus16 signal lines (pins)A15 – A8 one-direction, higher addressAD7 – AD0 lower address, dual purpose
Data bus8 signal lines (pins)AD7 – AD0 bi-directionalDual purpose: Multiplexed used for Data or address
Control and Status signalsRD and WR Read/Write control signals. Active lowIO/M Status signal to differentiate between
Input/output ‘1’ and memory ‘0’ operations
ALE Address Latch EnablePositive pulse at beginning of operation
S0 and S1 status signals
8085 ArchitecturePower supply and frequency signalsVcc (+5V) and Vss (ground)X1 and X2 crystal (or RC circuit) to supply input
clock, Frequency 6MHz to 10 MHzCLK (out) output clock that can be used for
external devices
External initiated signalsINTR (input) Interrupt RequestINTA (output) Acknowledge INTRRST 7.5, 6.5, 5.5 (inputs) Restart vectored InterruptsTRAP (input) Nonmaskable interruptHOLD (input) DMA requestHLDA (output) Acknowledge HOLDREADY (input) Delay uprocessor RD/WRRESET IN (input) When signal goes low: PC set to 0,
MPU is resetRESET OUT Signal used to reset other devices
Serial I/O PortsSerial transmission: SID (input) and SOD (output)
8085 Internal Registers
Registers are used in microprocessors to store information.The 8085 has the following registers:
Accumulator8-bit register that is part of the ALU. Also identified as register A
General RegistersSix general purpose 8-bit registers B, C, D, E, H and LCan be combined as 16-bit register pairs BC, DE, HL
Program Counter (PC) and Stack Pointer (SP)16-bit registers
PC points to the memory address from which the next byte is fetchedSP points to a memory location in the stack
Flags: S, Z, P, CY and AC• S: sign flag is set to 1 when bit D7 of the result =1• Z: zero flag is set to 1 when the result is zero• P: parity flag is set to 1 when the result has an even number of 1’s• CY: carry flag is set to 1 when the arithmetic operation results in carry• AC: auxiliary carry is set to 1 when carry is generated by D3
8085 Internal Registers
8085 Instruction Set
74 operation codes that result in 246 instructions
Copy (Data Transfer) Instructions
Mnemonics Example Operation
MVI R, 8-bit MVI B, 4FH move 8-bit data in registerMOV Rd,Rs MOV B,A copy data from Rs to RdOUT 8-bit OUT 01H output data from A to deviceIN 8-bit IN 05H input data from device to ALDA 16-bit LDA 2050H load A with data in memorySTA 16-bit STA 2080H store data in A to memory
8085 Instruction Set
Arithmetic Instructions
Mnemonics Example Operation
ADD R ADD C add register content to A
ADI 8-bit ADI 48H add 8-bit data to A
SUB R SUB B subtract register content from A
SUI 8-bit SUI F1H subtract 8-bit data from A
INR R INR C add 1 to register
DCR R DCR D subtract 1 from register
8085 Instruction Set
Logic Instructions
Mnemonics Example Operation
ANA R ANA C AND register content with AANI 8-bit ANI 23H AND 8-bit data with AORA R ORA C OR register content with AORI 8-bit ORI 2EH OR 8-bit data with AXRA R XRA E XOR register content with AXRI 8-bit XRA A7H XOR 8-bit data with ACMP R CMP B Compare register content with ACPI 8-bit CPI F6H Compare 8-bit data with A
8085 Instruction Set
Branch Instructions
Mnemonic Example Operation
JMP 16-bit JMP 2030H go to 16-bit addressJZ 16-bit JZ 2020H go to 16-bit address if Z =1JNZ 16-bit JNZ 2070H go to 16-bit address if Z = 0CALL CALL 2010H Jump to subroutine at addressRET RET Returns from subroutine
Other Instructions
HLT HLT stop program
ExampleWrite assembly code to load two hexadecimal numbers 42H and 38H in registers A andB. Add the numbers and display the sum at output port 1
In Assembly language1) MVI A,42H move 42H to register A2) MVI B,38H move 38H to register B2) ADD B add register B to A and store in A3) OUT 01H display accumulator content to port 014) HLT stop program
Assume the program starts at memory address 1000. Then the programmer would inputthe following Machine (Hex) code
Memory Address Mnemonic Hex Code Binary
1000 MVI A,42H 3E 0011 11101001 42 0100 00101002 MVI B,38H 06 0000 01101003 38 0011 10001004 ADD B 80 1000 00001005 OUT 01H D3 1101 00111006 01 0000 00011007 HLT 76 0111 1110
Summary
8085 is a 40-pin, 8-bit microprocessor made by Intel
There are three main buses in microprocessors: address bus, data bus, and control bus
8085 has several internal registers including accumulator, six general registers, PC, SP, and flags
8085 instruction set is provided which includes: copy, arithmetic, logic, and branch operations