这俩图是我在做实验九的时候偶然发现的
我把题改了,原题是在中间显示,我自己改成在第一行显示
然后再DATE段直接把要显示的子的ASCLL码和属性全写进去了,多了不说,上代码
花屏的代码:
assume cs:codesg,ds:date
date segment
db 'w',00000010B,'e',00000010B,'l',00000010B,'c',00000010B,'o',00000010B,'m',00000010B,'e',00000010B,'c',00000010B,'o',00000010B,'m',00000010B,'e',00000010B,'m',00000010B,'a',00000010B,'s',00000010B,'m',00000010B
date ends
codesg segment
start: mov ax,date
mov ds,ax
mov bx,0
mov ax,0B800h
mov es,ax
mov cx,15
s: mov ax,[bx]
mov es:[bx],ax
add bx,2
jcxz ok
jmp short s
ok: mov ax,4c00h
mov ah,1
int 21h
codesg ends
end start
这段代码加不加mov ah,1都一样,全是花屏
不花屏代码:
assume cs:codesg,ds:date
date segment
db 'w',00000010B,'e',00000010B,'l',00000010B,'c',00000010B,'o',00000010B,'m',00000010B,'e',00000010B,'c',00000010B,'o',00000010B,'m',00000010B,'e',00000010B,'m',00000010B,'a',00000010B,'s',00000010B,'m',00000010B
date ends
codesg segment
start: mov ax,date
mov ds,ax
mov bx,0
mov ax,0B800h
mov es,ax
mov cx,15
s: mov ax,[bx]
mov es:[bx],ax
add bx,2
loop s
mov ax,4c00h
mov ah,1
int 21h
codesg ends
end start
这段代码中必须要mov ah,1
不加不再屏幕上显示welcome to masm |