Hi I'm trying to build maze game using assembly language using emu8086 the symbol is moving in the maze correctly but the code part for it being deleted from previous position and not moving on walls is not working probably here's my code:
;current position
mov dh,r ;row
mov dl,c ;col
mov bh,0
mov ah,2
int 10h
read_input:
mov ah,7
int 21h
cmp al,120 ;x
je exit
cmp al,119 ;w
je movUp
cmp al,115 ;s
je movDown
cmp al,100 ;d
je movRight
cmp al,97 ;a
je movLeft
jmp read_input
;====================================================
;move player
movUp:
; delete symbol from current position
mov ah,2
mov dl,00
int 21h
;move cursor position upwards
dec r
mov dh,r
mov dl,c
mov bh,0
mov ah,2
int 10h
;read character at cursor position
mov ah,08h
mov bh,0
int 10h
;check if it's a wall block
cmp al,177
je back_wall
jmp p
;return cursor position downwards
back_wall:
inc r
mov dh,r
mov dl,c
mov bh,0
mov ah,2
int 10h
jmp read_input
;print symbol in the new position
p:
mov ah,2
mov dl,042
int 21h
inc score
jmp read_input
same logic for other directions
there's no syntax errors
it runs but as if it's not taking the interrupt 10h/08h