接收键盘字符,(以回车键结束),并将其中的小写字母转变为大写字母,然后显示在屏幕上,请用汇编实现。
试试下面的:
DATA SEGMENT
MSG1 DB 13, 10, 'Please input a STR : $'
MSG2 DB 13, 10, 'The STR in Upper is: $'
I1_L DB 100
I1_N DB ?
I1_B DB 100 DUP (?)
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE, DS:DATA
START:
MOV AX, DATA
MOV DS, AX
LEA DX, MSG1
MOV AH, 9
INT 21H
LEA DX, I1_L
MOV AH, 10
INT 21H
LEA BX, I1_B
MOV CL, I1_N
MOV CH, 0
LOP:
MOV AL, [BX]
CMP AL, 'a'
JB NEXT
CMP AL, 'z'
JA NEXT
TO_UPPER:
AND AL, 11011111B
MOV [BX], AL
NEXT:
INC BX
LOOP LOP
DISP:
MOV BYTE PTR [BX], '$'
LEA DX, MSG2
MOV AH, 9
INT 21H
LEA DX, I1_B
MOV AH, 9
INT 21H
MOV AH, 4CH
INT 21H
CODE ENDS
END START
那个机器的汇编语言啊