$CPU 8086 ' make compatible with XT systems $LIB ALL OFF ' turn off all PowerBASIC libraries $ERROR ALL OFF ' turn off all PowerBASIC error checking $OPTIMIZE SIZE ' optimize for smaller code $COMPILE UNIT ' compile to a UNIT (.PBU) '$COMPILE EXE ' compile to a UNIT (.PBU) DEFINT A-Z ' Required for all numeric functions, forces PB to not ' include floating point in UNIT (makes it smaller) '/*------------------------------------------------------------------*/ $CODE SEG "MLIB4" '/*------------------------------------------------------------------*/ ' CLRWINDOW ROW,COL,BROW,RCOL,ATTR ' Clear Window. ' Clears a window using ATTR color as defined by ROW, COL, BROW, RCOL. ' EXAMPLE: CLRWINDOW 1,1,25,80,31 ' CLRWINDOW 10,20,15,40,49 '/*------------------------------------------------------------------*/ SUB CLRWINDOW(TROW?, LCOL?, BROW?, RCOL?, ATTR?) PUBLIC TROW? = TROW? - 1 LCOL? = LCOL? - 1 BROW? = BROW? - 1 RCOL? = RCOL? - 1 REG 1, &H0600 ' set AH to 6 (BIOS function number) and AL to 0 ' (number of rows to scroll; when set to 0, the area ' is cleared rather than scrolled) REG 2, ATTR? * 256 ' set BH to the video attribute for the area REG 3, (TROW? * 256) + LCOL? ' set CH to the upper left row of the ' area and CL to the upper left column of the area REG 4, (BROW? * 256) + RCOL? ' set DH to the lower right row of the ' area and DL to the lower right column of the area CALL INTERRUPT &H10 ' call the video BIOS services interrupt END SUB '/*------------------------------------------------------------------*/ ' $INCLUDE "C:\CODE\MLIB\MLIB.INC" ' CLRWINDOW 1,1,25,80,31 ' Y$ = GETKEY ' CLRWINDOW 10,10,20,20,96 ' Y$ = GETKEY