You are on page 1of 5

y Designed as an instructional aid and draws its features from several real microprocessors.

y Too limited to run anything as complex as personal computer. y It has about the right level of complexity to control a microwave oven or other consumer appliance. y Instruction Set Architecture (ISA) Memory Model Registers Set Instruction Set y Memory Model This microprocessor is a complete 8-bit parallel Central Processing Unit (CPU). Each byte has 8 bits Isolated I/O, input and output devices are treated as being separate from memory. Different instructions access memory and I/O devices. y Register Set y y y y y y y y Accumulator A, is an 8-bit register. Register B, C, D, E, H, and L, are six 8-bit general purpose register. These registers can be accessed individually, or can be accessed in pairs. Pairs are not arbitrary; BC are a pair (16- bit), as are DE, and HL Register HL is used to point to a memory location. Stack pointer, SP, is an 16-bit register, which contains the address of the top of the stack. The sign flag, S, indicates the sign of a value calculated by an arithmetic or logical instruction. The zero flag, Z, is set to 1 if an arithmetic or logical operation produces a result of 0; otherwise set to 0. The parity flag, P, is set to 1 if the result of an arithmetic or logical operation has an even number of 1s; otherwise it is set to 0.

y y y

The carry flag, CY, is set when an arithmetic operation generates a carry out. The auxiliary carry flag, AC, very similar to CY, but it denotes a carry from the lower half of the result to the upper half. The interrupt mask, IM, used to enable and disable interrupts, and to check for pending interrupts Instruction Set

y y y

Data movement instructions Data operation instructions Program control instructions Data movement instruction for the 8085 microprocessor Instruction MOV r1, r2 LDA + STA + PUSH rp PUSH PSW POP rp POP PSW Operation r1 = r2 A = M[+] M[+] = A Stack = rp (rp { SP) Stack = A, flag register rp = Stack (rp { SP) A, flag register = Stack

IN n OUT n r, r1, r2 any 8-bits register

A = input port n Output port n =A + / M[+] memory location

rp register pair BC, DE, HL, SP(Stack pointer) n 8-bit address or data value Data operation instruction for the 8085 microprocessor Instruction Operation Flags

ADD r ADD M INR r IN M DCR n DCR M XRA M CMP r CMA CY carry flag

A=A+r A = A + M[HL] r=r+1 M[HL] = M[HL] + 1 r=r-1 M[HL] = M[HL] - 1 A = A M[HL] Compare A and r A = Ad

All All Not CY Not CY Not CY Not CY All All None

Program control instruction for the 8085 microprocessor

Instruction JUMP + Jcond + CALL + Ccond + RET Rcond

Operation GOTO + If condition is true then GOTO + Call subroutine at + If condition is true then call subroutine at + Return from subroutine If condition is true then return from subroutine

cond conditional instructions NZ (Z = 0) Z (Z = 1) P (S = 0) N (S = 1) C (CY = 1)

PO (P = 0) PE (P = 1) NC (CY = 0)

Z zero flag, S sign flag, P parity flag, C carry flag Note: Each instruction is having an 8-bit instruction code. Some instructions have fields to specify registers, while others are fixed. Example program using 8085 microprocessor coding The Algorithm of the program 1: total = 0, i = 0

2: 3: 4:

i=i+1 total = total + i IF i { n THEN GOTO 2

n + (n - 1) + + 1 The 8085 coding of the program LDA n MOV B, A XRA A Loop:ADD B DCR B JNZ Loop STA total sum = A A = 0 sum = sum + i i=i-1 IF i { 0 THEN GOTO Loop total = sum i=n

You might also like