The question I had got was : Write an alp to perform block interchange of data.
The solution goes like this :
Data segment
X db 01h,02h,03h,04h,05h
Y db 11h,12h,13h,14h,15h
Data ends
Code segment
Assume cs:code,ds:data
Start:mov ax,data
Mov ds,ax
Mov cx,05h
Lea si,x
Lea di,y
Up:mov bl,[si]
Mov al,[di]
Mov [si],al
Mov [di],bl
Inc cx
Inc dx
Dec cx
Jnz up
Mov ah,4ch
Int 21h
Code ends
End start
No comments:
Post a Comment