Professional Documents
Culture Documents
EXP4
EXP4
THEORY:
MVI A, F7: Take the value of F7 data in accumulator.
CMA: Compliment the data stored in accumulator.
INR A: Increment the data by one, which is stored in accumulator.
STA 4000H: Stored the result in 4000H memory location from the accumulator.
SYNTAX:
MVI A, 2000H (INPUT)
CMA
INR A
STA 4000H (OUTPUT)
HLT
PROGRAM:
MEMORY
OPCODE NEMONICS BYTE
LOCATION
2000 3E MVI A,F7H 2
2001 F7
2001 2F CMA 1
2003 3C INR A 1
2005 00
2006 40
2007 76 HLT 1
RESULT: INPUT
2000H F7H
OUTPUT
4000H 06H