首页 > ASM, 原创 > 王爽汇编语言(第2版)检测点6.1

王爽汇编语言(第2版)检测点6.1

2009年10月11日 小 恒 发表评论 阅读评论

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

  1.  assume cs:codesg
  2.  
  3.  codesg segment
  4.  
  5.  dw 0123h,0456h,0789h,0abch,0defh,0fedh,0cbah,0987h
  6.  
  7.  start: mov ax,0
  8.  mov ds,ax
  9.  mov bx,0
  10.  
  11.  mov cx,8
  12.  s: mov ax,[bx]
  13.  mov cs:[bx],ax
  14.  add bx,2
  15.  loop s
  16.  
  17.  mov ax,4c00h
  18.  int 21h
  19.  codesg ends
  20.  
  21.  end start

(2) 下面的程序实现依次用内存0:0~0:15单元中的内容改写程序中的数据,数据的传送用栈来进行,栈空间设置在程序内。完成程序:

  1.  assume cs:codesg
  2.  
  3.  codesg segment
  4.  
  5.  dw 0123h,0456h,0789h,0abch,0defh,0fedh,0cbah,0987h
  6.  dw 0,0,0,0,0,0,0,0,0,0
  7.  
  8.  start: mov ax,cs
  9.  mov ss,ax
  10.  mov sp,24h
  11.  
  12.  mov ax,0
  13.  mov ds,ax
  14.  mov bx,0
  15.  mov cx,8
  16.  s: push [bx]
  17.  pop cs:[bx]
  18.  add bx,2
  19.  loop s
  20.  
  21.  mov ax,4c00h
  22.  int 21h
  23.  codesg ends
  24.  
  25.  end start
分类: ASM, 原创 标签:
  1. 本文目前尚无任何评论.