ImageVerifierCode 换一换
格式:DOCX , 页数:19 ,大小:16.93KB ,
资源ID:6834120      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/6834120.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(内存单元中有一个ASCII码表.docx)为本站会员(b****6)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

内存单元中有一个ASCII码表.docx

1、内存单元中有一个ASCII码表编写程序,实现表的处理:内存单元中有一个ASCII码表,编写程序完成下面的功能: 首先输出表的内容; 插入一个数据,插入的数据和插入的位置从键盘输入; 对表中的数据进行排序,按升顺或降顺排序可以进行选择; 在表中查找某一个关键字,要查找的关键字从键盘输入;如果找到,输出查找的关键字并给出提示“find”,否则给出提示“no find”; 程序执行以后,输出表中的插入以后的内容和排序以后的内容; 程序有友好的运行界面;要求程序能够处理基本的错误信息;data segmenttable db20 4b 26 37 7c,0ah,0dh,$str db which da

2、ta you want to insert and where it is?,0ah,0dh,$meg db Sorting the table,you want it on the basis of db ascending order or descending order?,0ah,0dh db 1 represent ascending order.,0ah,0dh db 2 represent descending order.,0ah,0dh,$meg1 db error ,make another choice.,0ah,0dh,$meg2 db Input the data y

3、ou want to be found.,0ah,0dh,$meg3 dbfind,0ah,0dh,$meg4 db no find,0ah,0dh,$inf db *ASCII TABLE(before change)*,0ah,0dh,$inf1 db *ASCII TABLE(ascending order)*,0ah,0dh,$inf2 db *ASCII TABLE(descending order)*,0ah,0dh,$num db 3 db ? db 3 dup(?)data endscode segment assume cs:code,ds:data,es:datastart

4、:mov ax,data mov ds,ax lea dx,table mov ah,9 int 21h lea dx,str mov ah,9 int 21h mov ah,1 int 21h push ax call non pop ax sub al,30h xor ah,ah mov cl,3 mul cl mov bx,ax mov ah,1 int 21h mov tablebx,al mov ah,1 int 21h mov tablebx+1,al call non lea dx,meg mov ah,9 int 21hinput:mov ah,1 int 21h push a

5、x call non pop ax cmp al,31h je x1 cmp al,32h je x2 lea dx,meg1 mov ah,9 int 21h jmp inputx1:mov cl,5 dec cloutlp:mov ch,cl mov si,offset table inlp: mov al,si and al,0fh mov dl,al push cx mov cl,4 shl dl,cl pop cx mov al,si+1 cmp al,61h jae b2 and al,0fh or dl,al jmp a1b2:sub al,57h add dl,al a1: m

6、ov al,si+3 and al,0fh mov bl,al push cx mov cl,4 shl bl,cl pop cx mov al,si+4 cmp al,61h jae a3 and al,0fh or bl,al jmp a2a3:sub al,57h add bl,ala2: cmp dl,bl jna next mov al,si xchg al,si+3 mov si,al mov al,si+1 xchg al,si+4 mov si+1,alnext: add si,3 dec ch jnz inlp loop outlp lea dx,table mov ah,9

7、 int 21h jmp selectx2:mov cl,5 dec cloutl:mov ch,cl mov si,offset table inl: mov al,si and al,0fh mov dl,al push cx mov cl,4 shl dl,cl pop cx mov al,si+1 cmp al,61h jae c4 and al,0fh or dl,al jmp c1c4:sub al,57h add dl,al c1: mov al,si+3 and al,0fh mov bl,al push cx mov cl,4 shl bl,cl pop cx mov al,

8、si+4 cmp al,61h jae c3 and al,0fh or bl,al jmp c3c3:sub al,57h add bl,alc2: cmp dl,bl jae nex mov al,si xchg al,si+3 mov si,al mov al,si+1 xchg al,si+4 mov si+1,alnex: add si,3 dec ch jnz inl loop outl lea dx,table mov ah,9 int 21hselect:lea dx,meg2 mov ah,9 int 21h mov ah,1 int 21h mov bl,al and al

9、,00fh mov dl,al mov cl,4 shl dl,cl mov ah,1 int 21h mov bh,al and al,00fh or al,dl mov cx,15 mov di,offset table mov al,bl repne scasb jnz non_find mov al,bh repne scasb jz findnon_find:call non lea dx,meg4 mov ah,9 int 21h jmp printfind:call non lea dx,meg3 mov ah,9 int 21hprint:lea dx,table mov ah

10、,9 int 21h mov ah,4ch int 21hnon proc mov dl,0ah mov ah,2 int 21h mov dl,0dh mov ah,2 int 21h retnon endpcode endsend startdata segmenttable db20 4b 26 37 7c,0ah,0dh,$data endscode segment assume cs:code,ds:datastart: mov ax,data mov ds,ax x1:mov cl,5 dec cloutlp:mov ch,cl mov si,offset table inlp:

11、mov al,si and al,0fh mov dl,al push cx mov cl,4 shl dl,cl pop cx mov al,si+1 cmp al,61h jae b2 and al,0fh or dl,al jmp a1b2:sub al,57h add dl,al a1: mov al,si+3 and al,0fh mov bl,al push cx mov cl,4 shl bl,cl pop cx mov al,si+4 cmp al,61h jae x2 and al,0fh or bl,al jmp a2x2:sub al,57h add bl,ala2: c

