·汇编源码--BRK
·汇编源码--CLOCK
·汇编源码--BURNOUT
·汇编源码--DOSSYM
·汇编源码--circle
·汇编源码--DEV
·汇编源码--getspace
·汇编源码--CLEAR
·汇编源码--col
·汇编源码--gameport
PAGE 60,132
; CLR.ASM 05/29/84
; Subroutine called by a basic program to scroll a window.
;
;
DGROUPGROUPDATASEG
DATASEG SEGMENT PARA PUBLIC 'DATA'
FUNCTDW0;function 1=6,0=7
FG_COLR DW0;forground color
BG_COLR DW0;backround color
LINESDW0;number of lines to scroll or 0 for clear
ULROWDW0;upper left row
ULCOLDW0;upper left column
LRROWDW0;lower right row
LRCOLDW0;lower left column
ATTRIBDB0;temp hold for attribute byte
CALNUDB0;temp hold for call function 6 or 7
DATASEG ENDS
;
CSEGSEGMENT 'CODE'
ASSUMECS:CSEG
PUBLIC CLR
CLRPROCFAR
PUSHBP;BP unknown (don't care)
MOVBP,SP;set base for parm list
PUSHDS;DS -> basic work area
PUSHES;ES -> basic work area
MOVAX,DATASEG;establish data addressability
MOVDS,AX;now DS -> my data
ASSUMEDS:DATASEG
;
;
MOVSI,SS:[BP+6] ;get addr of parameter
MOVAX,ES:[SI];get value of parm
MOVFUNCT,AX
MOVSI,SS:[BP+8] ;get addr of parameter
MOVAX,ES:[SI];get value of parm
MOVBG_COLR,AX
MOVSI,SS:[BP+10];get addr of parameter
MOVAX,ES:[SI];get value of parm
MOVFG_COLR,AX
MOVSI,SS:[BP+12];get addr of parameter
MOVAX,ES:[SI];get value of parm
MOVLINES,AX
MOVSI,SS:[BP+14];get addr of parameter
MOVAX,ES:[SI];get value of parm
MOVULROW,AX
MOVSI,SS:[BP+16];get addr of parameter
MOVAX,ES:[SI];get value of parm
MOVULCOL,AX
MOVSI,SS:[BP+18] ;get addr of parameter
MOVAX,ES:[SI];get value of parm
MOVLRROW,AX
MOVSI,SS:[BP+20] ;get addr of parameter
MOVAX,ES:[SI];get value of parm
MOVLRCOL,AX
;
MOVAX,1
SUBLRROW,AX;convert 1-80 cols
SUBLRCOL,AX; and 1-25 rows into
SUBULROW,AX; 0-79 cols and
SUBULCOL,AX; 0-24 rows
;
; change forground & backround colors into single attribute byte
;
MOVBX,FG_COLR;move foreground color to bx
MOVAL,BL;move lower byte to al
MOVBX,BG_COLR;move backround color to bx
MOVAH,BL;move lower byte to ah
CMPAL,15;check for color > 15 ieblinking
JGBLNK;if > 15 then set blink bit
ANDAL,15;set normal fg color
JMPN_BLNK;
BLNK:ORAL,128;set blink bit 7
ANDAL,143;zero out bit 6,5,4 used for backround
N_BLNK: ANDAH,7;zero out bit 7,6,5,4,3 used for forground
MOVCL,4;4 bit shift count
SHLAH,CL;shift right 3 bits to pos 6,5,4
ORAL,AH;combine for & back to form attribute byte
MOVATTRIB,AL;move it to STORAGE
;
; convert 1 and 0 to 6 and 7 for routine call
;
MOVBX,FUNCT;move function into bx
CMPBL,0;compare to one
JGF6;if 1 then function is 6
MOVAH,7H;set function 7
JMPOUT1;jump around
F6:MOVAH,6H;set function 6
OUT1:MOVCALNU,AH;move it to storage
;
;
; set up for bios rom call 10 function 6 (scroll up )
;
PUSHBX
MOVBX,LINES;set # of lines to scroll or 0 to clear
MOVAL,BL;put in pass register
MOVBX,ULROW;set upper left row of block 0-24
MOVCH,BL;put in pass register
MOVBX,ULCOL;set upper left column of block 0-79
MOVCL,BL;put in pass register
MOVBX,LRROW;set lower right row of block 0-24
MOVDH,BL;put in pass register
MOVBX,LRCOL;set lower right column of block 0-79
MOVDL,BL;put in pass register
MOVBL,CALNU;set call number 6 to scroll up 7 down
MOVAH,BL;put in pass register
MOVBL,ATTRIB;set color attribute byte
MOVBH,BL;put in pass register
INT10H; make bios call
POPBX
;
FINISH: POPES
POPDS
POPBP
RET16;return to basic
CLRENDP
CSEGENDS
END
进入讨论组讨论。