GOTOS.I

[Table of Contents]

The GOTOS.I include file resides on the Kyan Pascal 2.x Utilities Disk 1.


  • PROCEDURE GotoXY(Horiz,Vert: Integer);
  • PROCEDURE Goto_Screen_Top;
  • PROCEDURE Goto_Screen_Bottom;


Source Code


PROCEDURE GotoXY(Horiz,Vert: Integer);
    BEGIN
#A
  LDY #5      ;offset to Y
  LDA (_SP),Y ;get value from stack
  STA $54     ;...store in ROWCRS (84)
  LDY #7      ;offset to X
  LDA (_SP),Y ;get val from stack
  STA $55     ;...LSB into COLCRS (85)
  INY         ;offset to horiz MSB
  LDA (_SP),Y ;...get from stack
  STA $56     ;...store MSB
#
END;(* GotoXY procedure *)

PROCEDURE Goto_Screen_Top;
    BEGIN
#A
  LDA #00  ;top
  STA $54  ;ROWCRS
  LDA #00  ;far left
  STA $55  ;COLCRS
  sta $56
#
END;(* goto TOP procedure *)

PROCEDURE Goto_Screen_Bottom;
    BEGIN
#A
  LDA #23  ;bottom
  STA $54  ;ROWCRS
  LDA #39  ;far right
  STA $55  ;COLCRS
  lda #0
  sta $56
#
END;(* goto EOP procedure *)

No comments:

Post a Comment