12、mp dl,bl jna next mov al,si xchg al,si+3 mov si,al mov al,si+1 xchg al,si+4 mov si+1,alnext: add si,3 dec ch jnz inlp loop outlp lea dx,table mov ah,9 int 21hmov ah,4chint 21hcode endsend startmov bx,ax mov si,ax add si,2 mov di,si dec si mov cx,5 rep movsb mov ah,1 int 21h mov tablebx,al mov ah,1 i

13、nt 21h mov tablebx+1,al output macro local print1 lea dx,inf mov ah,9 int 21h mov si,0 mov cx,48 mov bl,4print1: mov dl,tablesi mov ah,2 int 21h inc si loop print1 dec bl mov cx,48 mov dl,0ah mov ah,2 int 21h mov dl,0dh mov ah,2 int 21h jnz print1 lea dx,inf1 mov ah,9 int 21hendmdata segmenttable db

14、20 35 33 1a 1d 4b 26 08 02 0d 03 34 2c 2a 27 0d db3d 01 48 3b 4c 22 4a 40 36 50 56 39 3e 52 3a 44 db76 69 6a 6b 7d 60 63 70 7c 6c 5c 5a 65 60 59 5f db count =$-table-1str db where insert: $str1 db insert: $meg db ascending order or descending order?,0ah,0dh db 1 represent ascending order.,0ah,0dh db

15、 2 represent descending order.,0ah,0dh,$meg1 db error ,make another choice.,0ah,0dh,$meg2 db Input the data you want to be found: $meg3 dbfind,0ah,0dh,$meg4 db no find,0ah,0dh,$inf db *ASCII TABLE*,0ah,0dh,$inf1 db *,0ah,0dh,$data endscode segment assume cs:code,ds:data,es:datastart:mov ax,data mov

16、ds,ax mov es,ax output insert: lea dx,str mov ah,9 int 21h mov ah,1 int 21h and al,00fh mov dl,10;wojiade mul dl;wojiade mov dx,ax mov cl,4 shl dl,cl mov ah,1 int 21h and ax,00fh;al改成ax add dx,ax;原来是or al,dl dec dx;wojiade mov ax,dx;wojiade push ax call non pop ax xor ah,ah mov cl,3 mul cl mov bx,ax

17、; bx 存放插入位置的三倍 mov al,48 push ax; 入栈 连同ah和48 mul cl; ax 48*3 mov cx,ax; cx 483存入 std inc cx;我加的 sub cx,bx;wojiade mov si,ax add ax,3 mov di,ax sub ax,3 rep movsb lea dx,str1 mov ah,9 int 21h mov ah,1 int 21h mov tablebx,al mov ah,1 int 21h mov tablebx+1,al call non output lea dx,meg mov ah,9 int 21h

18、choose_order: mov ah,1 int 21h push ax call non pop ax cmp al,31h je x1 cmp al,32h je x2 lea dx,meg1 mov ah,9 int 21h jmp choose_orderx1: mov cl,49 dec cla0: mov ch,cl mov si,offset table a1: mov al,si and al,0fh mov dl,al push cx mov cl,4 shl dl,cl pop cx mov al,si+1 cmp al,61h jae a3 and al,0fh or

19、 dl,al jmp a4a3: sub al,57h add dl,al a4: mov al,si+3 and al,0fh mov bl,al push cx mov cl,4 shl bl,cl pop cx mov al,si+4 cmp al,61h jae a5 and al,0fh or bl,al jmp a6a5: sub al,57h add bl,ala6: cmp dl,bl jna next mov al,si xchg al,si+3 mov si,al mov al,si+1 xchg al,si+4 mov si+1,alnext: add si,3 dec

20、ch jnz a1 loop a0 jmp selectx2: mov cl,49 dec clb0: mov ch,cl mov si,offset table b1: mov al,si and al,0fh mov dl,al push cx mov cl,4 shl dl,cl pop cx mov al,si+1 cmp al,61h jae b2 and al,0fh or dl,al jmp b3b2: sub al,57h add dl,al b3: mov al,si+3 and al,0fh mov bl,al push cx mov cl,4 shl bl,cl pop

21、cx mov al,si+4 cmp al,61h jae b4 and al,0fh or bl,al jmp b5b4: sub al,57h add bl,alb5: cmp dl,bl jae next1 mov al,si xchg al,si+3 mov si,al mov al,si+1 xchg al,si+4 mov si+1,alnext1: add si,3 dec ch jnz b1 loop b0 select:lea dx,meg2 mov ah,9 int 21h mov ah,1 int 21h mov bl,al and al,00fh mov dl,al m

22、ov cl,4 shl dl,cl mov ah,1 int 21h mov bh,al and al,00fh or al,dl mov bl,al mov cx,48c1: mov al,si and al,0fh mov dl,al push cx mov cl,4 shl dl,cl pop cx mov al,si+1 cmp al,61h jae c2 and al,0fh or dl,al jmp c3c2: sub al,57h add dl,alc3: cmp bl,dl jnz non_find find: call non lea dx,meg3 mov ah,9 int 21h jmp printnon_find:add si,3 loop c1 call non lea dx,meg4 mov ah,9 int 21hprint: output mov ah,4ch int 21h non proc mov dl,0ah mov ah,2 int 21h mov dl,0dh mov ah,2 int 21h retnon endpcode endsend start

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1