You are on page 1of 2

Experiment No: 2

STATEMENT: Two data stored into consecutive memory location starting from
2090H, subtract those data. Finally store the result in 3010H.(consider result is 8bit
only)

THEORY:
LXI H, 2090H: Load 2090H data to H-L register pair.
MOV A, M: Copy the data into Accumulator from register M.
INX H, 2091H: Increment the content of register pair H-L.
MOV B, M: Copy the data into B register from register M.
SUB B: Subtract B register from Accumulator.
STA 3010H: Store the Accumulator content into 3010H.
HLT: Terminate the programming.

SYNTAX:
LXI H, 2090H , 2091H(INPUT)
MOV A, M
INX H, 2091H
MOV B, M
SUB B
STA 3010H(OUTPUT)
HLT

PROGRAM:

OPCOD
MEMORY LOCATION NEMONICS BYTE
E
2000 21 LXI H, 2090H 3
2001 90
2002 20
2003 7E MOV A, M 1
2004 23 INX H, 2091H 1
2005 46 MOV B, M 1
2006 90 SUB B 1
2007 32 STA 3010H 3
2008 10
2009 30
200A 76 HLT 1
RESULT:

INPUT

2090H 45H

2091H 13H

OUTPUT

3010H 32H

OUTPUT IN VIRTUAL LAB:

You might also like