Вы находитесь на странице: 1из 14

5.

2 Microprocessors II: 8085


Dr. Tarek A. Tutunji
Mechatronics 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 bus 16 signal lines (pins) A15 A8 one-direction, higher address AD7 AD0 lower address, dual purpose Data bus 8 signal lines (pins) AD7 AD0 bi-directional Dual purpose: Multiplexed used for Data or address Control and Status signals RD and WR Read/Write control signals. Active low IO/M Status signal to differentiate between Input/output 1 and memory 0 operations ALE Address Latch Enable Positive pulse at beginning of operation S0 and S1 status signals

8085 Architecture
Power supply and frequency signals Vcc (+5V) and Vss (ground) X1 and X2 crystal (or RC circuit) to supply input clock, Frequency 6MHz to 10 MHz CLK (out) output clock that can be used for external devices External initiated signals INTR (input) Interrupt Request INTA (output) Acknowledge INTR RST 7.5, 6.5, 5.5 (inputs) Restart vectored Interrupts TRAP (input) Nonmaskable interrupt HOLD (input) DMA request HLDA (output) Acknowledge HOLD READY (input) Delay uprocessor RD/WR RESET IN (input) When signal goes low: PC set to 0, MPU is reset RESET OUT Signal used to reset other devices Serial I/O Ports Serial transmission: SID (input) and SOD (output)

8085 Internal Registers


Registers are used in microprocessors to store information. The 8085 has the following registers:

Accumulator

8-bit register that is part of the ALU. Also identified as register A

General Registers

Six general purpose 8-bit registers B, C, D, E, H and L Can 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 fetched SP 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 1s 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 Example MVI B, 4FH MOV B,A OUT 01H IN 05H LDA 2050H STA 2080H Operation move 8-bit data in register copy data from Rs to Rd output data from A to device input data from device to A load A with data in memory store data in A to memory

Mnemonics MVI R, 8-bit MOV Rd,Rs OUT 8-bit IN 8-bit LDA 16-bit STA 16-bit

8085 Instruction Set

Arithmetic Instructions
Example ADD C ADI 48H SUB B SUI F1H INR C DCR D Operation add register content to A add 8-bit data to A subtract register content from A subtract 8-bit data from A add 1 to register subtract 1 from register

Mnemonics ADD R ADI 8-bit SUB R SUI 8-bit INR R DCR R

8085 Instruction Set

Logic Instructions

Mnemonics ANA R ANI 8-bit ORA R ORI 8-bit XRA R XRI 8-bit CMP R CPI 8-bit

Example ANA C ANI 23H ORA C ORI 2EH XRA E XRA A7H CMP B CPI F6H

Operation AND register content with A AND 8-bit data with A OR register content with A OR 8-bit data with A XOR register content with A XOR 8-bit data with A Compare register content with A Compare 8-bit data with A

8085 Instruction Set

Branch Instructions

Mnemonic JMP 16-bit JZ 16-bit JNZ 16-bit CALL RET

Example JMP 2030H JZ 2020H JNZ 2070H CALL 2010H RET

Operation go to 16-bit address go to 16-bit address if Z =1 go to 16-bit address if Z = 0 Jump to subroutine at address Returns from subroutine

Other Instructions HLT stop program

HLT

Example
Write assembly code to load two hexadecimal numbers 42H and 38H in registers A and B. Add the numbers and display the sum at output port 1 In Assembly language 1) MVI A,42H 2) MVI B,38H 2) ADD B 3) OUT 01H 4) HLT
move 42H to register A move 38H to register B add register B to A and store in A display accumulator content to port 01 stop program

Assume the program starts at memory address 1000. Then the programmer would input the following Machine (Hex) code

Memory Address
1000 1001 1002 1003 1004 1005 1006 1007

Mnemonic
MVI A,42H MVI B,38H

Hex Code
3E 42 06 38 80 D3 01 76

Binary
0011 0100 0000 0011 1000 1101 0000 0111 1110 0010 0110 1000 0000 0011 0001 1110

ADD B OUT 01H HLT

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

Вам также может понравиться