The CLEARS.I include file resides on the Kyan Pascal 2.x Utilities Disk 1. It contains the following four procedures:
- PROCEDURE Clear_to_EOLn
- PROCEDURE Clear_Screen;
- PROCEDURE Clear_to_EOP;
- PROCEDURE Clear_Ln_at(Y: Integer);
Source Code
PROCEDURE Clear_to_EOLn;
VAR
CURRENT,Cursor_Pos:Integer;
BEGIN
#A
LDY #5 ;offset to Cursor_Position
LDA $55 ;get COLCRS (85)
STA (_SP),Y;...store it
INY ;offset to MSB
LDA #$00 ;zero out
STA (_SP),Y;the MSB
#
FOR CURRENT:=Cursor_Pos TO 39 DO
WRITE(CHR(254));
END;(* Clear_to_End *)
PROCEDURE Clear_Screen;
BEGIN
WRITE(CHR(125));
END;(* Clear_Screen *)
PROCEDURE Clear_to_EOP;
VAR
Cl_Line,Cl_P :INTEGER;
RowCrs,ColCrs:Integer;
BEGIN
#A
LDY #7 ;offset to RowCrs
LDA $54 ;...get ROWCRS (84)
STA (_SP),Y ;...store in RowCrs
LDY #5 ;offset to ColCrs
LDA $55 ;...get COLCRS (85) LSB
STA (_SP),Y ;...store in ColCrs
#
FOR Cl_Line:= ColCrs TO 39 DO
WRITE(CHR(254));
WRITELN;
FOR Cl_P:=23 DOWNTO RowCrs+1 DO
WRITE(CHR(156));
END;(* Clear_to_EoP *)
PROCEDURE Clear_Ln_at(Y: Integer);
BEGIN
#A
LDA $54 ;get value in ROWCRS (84)
STA _T ;...store LSB for later
LDY #5 ;offset to Y
LDA (_SP),Y ;...get Y value
STA $54 ;...store in ROWCRS
#
WRITE(CHR(156));
#A
LDA _T ;get old row number
STA $54 ;restore cursor position
#
END;(* Clear_Ln_at *)
No comments:
Post a Comment