我有一个问题,让我的脑海里面如何存储用户从提示输入的8位无符号整数。我目前的代码是:存储一个8位无符号整数
lea dx, StrPrompt ;load prompt to display to the user
mov ah, 9h ;display string subroutine
int 21h ;interrupt for MS-DOS routine
mov ah, 1h ;Read character subroutine (will be stored in al)
int 21h ;Interrupt for MS-DOS
sub al, 30h ;Translate al from ASCII code to number
mov num, al ;Copy number to num (al will be overwritten later)
lea dx, StrMsg ;display the results to the user
mov ah, 9h
int 21h
mov al, num ;move the n value to the al
mov dl, al ;display the number
add dl, 30h ;add 30h to the ASCII table
mov ah, 2h ;store interrupt code
int 21h ;interrupt for MS-DOS routine
现在的问题是,我每次运行这段时间只会让我进入像1,2,3,等我无法输入一个整数在一个双或三位数字像20或255.我怎么去解决这个问题?
随着“中间体21/AH = 0AH”我们可以得到一个缓冲输入回路:[链接] HTTP:// WWW .ctyme.com/intr/rb-2563.htm – 2014-11-09 09:09:16