汇编语言检测点6.1

汇编语言检测点6.1


建议先自己思考问题的答案,不懂则返回看书

1.下面的程序实现依次用内存0:0~0:15单元中的内容改写程序中的数据:

assume cs:code
code segment
  dw 0123h,0456h,0789h,0abch,0defh,0fedh,0cbah,0987h
start:
	mov ax,0
	mov ds,ax
	mov bx,0
	mov cx,8
s:
	mov ax,[bx]
	mov cs:[bx],ax	
	add bx,2
	loop s

mov ax,4c00h
int 21h
code ends
end start

运行结果截图:
在这里插入图片描述
2.下面的程序实现依次用内存0:0~0:15单元中的内容改写程序中的数据,数据的传送用栈来进行。栈空间设置在程序内。

assume cs:codesg
codesg segment
    dw 0123h,0456h,0789h,0abch,0defh,0fedh,0cbah,0987h  
    dw 0,0,0,0,0,0,0,0,0,0   ;10个字单元用作栈空间
start: mov ax,cs        
       mov ss,ax        
       mov sp,36h        
       
       mov ax,0
       mov ds,ax        
       mov bx,0         
       mov cx,8          
       
    s: push [bx]        
       pop cs:[bx]      
       add bx,2          
       loop s
       
       mov ax,4c00h
       int 21h

codesg ends
end start    
  • 2
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 6
    评论
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值