0
.MODEL medium
.STACK ; Stack default size 1024 bytes
.DATA ; Data segment (for variables)
.CODE ; Run-able code goes in code segment
.STARTUP ; Handover code from OS call to typer.exe
nextc: mov ah,8 ; Call int21 with ah=8 returns with
int 021h ; al equal to the ASCII character pressed
mov dl,al ; dl is assigned value in al, dl=al
mov ah,02h ; Call int21 with ah=2 prints ASCII
int 021h
cmp dl,'q' ; compare dl with ASCII ‘q’=
jz qt ; if key pressed was not a ‘q’ go back
cmp dl,'/'
jnc skp
cmp dl,'9' ;;compair 9 to q. if there is a carry 9<q
jc skp
skp:
jmp nextc
qt:
.EXIT ; Terminate and return control to OS
END ; End of file (for compiler)
我相當肯定我的邏輯是確定的,而這個問題是在臨印刷statment地方 – Aaron
對不起窮人的解釋,但即時通訊試圖讓它打印包含0-9的數字並在q上終止。 – Aaron
我在我的手機,但你的嘗試是在某種程度上在正確的方向。你需要檢查輸入的內容。但是你沒有檢查0-9的所有內容。 –