1. 程式人生 > >程式設計:在螢幕中間分別顯示綠色、綠底紅色、白底藍色的字串'welcome to masm!'

程式設計:在螢幕中間分別顯示綠色、綠底紅色、白底藍色的字串'welcome to masm!'

assume cs:codesg , ds:datasg , ss:stacksg
datasg segment
        db 'welcome to masm!'
        db 2h , 24h , 71h 
datasg ends

stacksg segment stack
        dw 0h,0h,0h,0h,0h,0h,0h,0h          
stacksg ends

codesg segment
start:  mov ax , datasg
        mov ds , ax

        mov ax , stacksg
        mov ss , ax
        
mov sp , 16 mov ax , 0B872h mov cx , 3 mov bx , 0 s: mov es , ax push ax push cx mov si , 0 mov
di , 0 mov cx , 16 s0: mov al , [si] mov es:[di] , al inc si add di , 2 loop s0 mov al , [bx+si] mov cx , 16 mov di , 1 s1: mov es:[di] , al
add di , 2 loop s1 pop cx pop ax add ax , 000ah inc bx loop s mov ax,4c00h int 21h codesg ends end start

參考連結: https://www.cnblogs.com/meihao1203/p/7292116.html