DATA SEGMENT
A DB 1,2,3,4,5
B DB 6,7,8,9,10
DATA ENDS
CODE SEGMENT
ASSUME DS:DATA,CS:CODE
START:
MOV AX,DATA
MOV DS,AX
MOV CX,0000
MOV CL,05
LEA BX,A
LEA SI,B
L1:MOV DH,BYTE PTR[BX]
MOV DL,BYTE PTR[SI]
MOV BYTE PTR[BX],DL
MOV BYTE PTR[SI],DH
MOV DH,BYTE PTR[BX]
MOV DL,BYTE PTR[SI]
INC BX
INC SI
DEC CL
CMP CL,00
JNZ L1
MOV AH,4CH
INT 21H
CODE ENDS
END START
;OUTPUT:->
;-D DS: 0000 L5
;0BA8:0000 01 02 03 04 05
;-D DS: 0005 L5
;0BA8:0000 06 07 08-09 0A
;-D DS: 0000 L5
;0BA8:0000 06 07 08 09 0A
;-D DS: 0005 L5
;0BA8:0000 01 02 03-04 05