Given a matrix with 25 rows and 80 columns but with the attributes its 160 columns
I have to write a program in assembly to move a four letter string “Fool” (say) to move across the matrix back and forth.
What I have done till now:
mov bx,0B800H
mov ds, bx
mov si, 1760
mov cx,80
FOOL: add si,-6
mov [si], " "
add si, 2
mov [si], "F"
add si, 2
mov [si], "O"
add si, 2
mov [si], "O"
add si,2
mov [si],"L"
loop FOOL
mov cx, 80
FOOOL: add si,-6
mov [si], "F"
add si, -2
mov [si], "O"
add si, 2
mov [si], "O"
add si,2
mov [si],"L"
add si,2
mov [si], " "
loop FOOOL
mov ah,9
int 21H
But with this code, when its reversed, the last letter comes before the first. I am a newbie in assembly, I have tried 8085 before but this is my first attempt to 8086.
I would be grateful if somebody help me to fix this problem.
This works: