云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > 合工大汇编语言程序设计实验报告

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

  • 62 次阅读
  • 3 次下载
  • 2025/5/31 23:48:09

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

搜索更多关于: 合工大汇编语言程序设计实验报告 的文档
  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

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 outp

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com