📄 start.asm
字号:
include macro.lib
extrn showbmp:far,printf2:far,random:far,printf:far
extrn clearscreen_du:far,clearscreen_ud:far,clearscreen_rl:far,clearscreen_lr:far
extrn clearscreen_in:far,clearscreen_out:far
extrn clearscreen_rw:far,clearscreen_dw:far
extrn clearscreen_rdw:far,clearscreen_mlr:far,clearscreen_mud:far
extrn mousex:word,mousey:word
PUBLIC mov_heading,random_yu,random_clear,tonghua
data segment para public 'data'
num_x1 dw 499
num_y1 dw 70
heading_bmp db 'picture\head1.bmp',0
biao_yu1 db '一分耕耘,一分收获。',0,0
biao_yu2 db '生命是如此之轻,别待以后想珍惜的时候,已经来不及……',0,0
biao_yu3 db '昨天是一个故事,明天是一个谜语,只有今天才是最可贵的!',0,0
biao_yu4 db '不经历风雨,怎能见着绚丽的彩虹不刻苦钻研;怎能获得理想的成功!',0,0
biao_yu5_1 db '读书使人充实,讨论使人机智,笔记使人准确,',0,0
biao_yu5_2 db '读史使人灵秀,数学使人周密,科学使人深刻,',0,0
biao_yu5_3 db '伦理使人庄重,逻辑修词使人善辩......',0,0
biao_yu6_1 db '风声雨声读书声,声声入耳;',0,0
biao_yu6_2 db '家事国事天下事,事事关心.',0,0
biao_yu7 db '愿每次回忆,对生活都不感到负疚。',0,0
biao_yu8 db '东天已经到来,春天还会远吗?',0,0
biao_yu9 db '如烟往事俱忘却,心底无私天地宽。',0,0
biao_yu10 db '题诗寄汝非无意,莫负青春取自惭。',0,0
authorname db '程斌',0,0
pic1 db 'picture\01.bmp',0
pic2 db 'picture\02.bmp',0
pic3 db 'picture\03.bmp',0
pic4 db 'picture\04.bmp',0
pic5 db 'picture\05.bmp',0
pic6 db 'picture\06.bmp',0
pic7 db 'picture\07.bmp',0
pic8 db 'picture\08.bmp',0
pic9 db 'picture\09.bmp',0
pic10 db 'picture\10.bmp',0
book1 db 'picture\book1.bmp',0
book2 db 'picture\book2.bmp',0
book3 db 'picture\book3.bmp',0
book4 db 'picture\book4.bmp',0
num db 6
flag db 1
data ends
code segment public 'code'
assume cs:code, ds:data
.386
;============================================================
mov_heading proc far
pusha
push es
push ds
mov cx, data
mov ds, cx
again:
openpicture num_x1,num_y1,heading_bmp,P_COPY
dec num_x1
jz exit
dec num_x1
jz exit
jmp again
exit:
pop ds
pop es
popa
ret
mov_heading endp
;============================================================
;随即出字
;出口参数:无,入口参数:无
random_yu proc far
pusha
push ds
mov ax, data
mov ds, ax
mov cl, 11
call random
cmp bx,0
jne yu_next1
slow_zi 240,200,biao_yu1,<RGB 255,0,0>
jmp last
yu_next1: cmp bx,1
jne yu_next2
slow_zi 240,200,biao_yu2,<RGB 0,255,0>
jmp last
yu_next2: cmp bx,2
jne yu_next3
slow_zi 240,200,biao_yu3,<RGB 0,0,255>
jmp last
yu_next3: cmp bx,3
jne yu_next4
slow_zi 240,200,biao_yu4,<RGB 188,63,63>
jmp last
yu_next4: cmp bx,4
jne yu_next5
slow_zi 240,180,biao_yu5_1,<RGB 0,255,0>
slow_zi 240,200,biao_yu5_2,<RGB 0,255,0>
slow_zi 240,220,biao_yu5_3,<RGB 0,255,0>
jmp last
yu_next5: cmp bx,5
jne yu_next6
slow_zi 240,200,biao_yu6_1,<RGB 200,150,40>
slow_zi 240,240,biao_yu6_2,<RGB 200,150,40>
jmp last
yu_next6: cmp bx,6
jne yu_next7
slow_zi 240,200,biao_yu7,<RGB 100,160,80>
jmp last
yu_next7: cmp bx,7
jne yu_next8
slow_zi 240,200,biao_yu8,<RGB 120,200,255>
jmp last
yu_next8: cmp bx,8
jne yu_next9
slow_zi 240,200,biao_yu9,<RGB 55,160,200>
jmp last
yu_next9:
slow_zi 240,200,biao_yu10,<RGB 255,0,0>
last: pop ds
popa
ret
random_yu endp
;============================================================
;随机清屏
random_clear proc far
pusha
push ds
push es
mov ax, data
mov ds, ax
dec num
jnz exit
mov num,6
mov cl, 11
call random
cmp bx, 0
jne next1
setxy 50,200,200,400
call clearscreen_ud
openpicture 51,400,pic1,P_COPY
delay 20
jmp pic_last
next1:
cmp bx, 1
jne next2
setxy 50,200,200,400
call clearscreen_du
openpicture 51,400,pic2,P_COPY
delay 20
jmp pic_last
next2:
cmp bx, 2
jne next3
setxy 50,200,200,400
call clearscreen_lr
openpicture 51,400,pic3,P_COPY
delay 20
jmp pic_last
next3:
cmp bx, 3
jne next4
setxy 50,200,200,400
call clearscreen_rl
openpicture 51,400,pic4,P_COPY
delay 20
jmp pic_last
next4:
cmp bx, 4
jne next5
setxy 50,200,200,400
call clearscreen_in
openpicture 51,400,pic5,P_COPY
delay 20
jmp pic_last
next5:
cmp bx, 5
jne next6
setxy 50,200,200,400
call clearscreen_out
openpicture 51,400,pic6,P_COPY
delay 20
jmp pic_last
next6:
cmp bx, 6
jne next7
setxy 50,200,200,400
call clearscreen_rw
openpicture 51,400,pic7,P_COPY
delay 20
jmp pic_last
next7:
cmp bx, 7
jne next8
setxy 50,200,200,400
call clearscreen_dw
openpicture 51,400,pic8,P_COPY
delay 20
jmp pic_last
next8:
cmp bx, 8
jne next9
setxy 50,200,200,400
call clearscreen_rdw
openpicture 51,400,pic9,P_COPY
delay 20
jmp pic_last
next9:
setxy 50,200,200,400
call clearscreen_mud
openpicture 51,400,pic10,P_COPY
delay 20
pic_last:
cmp flag,1
jne next10
out_hz 700,520,authorname,<RGB 255,0,0>
mov flag,0
jmp exit
next10: out_hz 700,520,authorname,<RGB 0,0,0>
mov flag,1
exit:
pop es
pop ds
popa
iret
random_clear endp
;============================================================
tonghua proc far
pusha
push ds
push es
begin:
openpicture 24,57,book2,P_COPY
ishere 22,16,70,56
jnc exit_tonghua
delay 20
openpicture 24,57,book3,P_COPY
ishere 22,16,70,56
jnc exit_tonghua
delay 20
openpicture 24,57,book4,P_COPY
ishere 22,16,70,56
jnc exit_tonghua
delay 20
openpicture 24,57,book1,P_COPY
ishere 22,16,70,56
jnc exit_tonghua
delay 20
jmp begin
exit_tonghua:
pop es
pop ds
popa
ret
tonghua endp
;============================================================
code ends
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -