码迷,mamicode.com
首页 > 其他好文 > 详细

汇编实验5

时间:2017-06-01 12:08:27      阅读:250      评论:0      收藏:0      [点我收藏+]

标签:技术分享   end   回答问题   int   汇编   start   跟踪   image   loop   

 

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

 

汇编实验5

标签:技术分享   end   回答问题   int   汇编   start   跟踪   image   loop   

原文地址:http://www.cnblogs.com/Since-natural-ran/p/6927963.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!