8085 micro processor instructions

26
8085 instructions Dr Vinita kuamri

Transcript of 8085 micro processor instructions

8085 instructions

Dr Vinita kuamri

Data Transfer instructions

MOV- MOV A,B

• MOV A,M

• MOV M,A

MVI B, 05

LDA, 2025

STA, 2037

LHLD, 2000

Addition of 16 bit number

LHLD 200CXCHGLHLD 200EDAD DSHLD 2010RST 5

Addition of 16 bit number

// two sixteen bit numbers are at 200C, 200D and 200E, 200F// results are stored in 2010 and 2011

# BEGIN 0000HLHLD 200C ; Load the HL pair with first number XCHG ; Exchange the HL and DE registersLHLD 200EDAD D ; Add HL and DE registersSHLD 2010 ; store the results in 2010RST 5

# ORG 200C# DB CAH,A7H, 6BH,B9H

• LXI D, 2027

• LXI H, 2025

• LXI B, 2000

• LDAX B; load accumulator with memory content which address is in BC register pair

• STAX B

• XCHG

Write 8085 assembly language program for addition of two 8-bit numbers and sum is 8 bit (indirect addressing)

LXI B, 2050LDAX BMOV D,AINX BLDAX BADD DINX BSTAX B

Arithmetic Operations

• ADD B

• ADI, 59H

• ADC B; used for 16 bit addition

• ADC M

• ACI 57H; commonly used in 16 bit addition only. After addition previous carry flag is cleared

ADC B (Addition of 16 bit No)(if BC and DE register pairs carry 16 bit Nos, result to be stored in BC register)

XRA / MVI A,00

MOV A,C

ADD E

MOV C, A

MOV A,B

ADC D

MOV B,A

Logical Operations

Branch Operation

Machine Control Operations

Problems

Write instructions to:a. Load 15H in accumulatorb. Decrement the accumulator

a. LDA 2025 or LDAX B

b. DCR A

Write instructions to load the hexadecimal number 65h inregister C and 92h in the accumulator A. Display thenumber 65h at port0 and 92h at port1.

Specify the output at PORT1 if the following program is executed

MVI B, 82HMOV A,BMOV C,AMVI D, 37HOUT PORT1HLT

Write a program using ADI instruction to add two hexadecimal numbers 3BH and 67H and to display the answer at an output port F2H.