forked from mist64/cbmsrc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
errors.src
68 lines (59 loc) · 1.53 KB
/
errors.src
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
.page
.subttl error handler (09/17/84): c/128
; *******************************************************
; * stop *
; * *
; * >check stop key flag and return = if true. if true *
; * then close active channels & flush keyboard queue *
; * *
; * >note: returns scan from last keyboard row in .a *
; *******************************************************
nstop
lda stkey ;value of last row
cmp #$7f ;check stop key position
bne 1$ ;not down
php
jsr clrch ;clear channels
sta ndx ;flush queue
plp
1$ rts
.page \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
; *******************************************************
; * error handler *
; * *
; * > prints kernal error message if display enabled. *
; * > returns with error # in .a and .c=1 *
; *******************************************************
error1 lda #1 ;too many files
.byte $2c
error2 lda #2 ;file open
.byte $2c
error3 lda #3 ;file not open
.byte $2c
error4 lda #4 ;file not found
.byte $2c
error5 lda #5 ;device not present
.byte $2c
error6 lda #6 ;not input file
.byte $2c
error7 lda #7 ;not output file
.byte $2c
error8 lda #8 ;missing file name
.byte $2c
error9 lda #9 ;bad device #
.byte $2c
error16 lda #16 ;out of memory
pha ;error number on stack
jsr clrch ;restore i/o channels
ldy #ms1-ms1
bit msgflg
bvc 1$ ;...branch if display disabled
jsr msg ;print 'i/o error #'
pla
pha
ora #$30 ;make error # ascii
jsr bsout ;print it
1$ pla ;restore error code
sec ;signal error
rts
;.end