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

当前位置:首页 > 合肥工业大学汇编程序设计实验报告完整代码

合肥工业大学汇编程序设计实验报告完整代码

  • 62 次阅读
  • 3 次下载
  • 2025/5/25 21:13:14

实验三 汇编语言子程序设计(分支、子程序)

一. 实验目的

1、掌握分支和子程序结构和设计方法;

2、熟悉在PC机上建立、汇编、连接、调试和运行8086/8088汇编语言程序的过程。 3、通过汇编语言了解高级语言的参数传递等知识。

二. 实验内容

1、BL中的只有一位为1。编写程序测试,并输出提示信息“The X Bit is 1”,要求:地址表和转移表。

2. 编写一个子程序计算z=f(x,y)=x*y+x-y(x,y,z有符号数内存数)。要求通过堆栈(寄存器、内存)传送所有参数。 3. 实践C?Asm的转换过程。

三. 实验过程和程序

1、BL中的只有一位为1。编写程序测试,并输出提示信息“The X Bit is 1”,要求:地址表和转移表。 ;bl have one 1 cout<

addres dw fun8,fun7,fun6,fun5,fun4,fun3,fun2,fun1 string8 db 'The 8 Bit is 1$' string7 db 'The 7 Bit is 1$' string6 db 'The 6 Bit is 1$' string5 db 'The 5 Bit is 1$' string4 db 'The 4 Bit is 1$' string3 db 'The 3 Bit is 1$' string2 db 'The 2 Bit is 1$' string1 db 'The 1 Bit is 1$' data ends

assume ds:data,cs:code code segment start:

mov ax,data

mov ds,ax

mov bl,10h mov ax,0000h mov cx,8

math: shl bl,1 jc right

jmp next right:mov dl,02h mul dl

mov bp,ax jmp addres[bp] next: inc ax loop math

fun8:mov dx,offset string8

cout:mov ah,09h

int 21h mov ah,4ch int 21h

jmp cout jmp cout jmp cout jmp cout jmp cout jmp cout jmp cout jmp cout

fun7:mov dx,offset string7 fun6:mov dx,offset string6 fun5:mov dx,offset string5 fun4:mov dx,offset string4 fun3:mov dx,offset string3 fun2:mov dx,offset string2 fun1:mov dx,offset string1

code ends end start

2. 编写一个子程序计算z=f(x,y)=x*y+x-y(x,y,z有符号数内存数)。要求通过堆栈(寄存器、内存)传送所有参数。

使用堆栈: data segment x db 03h y db 0ffh z dw 0000h data ends stack segment dw 100 dup(?)

stack ends

assume ds:data,cs:code,ss:stack code segment start: mov ax,data mov ds,ax

mov ax,stack mov ss,ax mov al,x push ax mov al,y push ax call program mov z,dx add sp,2 jmp quit

program: push bp mov bp,sp

mov ax,[bp+6] mov dx,[bp+4] imul dl mov dx,ax mov ax,[bp+6]

cbw add dx,ax mov ax,[bp+4] cbw sub dx,ax pop bp ret

mov ah,4ch

quit:

int 21h

code ends end start

二、使用寄存器传值

data segment x db 03h y db 0ffh z dw 0000h data ends stack segment dw 100 dup(?)

stack ends

assume ds:data,cs:code,ss:stack code segment start: mov ax,data mov ds,ax

mov ax,stack mov ss,ax mov al,x mov bl,y call program mov z,dx jmp quit

program:

  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

实验三 汇编语言子程序设计(分支、子程序) 一. 实验目的 1、掌握分支和子程序结构和设计方法; 2、熟悉在PC机上建立、汇编、连接、调试和运行8086/8088汇编语言程序的过程。 3、通过汇编语言了解高级语言的参数传递等知识。 二. 实验内容 1、BL中的只有一位为1。编写程序测试,并输出提示信息“The X Bit is 1”,要求:地址表和转移表。 2. 编写一个子程序计算z=f(x,y)=x*y+x-y(x,y,z有符号数内存数)。要求通过堆栈(寄存器、内存)传送所有参数。 3. 实践C?Asm的转换过程。 三. 实验过程和程序 1、BL中的只有一位为1。编写程序测试,并输出提示信息“The X Bit is 1”,要求:地址表

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价: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