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

加入VIP,免费下载
 

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

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

下载须知

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

版权提示 | 免责声明

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

深职院asm课程考试资料.docx

1、深职院asm课程考试资料/求负 .model small .386 .codestart: mov ax,17eh neg ax mov ax,0 neg ax .exit end start/*while循环* .model small .386 .data kdbbuf byte 33h,38h,32h,0dh temp word ? .stack 20h .code start: mov ax,data mov DS,ax push bx push cx push di ; lea di,kdbbuf mov cx,10 mov bx,0 ;readn: mov al,di .repea

2、t inc di sub al,30h push ax mov ax,bx mul cx mov bx,ax pop ax mov ah,0 add bx,ax mov al,di .until al39h ;readend: mov temp,bx pop di pop cx pop bx nop .exit end start /二进制转换ASCII .model small .386 .data ShuChu byte 10h dup (0) Temp word 17Eh .stack 20h .codeStart: mov ax,data mov DS,ax; mov ax,Temp

3、lea di,ShuChu mov cx,0 mov bx,10 Loop1: mov dx,0 div bx push dx inc cx or ax,ax jnz Loop1; Loop2: pop dx add dl,30h mov di,dl inc di loop Loop2 ; .exit end Start/*显示hello word!按回车退出* .model small .386 .data .stack 10hkeybuf byte h,e,l,l,o,20h,w,o,r,d,! .codestart: mov ax,data mov ds,ax lea di,keybuf

4、WaitInput: mov al,di inc di/显示字符 mov ah,06h mov dl,al int 21h/ cmp al,! jne WaitInputWaitInput2:/读按键 mov ah,06h mov dl,0ffhWaitInput3: int 21h jz WaitInput3/ mov ah,06h mov dl,al int 21h cmp al,0dh je xxx jmp WaitInput2xxx: .exit end start/*声音*880Hz=54B。987.76Hz=4b7。1046.5Hz=474。1174.66Hz=3f7。1318.5

5、1Hz=388。1396.92Hz=356。1567.98Hz=2f8。1760Hz=2a5 .model small .386 .data .stack 10h .codestart: mov al,0b6h out 43h,al mov cx,54bh;/传送 mov al,cl out 42h,al mov al,ch out 42h,al;/打开扬声器 in al,61h or al,3 out 61h,al;/延时 mov ecx,0fffffffhdelay: loopd delay;/关闭扬声器 in al,61h and al,0fch out 61h,al jmp start

6、finished: nop .exit end Start/*从键盘输入两个数,输出相加结果* .model small .386 .stack 10h .datamsg1 byte A,=,0dhmsg2 byte B,=,0dhkeybuf1 byte 10h dup(0)keybuf2 byte 10h dup(0)printbuf byte 10h dup(0)temp1 word ?temp2 word ? .codestart: mov ax,data mov ds,ax;=显示msg1 A= lea si,msg1shownext: mov dl,si cmp dl,0dh je

7、 inputdata mov ah,06h int 21h inc si jmp shownext;=输入数据,显示数据,保存=inputdata: lea di,keybuf1inputnext:;输入; mov ah,06h mov dl,0ffhwaitinput: int 21h jz waitinput cmp al,0dh je inputend;显示; mov dl,al int 21h;保存; mov di,al inc di jmp inputnextinputend: mov di,al;=转换二进制= lea di,keybuf1 mov cx,10 mov bx,0 r

8、eadn: mov al,di inc di cmp al,30h jb readend cmp al,39h ja readend sub al,30h push ax mov ax,bx mul cx mov bx,ax pop ax mov ah,0 add bx,ax jmp readn ;readend: mov temp1,bx ;=回车换行= mov ah,06h mov dl,0dh int 21h mov dl,0ah int 21h;=显示msg2 B= lea si,msg2shownext2: mov dl,si cmp dl,0dh je inputdata2 mov

9、 ah,06h int 21h inc si jmp shownext2;=输入数据,显示数据,保存=inputdata2: lea di,keybuf2inputnext2:;输入; mov ah,06h mov dl,0ffhwaitinput2: int 21h jz waitinput2 cmp al,0dh je inputend2;显示; mov dl,al int 21h;保存; mov di,al inc di jmp inputnext2inputend2: mov di,al;=转换二进制= lea di,keybuf2 mov cx,10 mov bx,0 readn2:

10、 mov al,di inc di cmp al,30h jb readend2 cmp al,39h ja readend2 sub al,30h push ax mov ax,bx mul cx mov bx,ax pop ax mov ah,0 add bx,ax jmp readn2 ;readend2: mov temp2,bx ;=回车换行= mov ah,06h mov dl,0dh int 21h mov dl,0ah int 21h ;=相加= mov ax,temp1 mov bx,temp2 add ax,bx ;=二进制转十六进制= lea di,printbuf mo

11、v cx,0 mov bx,10 ;writen1: mov dx,0 div bx push dx inc cx or ax,ax jnz writen1 ;writen2: pop dx add dl,30h mov di,dl inc di loop writen2 mov byte ptrdi,0dh;=显示结果 lea si,printbufshownext3: mov dl,si cmp dl,0dh je Jieshu mov ah,06h int 21h inc si jmp shownext3;Jieshu: nop .exit end Start/*从CMOS读 年 月 日

12、,显示* .model small .386 .stack 10haddrport equ 70hdataport equ 71h .datadate byte 00h,00h,00hdatebuf byte 00h,00h,-,00h,00h,-,00h,00h,0dh .codestart: mov ax,data mov ds,ax;=将年月日读到date= mov cx,3 lea si,date in al,addrport and al,80h add al,9readcoms: out addrport,al;=延时= push cx mov cx,0ffhdelay: loop

13、 delay pop cx;=从dataport读数据到al= push ax in al,dataport mov si,al pop ax dec al inc si loop readcoms;=将date的BCD码转为ASCII码,存入datebuf= mov cx,3 lea si,date lea di,datebufbcd2asc:;=BCD转ASCII= mov al,si mov ah,si shr al,4 and al,0fh and ah,0fh add al,30h add ah,30h mov di,al inc di mov di,ah inc si inc di

14、 inc di loop bcd2asc;=显示datebuf= lea si,datebufshownext: mov dl,si cmp dl,0dh je jieshu mov ah,06h int 21h inc si jmp shownext;=等待按键结束= mov dl,0ffh mov ah,06hwaitinput: int 21h jz waitinputjieshu: .exit end start /*连加*从1加到10= .model small .386 .datatemp word ? .stack 10h .codemain proc far mov ax,da

15、ta mov ds,ax mov cx,10 mov ax,0 call lianjia .exitmain endplianjia proc near add ax,cx loop lianjia mov temp,bx retlianjia endp end main/*IF语句*;判断键盘输入为1.2.3.4分别传送A,B,C,D.用高级语言 .model small .386 .stack 10h .codestart: mov ax,data mov ds,ax mov dl,0ffh mov ah,06hwaitinput: int 21h jz waitinput.IF al=1

16、 mov ah,A.ELSEIF al=2 mov ah,B.ELSEIF al=3 mov ah,C.ELSEIF al=4 mov ah,D.ELSE mov ah,E.ENDIF .exit end start /*子程序调用IF HELLO WORD*;子程序调用 .IF .ELSEIF .ELSE .ENDIF 显示shownext .model small .386 .stack 10h .datamsg1 byte H,E,L,L,O, ,W,O,R,L,D,0dh .codemain proc far mov ax,data mov ds,ax lea si,msg1 call

17、 showmsg nop .exitmain endpshowmsg proc near uses si dx axshownext: mov dl,si.IF dl!=0dh mov ah,06h int 21h inc si jmp shownext.ELSE ret.ENDIFshowmsg endp .exit end main/*.IF.ELSEIF .ELSE ENDIF 转换2bin;1-8用子函数,.IF .ELSEIF .ELSE .ENDIF ASCII转换2bin .model small .386 .datakeybuf byte 33h,38h,32h,0dhtemp

18、 word ? .stack 30h .codemain proc far mov ax,data mov ds,ax lea di,keybuf call bin2asciimain endpbin2ascii proc near uses ax bx cx mov bx,0 mov cx,10DuShu: mov al,di ;di放入ax低8位 inc di.IF al=39h mov temp,bx ret.ELSEIF al=30h mov temp,bx ret.ENDIF sub al,30h push ax mov ax,bx mul cx ;ax=ax*cx mov bx,a

19、x pop ax mov ah,0 add bx,ax jmp DuShu retbin2ascii endp end main;*从1加到10* .model small .386 .datatemp word ? .stack 10h .codestart: mov ax,data mov ds,ax mov cx,0 mov ax,0 .while cx=10 add ax,cx inc cx .endw .exitend start*.break .continue* .model small .386 .data databuf byte 13h,12h,#,02h,#,19h,0d

20、h .stack 20h .code start: mov ax,data mov DS,ax lea di,databuf mov bx,0 .while 1 mov al,di inc di .break .if al=0dh .continue .if al=# mov ah,0 add bx,ax .endw nop .exit end start /*模块汇编*/c+#include stdafx.h#include iostreamusing namespace std;extern C void decitohexa(int,char *);char buffer35 = Ent

