汇编语言(王爽)--实验9根据材料编程

时间:2022-03-17 01:18:36

汇编语言(王爽)--实验9根据材料编程

assume cs:code,ds:data,ss:stack

data segment
    db 'welcome to masm!',00000010b,00100111b,01110001b
data ends

stack segment
    db 16 dup(0) 
stack ends

code segment
start:
    mov ax,data
    mov ds,ax
    
    mov ax,0b800h 
    mov es,ax
    mov si,0
    mov di,12*160+36*2
    
    mov cx,15
 s1:mov al,ds:[si]
    mov es:[di],al
    mov al,ds:[16]
    mov es:[di+1],al
    inc si
    add di,2
    
    loop s1
    
    mov si,0
    mov di,13*160+36*2
    mov cx,15
 s2:mov al,ds:[si]
    mov es:[di],al
    mov al,ds:[17]
    mov es:[di+1],al
    inc si
    add di,2
    
    loop s2
     
    mov si,0
    mov di,14*160+36*2
    mov cx,15
 s3:mov al,ds:[si]
    mov es:[di],al
    mov al,ds:[18]
    mov es:[di+1],al
    inc si
    add di,2
    
    loop s3

    mov ax,4c00h
    int 21h    
code ends

end start