The GETCHAR.I include file resides on the Kyan Pascal 2.x Utilities Disk 1.
- function Get_Char(VAR Ch: Char):integer;
Source Code
function Get_Char(VAR Ch: Char):integer;
BEGIN
get_char:=0;
#a
stx _t
ldy #7
lda (_SP),y
sta _t+1
iny
lda (_SP),y
sta _t+2
ldx #$10
gcopn1 lda $340,x
cmp #$ff
beq gcopn2
txa
clc
adc #$10
tax
cpx #$80
bne gcopn1
ldy #$81
jmp gcleave
gcopn2 stx _t+4
lda #3
sta $342,x
lda #4
sta $34a,x
lda #0
sta $34b,x
lda #>gstr
sta $344,x
lda #<gstr
sta $345,x
jsr $e456
bpl gcover
sty _t+3
jmp gclose
gstr asc 'K:'
db $9b
gcover ldx _t+4
lda #7
sta $342,x
lda #0
sta $348,x
sta $349,x
jsr $e456
sty _t+3
ldy #0
sta (_T+1),y
gclose ldx _t+4
lda #$c
sta $342,x
jsr $e456
ldy _t+3
gcleave tya
ldy #5
sta (_SP),y
ldx _t
#
END;(* Get Character procedure *)
No comments:
Post a Comment