汇编语言实验5(王爽)
2022/2/5 1:17:19
本文主要是介绍汇编语言实验5(王爽),对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
(1)
assume cs:code,ds:data,ss:stack data segment dw 0123h,0456h,0789h,0abch,0defh,0fedh,0cbah,0789h data ends stack segment dw 0,0,0,0,0,0,0,0 stack ends code segment start:mov ax,stack mov ss,ax mov sp,16 mov ax,data mov ds,ax push ds:[0] push ds:[2] pop ds:[2] pop ds:[0] mov ax,4c00h int 21h code ends end start
1.不变
2.cs=076C ss=076B ds=076A(每人电脑得到的答案应该不同)
3. code段地址X data段地址X-1 stack段地址X-2
(2)
assume cs:code,ds:data,ss:stack data segment dw 0123h,0456h data ends stack segment dw 0,0 stack ends code segment start:mov ax,stack mov ss,ax mov sp,16 mov ax,data mov ds,ax push ds:[0] push ds:[2] pop ds:[2] pop ds:[0] mov ax,4c00h int 21h code ends end start
不变
cs=076C ss= 076B ds=076A
code段地址x data段地址x-2 stack段地址 x-1
段中N个字节,程序加载后,该段实际空间为(N+15)/16*16
(小于等于16字节按16字节算)
(3)
assume cs:code,ds:data,ss:stack code segment start:mov ax,stack mov ss,ax mov sp,16 mov ax,data mov ds,ax push ds:[0] push ds:[2] pop ds:[2] pop ds:[0] mov ax,4c00h int 21h code ends data segment dw 0123h,0456h data ends stack segment dw 0,0 stack ends end start
1.不变
2.cs=076A ss=076E ds=076D
3.code段地址X data段地址X+3 stack段地址X+4
(4)
第三题。不指明程序入口,程序就从程序第一段开始执行,(1)(2)中开头的数据段中的数据会被翻译成汇编指令执行
(5)
assume cs:code a segment db 1,2,3,4,5,6,7,8 a ends b segment db 1,2,3,4,5,6,7,8 b ends c segment db 0,0,0,0,0,0,0,0 c ends code segment start: mov ax,a mov ds,ax mov ax,b mov es,ax mov ax,c mov ss,ax mov bx,0 mov cx,8 s: mov ax,[bx] add ax,es:[bx] mov ss:[bx],ax inc bx loop s mov ax,4c00h int 21h code ends end start
运行不了,尚未解决
(6)
assume cs:code a segment dw 1,2,3,4,5,6,7,8,9,0ah,0bh,0ch,0dh,0eh,0fh,0ffh a ends b segment dw 0,0,0,0,0,0,0,0 b ends code segment start: mov ax,b mov ss,ax mov sp,16 mov ax,a mov ds,ax mov bx,0 mov cx,8 s: push [bx] add bx,2 loop s mov ax,4c00h int 21h code ends end start
上面的是放在b段中的数据,下面的是a段中的数据,正好相反
这篇关于汇编语言实验5(王爽)的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-11-23Springboot应用的多环境打包入门
- 2024-11-23Springboot应用的生产发布入门教程
- 2024-11-23Python编程入门指南
- 2024-11-23Java创业入门:从零开始的编程之旅
- 2024-11-23Java创业入门:新手必读的Java编程与创业指南
- 2024-11-23Java对接阿里云智能语音服务入门详解
- 2024-11-23Java对接阿里云智能语音服务入门教程
- 2024-11-23JAVA对接阿里云智能语音服务入门教程
- 2024-11-23Java副业入门:初学者的简单教程
- 2024-11-23JAVA副业入门:初学者的实战指南