21、er a number between 0 and 9999:;char hexanum5;int decinum=0;void main(void) coutbufferdecinum; coutendl; decitohexa(decinum,hexanum); coutthe hexadecimal value of decinum is ; couthexanum; coutnendl;/asm文件 .386 .model flat,c .stack 1024 .code public decitohexa decitohexa proc c uses eax edi ecx edx

22、decidata,hexadata:ptr xor eax,eax mov eax,decidata shl eax,16 mov edi,hexadata mov ecx,4next: mov edx,eax shl eax,4 rol edx,4 and dl,0fh add dl,30h cmp dl,39h jbe storeasc add dl,7storeasc: mov edi,dl inc edi loop next mov byte ptr edi,0 retdecitohexa endp end/*内嵌汇编*/ xm12_4.cpp : Defines the entry

23、point for the console application./#include stdafx.h#include iostreamusing namespace std;char buffer35 = Enter a number between 0 and 9999:;char hexanum5;int decinum=0;void decitohexa(int decidata,char *hexadata) _asm xor eax,eax mov eax,decidata shl eax,16 mov edi,hexadata mov ecx,4next: mov edx,ea

24、x shl eax,4 rol edx,4 and dl,0fh add dl,30h cmp dl,39h jbe storeasc add dl,7storeasc: mov edi,dl inc edi loop next mov byte ptr edi,0 void main(void) coutbufferdecinum; coutendl; decitohexa(decinum,hexanum); coutthe hexadecimal value of decinum is ; couthexanum; coutnendl;/*模块汇编*加法* .model small .38

25、6 .stack 20h .data msg1 byte A,=,0dh msg2 byte B,=,0dh msg3 byte A,+,B,=,0dh data1ascii byte 6 dup(0) data2ascii byte 6 dup(0) data1 word 0 data2 word 0 data3 word 0 sum byte 6 dup(0) .codeMain proc far mov ax,data mov ds,axnext: call return ;调用回车换行子过程 lea si,msg1 call showmsg ;调用显示信息的子过程showmsg显示“A=” lea di,data1ascii call input ;调用键盘输

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

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