You are on page 1of 2

Experiment No: 4

STATEMENT: Write a program using 8085 Microprocessor to do 2’s complement of a 8-bit


number.

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

2004 32 STA 4000H 3

2005 00

2006 40

2007 76 HLT 1
RESULT: INPUT

2000H F7H

OUTPUT

4000H 06H

OUTPUT IN VIRTUAL LAB:

You might also like