xjw666

王爽 汇编语言 实验9

assume cs:code
data segment
        db 'welcome to masm!'
        db 02h,24h,71h
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 ax,stack
        mov ss,ax
        mov sp,10h
        # 设置要写入的栈区域
        mov bx,780h
        mov si,10h
        
        mov cx,3
s:      mov ah,ds:[si]
        push cx
        push si
        #外循环
        mov cx,16
        mov si,64
        mov di,0
s0:     mov al,ds:[di]
        mov es:[bx+si],al
        mov es:[bx+si+1],ah

        add si,2
        add di,1

        loop s0

        pop si
        pop cx

        add si,1h
        add bx,0a0h

        loop s
        mov ax,4c00h
        int 21h
code ends
end start

  

posted on 2021-10-23 16:56  xjw666  阅读(25)  评论(0编辑  收藏  举报

导航