我要求用户输入一个大写字母并将其转换为小写。我需要在新行上显示小写字母。这是我的代码:
org 100h
include 'emu8086.inc'
printn "Enter a upper case character"
mov ah,1
int 21h ;input a character into AL
mov bl,al
mov ah,0eh
mov al,bl
add al,20h
int 10h ;display lower case
输出应该是:
-> Enter a upper case character
-> A
-> a
当前结果:
-> Enter a upper case character
-> Aa
如何将小写字母a添加到新行?
答案 0 :(得分:1)
新行的序列为0Dh 0Ah
。您可以使用int 10h / 0Eh
打印此序列,就像它是字符一样:
org 100h
include 'emu8086.inc'
printn "Enter a upper case character"
mov ah,1
int 21h ;input a character into AL
mov bl,al
mov ah, 0Eh ;print new line sequence
mov al, 0Dh
int 10h
mov al, 0Ah
int 10h
mov ah,0eh
mov al,bl
add al,20h
int 10h ;display lower case
ret