早教吧作业答案频道 -->其他-->
求汇编的答案~~~~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 …
简述处理2、处理3和处理4做何种处理,若有排序处理则需指明排序的键及序(升序或降序)。 2020-05-26 …
A.需要一张n个关键字的有序表B.需要对n个关键字进行动态插入C.需要n个关键字的查找概率表D. 2020-05-26 …
编码规则1、键名汉字不需拆,把所在键连敲四下即可。如王土大木工就是键名,同一个区的键名要编码规则1 2020-06-15 …
快速排序法问题设待排关键码序列为(25,18,9,33,67,82,53,95,12,70),要按 2020-07-01 …
阅读下面的材料,根据要求写一篇不少于800字的文章。传统工艺中打造一面铜锣,往往需要经过千锤锻打, 2020-07-07 …
阅读下面的材料,根据要求写一篇不少于800字的文章。传统工艺中打造一面铜锣,往往需要经过千锤锻打, 2020-07-07 …
求希尔排序第一趟排序结果给定结点的关键字序列(F、B、J、G、E、A、I、D、C、H),对它按字母 2020-07-23 …
用计算器求86+14的按键顺序正确的是()①输入数据86依次按键8和6;②输入数据14依次按数字键 2020-07-25 …
要求用c语言设计一个程序题目从以下任选高手速度主要需要1程序设计功能图2详细设计3程序运行界面4调试 2020-11-28 …