汇编实验5

 

1. 将下面的程序编译、连接、加载、跟踪,然后回答问题。

assume cs:code,ds:data,ss:stack
data segment
    dw 0123h,0456h,0789h,0abch,0defh,0fedh,0cbah,0987h
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

 

  

  

  

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

 

  

  

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

 

  

  

  

5.

  

code segment
start:
    mov ax,a
    mov ds,ax
    mov bx,0
    mov cx,8
      s:mov al,ds:[bx]
    add al,ds:[bx+16]
    mov ds:[bx+32],al
    inc bx
    loop s

    mov ax,4c00h
    int 21h
code ends

6. 

  

code segment
start:
    mov ax,a
    mov ds,ax
    mov bx,0
    mov ax,b
    mov ss,ax
    mov sp,16
    mov cx,8
      s:push [bx]
    inc bx
    inc bx
    loop s
    mov ax,4c00h
    int 21h
code ends

 

转载于:https://www.cnblogs.com/Since-natural-ran/p/6927963.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值