一旦输入了空格字符,我的输入就很难打印出来。到目前为止,我让它显示输入的大写/小写,但是一旦我输入一个字符串,它就不会读取空格字符之后的内容。有什么建议么?
编辑:英特尔 x86 处理器和即时通讯使用 EMU8086
org 100h
include 'emu8086.inc'
printn "Enter string to convert"
mov dx,20
call get_string
printn
mov bx,di
mov ah,0eh
mov al,[ds+bx]
cmp al, 41h
cmp al, 5Ah
jle ToLower1
cmp al, 61h
cmp al, 7ah
jle ToUpper1
ToLower1:
add al, 20h
int 10h
jmp stop1
ToUpper1:
sub al, 20h
int 10h
stop1:
inc bx
mov al,[ds+bx]
cmp al, 41h
cmp al, 5Ah
jle ToLower2
cmp al, 61h
cmp al, 7ah
jle ToUpper2
ToLower2:
add al, 20h
int 10h
jmp stop2
ToUpper2:
sub al, 20h
int 10h
stop2:
inc bx
mov al,[ds+bx]
cmp al, 41h
cmp al, 5Ah
jle ToLower3
cmp al, 61h
cmp al, 7ah
jle ToUpper3
ToLower3:
add al, 20h
int 10h
jmp stop3
ToUpper3:
sub al, 20h
int 10h
stop3:
inc bx
mov al,[ds+bx]
cmp al, 41h
cmp al, 5Ah
jle ToLower4
cmp al, 61h
cmp al, 7ah
jle ToUpper4
ToLower4:
add al, 20h
int 10h
jmp stop4
ToUpper4:
sub al, 20h
int 10h
stop4:
inc bx
mov al,[ds+bx]
cmp al, 41h
cmp al, 5Ah
jle ToLower5
cmp al, 61h
cmp al, 7ah
jle ToUpper5
ToLower5:
add al, 20h
int 10h
jmp stop5
ToUpper5:
sub al, 20h
int 10h
stop5:
printn
hlt
define_get_string
define_print_string
end