I am doing an assembly lab for my school and its on printing signed and unsigned numbers. It keeps printing an infinite amount of "-/" but it should be printing a number. Is the offset for number to ascii value 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