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

王爽汇编 实验13

时间:2017-06-02 14:56:18      阅读:171      评论:0      收藏:0      [点我收藏+]

标签:start   汇编 实验   masm   word   logs   cap   com   汇编   log   

1.

assume cs:code

data segment
 db welcome to masm! ,0
data ends

code segment
start:
    mov ax,cs
    mov ds,ax
    mov si,offset capital
    mov ax,0
    mov es,ax
    mov di,200h
    mov cx,offset capitalend-offset capital
    cld
    rep movsb

    mov ax,0
    mov es,ax
    mov word ptr es:[7ch*4],200h
    mov word ptr es:[7ch*4+2],0

    mov dh,10
    mov dl,    10
    mov cl,2
    mov ax,data
    mov ds,ax
    mov si,0
    int 7ch

    
    mov ax,4c00h
    int 21h

capital:
    push ax
    push es
    push di
    push si

    mov ax,0b800h
    mov es,ax

    mov al,0a0h
    mul dh
    mov di,ax

    mov al,2
    mul dl
    add di,ax

    mov ah,cl
s:
    mov al,[si]
    cmp al,0
    je ok

    mov word ptr es:[di],ax
    add di,2
    inc si
    jmp short s
ok:
    pop si
    pop di
    pop es
    pop ax
    iret

capitalend:
    nop

code ends
end start

 

王爽汇编 实验13

标签:start   汇编 实验   masm   word   logs   cap   com   汇编   log   

原文地址:http://www.cnblogs.com/hellow0rd/p/6933076.html

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