第一范文网 - 专业文章范例文档资料分享平台

合工大总汇编语言程序设计实验报告材料

来源:用户分享 时间:2025/5/17 12:51:39 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

实用标准

again: shl bl,1 jc next add si,3 loop again next:

add si,offset jmptable jmp si

jmptable:

jmp near ptr l1 jmp near ptr l2 jmp near ptr l3 jmp near ptr l4 jmp near ptr l5 jmp near ptr l6 jmp near ptr l7 jmp near ptr l8 l1:

lea dx,str1 jmp output l2:

lea dx,str2 jmp output l3:

lea dx,str3 jmp output l4:

lea dx,str4 jmp output l5:

lea dx,str5 jmp output l6:

文案大全

实用标准

lea dx,str6 jmp output l7:

lea dx,str7 jmp output l8:

lea dx,str8 output: mov ah,9 int 21h MOV AH,4CH INT 21H CODES ENDS

END START (2)地址表

;地址表,bl左到右依次是第1-8位 DATAS SEGMENT

str1 db 'the 1 bit is 1',0dh,0ah,'$' str2 db 'the 2 bit is 1',0dh,0ah,'$' str3 db 'the 3 bit is 1',0dh,0ah,'$' str4 db 'the 4 bit is 1',0dh,0ah,'$' str5 db 'the 5 bit is 1',0dh,0ah,'$' str6 db 'the 6 bit is 1',0dh,0ah,'$' str7 db 'the 7 bit is 1',0dh,0ah,'$' str8 db 'the 8 bit is 1',0dh,0ah,'$'

addrtable dw show1,show2,show3,show4,show5,show6,show7,show8 DATAS ENDS

CODES SEGMENT

ASSUME CS:CODES,DS:DATAS START:

MOV AX,DATAS MOV DS,AX mov bl,00001000b mov cx,8

文案大全

实用标准

mov si,0 again: shl bl,1 jc next add si,2 loop again next:

jmp addrtable[si] show1:

lea dx,str1 jmp output show2:

lea dx,str2 jmp output show3:

lea dx,str3 jmp output show4:

lea dx,str4 jmp output show5:

lea dx,str5 jmp output show6:

lea dx,str6 jmp output show7:

lea dx,str7 jmp output show8:

lea dx,str8 jmp output output: mov ah,9

文案大全

实用标准

int 21h MOV AH,4CH INT 21H CODES ENDS

END START

实验内容二:编写一个子程序计算z=f(x,y)=x*y+x-y(x,y,z有符号数内存数) (1)堆栈传递参数

;z=x*y+x-y,x、y、z为有符号数,堆栈传递 DATAS SEGMENT x dw 5 y dw 2 z dw ? DATAS ENDS CODES SEGMENT

ASSUME CS:CODES,DS:DATAS START:

MOV AX,DATAS MOV DS,AX sub sp,2 push y push x call cal pop z mov bx,z MOV AH,4CH INT 21H cal proc push bp mov bp,sp push ax push bx mov ax,[bp+4] mov bx,[bp+6] imul bx add ax,[bp+4] adc dx,0

文案大全

合工大总汇编语言程序设计实验报告材料.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c65f814oenu3fmdy9ul8q7b8vd5385a00y5j_4.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top