0% found this document useful (0 votes)
37 views

Program - : Reverse of Data

This program reverses the order of data stored in memory addresses 2000-2007 and stores it in addresses 2008-2015. It uses SI and DI registers to point to the input and output data locations. It copies each byte from the input to the output, decrementing SI and incrementing DI, repeating for a count of 8 bytes.

Uploaded by

Sajan Antony
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views

Program - : Reverse of Data

This program reverses the order of data stored in memory addresses 2000-2007 and stores it in addresses 2008-2015. It uses SI and DI registers to point to the input and output data locations. It copies each byte from the input to the output, decrementing SI and incrementing DI, repeating for a count of 8 bytes.

Uploaded by

Sajan Antony
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

PROGRAM

-:

REVERSE OF DATA

MEMORY
ADDRESS
1100

MNEMONICS

HEX CODE

REMARKS

MOV SI,2000

1104

MOV DI,2008

1108

MOV CX,0008

110C

ADD SI,0007

1110

MOV AL,[SI]

1112

MOV [DI],AL

Set location
2000 for data in
SI
Set location
2008
For data in DI
Set count as 8
in CX
Add location of
SI with 0007
Move data to AL

1114

DEC SI

Move data to DI

1115

INC DI

Decrement SI

1116

DEC CX

Increment DI

1117

JNZ 1110

Decrement CX

1119

HLT

If count is not
equal to 0 then
goto 1110
Stop

OUTPUT
INPUT
ADDRESS

2000

OUTPUT
DATA

01

ADDRESS

2008

DATA

08

2001
2002
2003
2004
2005
2006
2007

02
03
04
05
06
07
08

2009
2010
2011
2012
2013
2014
2015

07
06
05
04
03
02
01

You might also like