📄 page.asm
字号:
include macro.lib
extrn writepoint:far
extrn printf:far,printf1:far,printf2:far,box:far,clearscreen_rw:far,putchar:far
extrn fill:far,putimmage:far,getimmage:far,vertical:far,horizontal:far,rectangle:far
extrn showbmp:far,draw_jiao: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 busy:byte,openkeyboard:byte,color:word,movflag_key:byte,old_pos_x:word,new_pos_x:word
extrn new_pos_y:word,old_pos_y:word,closeintr:byte
extrn store_b:far,restore_b:far,restore_m:far,store_m:far
extrn mousex:word,mousey:word
public onepage ,showonepage
data segment para public 'data'
onepageflag db 0
STOP db 0
data ends
code segment public 'code'
assume ds:data,cs:code
.386
;=========================================================
;关于滚动条的函数
onepage proc far
rect 740,104,760,476,<RGB 125,0,32>
RGB 125,0,32
mov si, P_COPY
MOV CX, 20
MOV AX, 100
MOV BX, 740
CALL horizontal
mov ax, 80
mov bx, 750
mov cx, 10
.WHILE CX > 0
CALL writepoint
inc ax
dec bx
call writepoint
inc ax
call writepoint
dec cx
.ENDW
mov ax, 80
mov bx, 750
mov cx, 10
.WHILE CX > 0
CALL writepoint
inc ax
inc bx
call writepoint
inc ax
call writepoint
dec cx
.ENDW
mov ax, 480
mov bx, 740
mov cx, 20
call horizontal
mov ax, 500
mov bx, 750
mov cx, 10
.WHILE CX > 0
CALL writepoint
dec ax
dec bx
call writepoint
dec ax
call writepoint
dec cx
.ENDW
mov ax, 500
mov bx, 750
mov cx, 10
.WHILE CX > 0
CALL writepoint
dec ax
inc bx
call writepoint
dec ax
call writepoint
dec cx
.ENDW
ret
onepage endp
;入口参数: bp,color
smalljiao proc far
mov si, P_COPY
ishere 740,80, 760,100
jnc next
MOV CX, 20
MOV AX, 100
MOV BX, 740
CALL horizontal
mov ax, 80
mov bx, 750
mov cx, 10
.WHILE CX > 0
CALL writepoint
inc ax
dec bx
call writepoint
inc ax
call writepoint
dec cx
.ENDW
mov ax, 80
mov bx, 750
mov cx, 10
.WHILE CX > 0
CALL writepoint
inc ax
inc bx
call writepoint
inc ax
call writepoint
dec cx
.ENDW
jmp exit
next:
mov ax, 480
mov bx, 740
mov cx, 20
call horizontal
mov ax, 500
mov bx, 750
mov cx, 10
.WHILE CX > 0
CALL writepoint
dec ax
dec bx
call writepoint
dec ax
call writepoint
dec cx
.ENDW
mov ax, 500
mov bx, 750
mov cx, 10
.WHILE CX > 0
CALL writepoint
dec ax
inc bx
call writepoint
dec ax
call writepoint
dec cx
.ENDW
exit:
ret
smalljiao endp
;入口参数: bp,color
bigjiao proc far
mov si, P_COPY
ishere 740,80, 760,100
jnc next
MOV CX, 24
MOV AX, 100
MOV BX, 738
CALL horizontal
mov ax, 76
mov bx, 750
mov cx, 12
.WHILE CX > 0
CALL writepoint
inc ax
dec bx
call writepoint
inc ax
call writepoint
dec cx
.ENDW
mov ax, 76
mov bx, 750
mov cx, 12
.WHILE CX > 0
CALL writepoint
inc ax
inc bx
call writepoint
inc ax
call writepoint
dec cx
.ENDW
jmp exit
next:
mov ax, 480
mov bx, 738
mov cx, 24
call horizontal
mov ax, 504
mov bx, 750
mov cx, 12
.WHILE CX > 0
CALL writepoint
dec ax
dec bx
call writepoint
dec ax
call writepoint
dec cx
.ENDW
mov ax, 504
mov bx, 750
mov cx, 12
.WHILE CX > 0
CALL writepoint
dec ax
inc bx
call writepoint
dec ax
call writepoint
dec cx
.ENDW
exit:
ret
bigjiao endp
;================================================================
on proc far
RGB 255,0,0
call smalljiao
ret
on endp
;================================================================
down proc far
mov bp,0h
call smalljiao
RGB 255,0,0
call bigjiao
delay 20
mov bp,0h
call bigjiao
RGB 255,0,0
call smalljiao
ret
down endp
showonepage proc far
push ds
mov ax, data
mov ds, ax
setxy 300,100,500,400
call clearscreen_in
call onepage
mov STOP , 15
.REPEAT
check_onepage <dec STOP>
.UNTIL STOP == 1
mov STOP , 0
pop ds
ret
showonepage endp
;===============================================================
code ends
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -