编写程序,从键盘接收一个小写字母,然后找出它的前导字符和后续字符,再按顺序显示这三个字符.(汇编语言

2025-03-23 07:32:37
推荐回答(3个)
回答1:


.model small
.386
.code
MAIN PROC FAR
start:
push ds
sub ax,ax
push ax
input:
mov ah,7H
int 21H
cmpe:
cmp al,20H
JE exit
cmp al,61H
JL input
cmp al,7AH
JG input
print:
sub al,01H
mov dl,al
mov ah,02H
int 21H
add al,01H
mov dl,al
mov ah,02H
int 21H
add al,01H
mov dl,al
mov ah,02H
int 21H
;输出换行回车
mov dl,0AH
mov ah,02H
int 21H
jmp input
exit :
ret
MAIN ENDP
END start

回答2:

clear
accept "请输入一个字符串:" to x
s=0
for i=1 to len(x)
k=substr(x,i,1)
if k="a" or k="A"
s=s+1
endif
enddo
?"其中字母a有:",s

回答3:

遗憾哦

没有 汇编语言 环境