王爽汇编实验(九)
任务:在屏幕中间分别显示绿色,绿底红色,白底蓝色的字符串'welcome to masm!' 1 assume cs:codesg,ds:datasg,ss:stack 2 3 datasg segment 4 db 'welcome to masm!' 5 datasg ends 6 7 stack segment 8 db 16 dup (0) 9 stack ends 10 11 codesg segment 12 13 start:mov ax,datasg 14 mov ds,ax 15 mov ax,0B800h 16 mov es,ax 17 mov bx,0 18 mov ax,stack 19 mov ss,ax 20 mov sp,16 21 s: 22 mov cx,16 23 mov si,0 24 s1: 25 mov al,ds:[bx] 26 mov byte ptr es:[380h+si],al 27 mov byte ptr es:[381h+si],2H 28 add si,2 29 inc bx 30 loop s1 31 mov cx,16 32 mov si,0 33 mov bx,0 34 s2: 35 mov al,ds:[bx] 36 mov byte ptr es:[420h+si],al 37 mov byte ptr es: