首页 > 代码库 > 王爽汇编 实验13

王爽汇编 实验13

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