【发布时间】:2017-04-24 17:12:49
【问题描述】:
我需要一些帮助才能使用 emu8086 在我的屏幕上反弹一个字符。 屏幕尺寸为(80x25 字符)。我设法将它沿对角线移动,但它没有反弹。相反,它在到达边界(即第 24 行)后在 x 轴上直线移动这是我到目前为止所做的。
enter code here
Data_seg segment 'data'
char db 'A'
char2 db ' '
x1 db (1)
y1 db (1)
Data_seg ends
Code_seg segment 'code'
assume CS:Code_seg,DS:Data_seg
main PROC far
mov ax,Data_seg
mov ds,ax
mov cx,40
loop1:
;gotoxy
mov ah,02
mov dl,x1
mov dh,y1
mov bh,0
int 10H
;print a
mov al,char
mov dl,al
mov ah,02H
int 21H
;gotoxy
mov ah,02
mov dl,x1
mov dh,y1
mov bh,0
int 10H
;print " "
mov dl,char2
mov ah,02H
int 21H
inc x1
inc y1
;if(x1<2)||(x1>79)
mov al,x1
cmp al,2
jl ifPart
mov al,x1
cmp al,79
jge ifPart
;if(y1<2)||(y1>79)
y11:
mov al,y1
cmp al,2
jl ifPart2
mov al,y1
cmp al,24
jge ifPart2 ;jge for boundry(24)
jmp endif
ifPart:
dec x1
jmp y11
ifPart2:
dec y1
endif:
loop loop1
Code_seg ends
end main
【问题讨论】: