8085 micro processor instructions
-
Upload
sayyed-amir-hussain -
Category
Education
-
view
77 -
download
0
Transcript of 8085 micro processor instructions
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)
• 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
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