汇编语言作业

来源:互联网 发布:三年经验程序员薪资 编辑:程序博客网 时间:2024/06/05 04:55

程序2:补全程序,计算

 

assume cs:code,ds:data

data  segment

   x db  45h

   y db  ?

data  ends

 

code  segment

start:mov ax,data

      mov ds,ax

      mov al,x

      ……

      ……

over: mov y,bl

      mov ah,4ch

      int 21h

code  ends

      end  start

程序3:编一个子程序,在16个字节型数据中找出最小值,存放于y

assume cs:code,ds:data

data  segment

   x db 5, 6, 7, 8, 16, 4, 7, 12, 1, 9, 45, 23, 13, 20, 15, 11

   y db  ?

data  ends

 

code  segment

     ……

code  ends

      end  start

程序4:用串传送指令改造下面的程序

 

;程序功能:将beg_copyend_copy的代码复制到0:200H

assume cs:codeseg

codeseg segment

start:

    mov ax, cs

    mov ds, ax

    mov si, offset beg_copy

 

    mov ax, 0

    mov es, ax

    mov di, 200H

 

    mov bx, offset end_copy

 

copy: cmp si, bx

      jnb stop_copy

      mov al, [si]

      mov es:[di], al

      inc si

      inc di

      jmp copy

stop_copy:

    mov ax, 4c00h

    int 21h

 

beg_copy:

    mov ax, 0

    add ax, ax

    wait

end_copy: nop

 

codeseg ends

end start




0 0
原创粉丝点击