8085 program to store a 8 bit data in memory
MVI A, 24H STA 1423H HLT
MVI A, 24H
– store 24H in the accumulator.STA 1423H
– copy the contents of accumulator to memory loaction 1423H.HLT
– stop the execution.
8085 program to add two 8 bit data numbers
LXI H, 1500H MOV A, M INX H ADD M INX H MOV M, A HLT
LXI H, 1500H
– store the address of first number (1500 H) in HL register pair.MOV A, M
– copy the contents of memory loaction to accumulator.INX H
– increments the contents of HL register pair. HL now points to 1501H.ADD M
– Add first operator in the accumulator with the second operator in memory location 1501H.INX H
– HL now points to 1502H.MOV M, A
– store result in accumulator at location 1502H.HLT
– stop the execution.
Example
1st operand (1500) - 1A 2nd operand (1501) - B7 Result (1502) - 1A + B7 = D1
8085 program to subtract two 8 bit data numbers
LXI H, 1500H MOV A, M INX H SUB M INX H MOV M, A HLT
8085 program to find 1s compliment of a number
LDA 1500H CMA STA 1501H HLT
8085 program to find 2s compliment of a number
LDA 1500 H CMA ADI, 01 H STA 1501 H HLT