回复 15楼 ansic
你不会就不要笑别人,人家是对的,楼主看不到是他双击了程序,只闪了一下就没了,加个等待就行了
assume cs:code,ds:data,ss:stack
data segment
db'welcome to masm!'
db 00000010b,00100100b,01110001b
data ends
stack segment
dw 0,0,0,0,0,0,0,0
stack ends
code segment
start: mov ax,data
mov ds,ax
mov ax,stack
mov ss,ax
mov sp,0010h
mov bx,0000h
mov ax,0b800h
mov es,ax
mov ax,0
mov di,0010h
mov cx,3
;char attribute
s:
push cx
mov cx,16
;string length
mov si,0
;string pointer to 0(the first char)
s0:
mov al,ds:[si]
;char
mov ah,ds:[di]
;color
mov es:[bx+07b6h],ax
;move char to video buffer
inc si
;next char
add bx,2
;video buffer increase
loop s0
inc di
;next color
pop cx
loop s
mov ah,0
;key wait
int 16h
mov ax,4c00h
int 21h
code ends
end start