0
我正在爲我的學校及其打印已簽名和未簽名的數字進行組裝實驗。它不斷打印無限量的「 - /」,但它應該打印一個數字。數字到ASCII值的偏移是否爲30h?在程序集中打印單個和未簽名的數字
Display .EQU 04E9h
NumAddr .EQU 0050h
Main:
mov BX, NumAddr
mov DX, Display
mainLoop:
MOV AH,[BX]
cmp AH, 0h ; is number 0?
JE EndPrt ; if yes we are done
CMP AH,0h
JG posNum ; should jump to posNum if AH is positive
negNum:
mov AL, 2Dh
out DX,AL ; print a negative sign
NEG AH ; turn AH into a positive number
printPos:
MOV AL,[BX]
ADD AL, 30h ; should add required offset to convert to ASCII
out DX,AL
MOV AL, 0Dh
out DX,AL
MOV AL, 0Ah
out DX,AL
inc BX
jmp mainLoop
EndPrt:
HLT
.END Main