早教吧作业答案频道 -->其他-->
求汇编的答案~~~~1.键入一个字符(1号功能)2.判断是否为大小写英文字符(CMP)3.是英文字母,计算它的顺序号,并进行显示,否则,显示‘*’。(要显示序号时,需将顺序号的十位
题目详情
求汇编的答案~~~~
1. 键入一个字符(1号功能)
2. 判断是否为大小写英文字符(CMP)
3. 是英文字母,计算它的顺序号,并进行显示,否则,显示‘*’。(要显示序号时,需将顺序号的十位数和个位数分别转换成ASCII码,并一一进行,2号功能)
1. 键入一个字符(1号功能)
2. 判断是否为大小写英文字符(CMP)
3. 是英文字母,计算它的顺序号,并进行显示,否则,显示‘*’。(要显示序号时,需将顺序号的十位数和个位数分别转换成ASCII码,并一一进行,2号功能)
▼优质解答
答案和解析
先占个位置,傍晚有空再帮你弄,希望在我帮你弄之前有人已经帮你弄出来
傍晚调试十有些与理想结果有点差距,结果回来加了一句add ax,3030h后调试完美通过,尽量应用封装技术(子程序)使得程序四路清晰易读,同时也尽量使得子程序名做到“顾名思义”,如果你看起来不吃了,那我还算是welldone的了,有好些“入出栈对”不是必须的,本来也没有,是在排错中习惯添加的,自己可以根据需要删减。本程序按下ESC推出
;---------------------------------------------------------------------------------------------------
data segment
; add your data here!
ends
stack segment
dw 128 dup(0)
ends
code segment
;----------------------------
start:
; set segment registers:
mov ax, data
mov ds, ax
mov es, ax
; add your code here
again:
call readchar
cmp al,1bh
jz exit
cmp al,41h ; jl ostar
cmp al,7ah
jg ostar ;>z
cmp al,5ah
jle oindex ; cmp al,61h
jge oindex ;>a
ostar:
call newline_begin
call out_star
jmp again
oindex:
call newline_begin:
call out_index
jmp again
exit:
mov ah,4ch
int 21h
;---------------------------------
;call readchar
readchar proc near
mov ah,01h
int 21h
ret
readchar endp
;---------------------------------
;call out_star
out_star proc near
push ax
mov dl,2ah
mov ah,02h
int 21h
pop ax
call newline_begin
ret
out_star endp
;---------------------------------
;call newline_begin
newline_begin proc near
push ax
mov ah,02h
mov dl,0ah
int 21h
mov dl,0dh
int 21h
pop ax
ret
newline_begin endp
;---------------------------------
;call out_index
out_index proc near
push ax
cmp al,5ah ; jg lowletter
sub al,40h ;upletter_index
call outal_Denum
jmp last
lowletter:
sub al,60h ;lowletter_index
call outal_Denum
last:
pop ax
ret
out_index endp
;---------------------------------
;call outal_Denum
outal_Denum proc near
push ax
mov ah,00h;xor ah,ah
;cbw
mov cl,0ah
div cl
add ax,3030h;
mov dl,al
call outdl
mov dl,ah
call outdl
call newline_begin
pop ax
ret
outal_Denum endp
;---------------------------------
;call outdl
outdl proc near
push ax
mov ah,02h
int 21h
pop ax
ret
outdl endp
;---------------------------------
ends
end start ; set entry point and stop the assembler.
;-------------------------------------------------------------------------------------------------
附加cmd模式下部分调试结果:
C:\codestest>zimutest1.exe
a
01
b
02
c
03
d
04
e
05
f
06
A
01
B
02
C
03
D
04
E
05
F
06
0
*
1
*
2
*
3
*
4
*
5
*
←
C:\CODEST~1>
傍晚调试十有些与理想结果有点差距,结果回来加了一句add ax,3030h后调试完美通过,尽量应用封装技术(子程序)使得程序四路清晰易读,同时也尽量使得子程序名做到“顾名思义”,如果你看起来不吃了,那我还算是welldone的了,有好些“入出栈对”不是必须的,本来也没有,是在排错中习惯添加的,自己可以根据需要删减。本程序按下ESC推出
;---------------------------------------------------------------------------------------------------
data segment
; add your data here!
ends
stack segment
dw 128 dup(0)
ends
code segment
;----------------------------
start:
; set segment registers:
mov ax, data
mov ds, ax
mov es, ax
; add your code here
again:
call readchar
cmp al,1bh
jz exit
cmp al,41h ; jl ostar
cmp al,7ah
jg ostar ;>z
cmp al,5ah
jle oindex ;
jge oindex ;>a
ostar:
call newline_begin
call out_star
jmp again
oindex:
call newline_begin:
call out_index
jmp again
exit:
mov ah,4ch
int 21h
;---------------------------------
;call readchar
readchar proc near
mov ah,01h
int 21h
ret
readchar endp
;---------------------------------
;call out_star
out_star proc near
push ax
mov dl,2ah
mov ah,02h
int 21h
pop ax
call newline_begin
ret
out_star endp
;---------------------------------
;call newline_begin
newline_begin proc near
push ax
mov ah,02h
mov dl,0ah
int 21h
mov dl,0dh
int 21h
pop ax
ret
newline_begin endp
;---------------------------------
;call out_index
out_index proc near
push ax
cmp al,5ah ;
sub al,40h ;upletter_index
call outal_Denum
jmp last
lowletter:
sub al,60h ;lowletter_index
call outal_Denum
last:
pop ax
ret
out_index endp
;---------------------------------
;call outal_Denum
outal_Denum proc near
push ax
mov ah,00h;xor ah,ah
;cbw
mov cl,0ah
div cl
add ax,3030h;
mov dl,al
call outdl
mov dl,ah
call outdl
call newline_begin
pop ax
ret
outal_Denum endp
;---------------------------------
;call outdl
outdl proc near
push ax
mov ah,02h
int 21h
pop ax
ret
outdl endp
;---------------------------------
ends
end start ; set entry point and stop the assembler.
;-------------------------------------------------------------------------------------------------
附加cmd模式下部分调试结果:
C:\codestest>zimutest1.exe
a
01
b
02
c
03
d
04
e
05
f
06
A
01
B
02
C
03
D
04
E
05
F
06
0
*
1
*
2
*
3
*
4
*
5
*
←
C:\CODEST~1>
看了求汇编的答案~~~~1.键入一...的网友还看了以下:
下列有关使用大雁DY-570学生计算器的说法错误的是()A.求5.2×10-2的按键顺序是B.求( 2020-04-07 …
1.()的立方与它的平方互为相反数2.用计算机计算,其按键顺序为(1)(0)(.)(2)(X的三次 2020-04-25 …
下列说法正确的是()A.用计算器进行混合运算时,应先按键进行乘方运算,再按键进行乘除运算,最后按键 2020-05-14 …
下列说法正确的是()A.用计算器进行混合运算时,应先按键进行乘方运算,再按键进行乘除运算,最后按键 2020-05-14 …
下列说法正确的是()A.用计算器进行混合运算时应先按键进行乘方运算再按键进行乘除运算最后按键进行 2020-05-14 …
敢于直言的历史名人的故事?(最简洁但语句通顺的为佳)如上. 2020-06-07 …
谁帮帮我、把电脑键盘的顺序概括成一句话,我想快速记住电脑键盘的顺序就是把键盘的字母拼成一个汉字,然 2020-07-15 …
使用科学计算器进行计算,其按键顺序为:则输出结果为()A.-288B.-18C.-24D.-32 2020-12-06 …
逻辑谜题,有4个键位如右:←→←→每按其中一个键位,所按的键位与其相邻的两个键位就会顺时针旋转90度 2020-12-17 …
从实验测得不同物质中O-O键之间的键长和键能的数据如下其中x、y的键能数据尚未测定,但可根据规律性推 2021-01-05 …