我在学校做一个太空侵略者项目,我想检查外星人是否到达了屏幕的按钮。我在代码中使用了 int 10h d(它需要屏幕上像素的颜色)并且它卡住了所有东西,我试图了解发生了什么并得出结论,行“ mov ah,0Dh
”以及“ int 10h
”行使其卡住了。有人知道我该怎么做才能让它工作吗?
(这是代码)
proc checkAliensDown
pusha
push ax
mov cx,320 ;loop counter
checkPixel:
push cx
mov bh,0h
mov cx,[x]
mov dx,140
mov ah,0Dh
int 10h
;the output of the int 10h goes into al
cmp al,10 ;check if the color of the pixel is green
jne notDown ;if not jumps to notDown
mov [lost],1 ;if it is green moves to lost 1
jmp endProc ;if it found that the pixel is green it jumps to the end of the proc
notDown:
inc [x] ;increasing x var in order to check all the pixels in the row, if one of them is green the player lost
pop cx
loop checkPixel
endProc:
pop ax
popa
ret
endp checkAliensDown
我试过推和弹出啊,但没有成功