26
|
1 ********************************************************************
|
|
2 * Printerr - OS-9 Level One printerr routine
|
|
3 *
|
|
4 * $Id$
|
|
5 *
|
|
6 * Ed. Comments Who YY/MM/DD
|
|
7 * ------------------------------------------------------------------
|
|
8 * 6 Original Tandy/Microware version BGP 02/04/06
|
|
9
|
0
|
10 nam Printerr
|
|
11 ttl OS-9 Level One printerr routine
|
|
12
|
|
13 ifp1
|
|
14 use defsfile
|
|
15 endc
|
|
16
|
|
17 tylg set Prgrm+Objct
|
|
18 atrv set ReEnt+rev
|
|
19 rev set $01
|
|
20
|
|
21 mod eom,name,tylg,atrv,start,size
|
|
22
|
|
23 datarea rmb 86
|
|
24 size equ .
|
|
25
|
|
26 name fcs /Printerr/
|
|
27 fcb $06
|
|
28
|
196
|
29 ErrFile fcc "/DD/SYS/ERRMSG"
|
0
|
30 fcb $0D
|
|
31 fcc ",,,,,,,,,,,,"
|
|
32
|
|
33 ErrMsg fcc "Error #"
|
|
34 fcb $FF
|
|
35
|
|
36 SysSVC fcb F$PErr
|
|
37 fdb FPErr-*-2
|
|
38 fcb $80
|
|
39
|
|
40 start clra
|
|
41 leax <name,pcr
|
|
42 os9 F$Link link one extra time
|
|
43 bcs error
|
|
44 leay <SysSVC,pcr
|
|
45 os9 F$SSvc
|
|
46 clrb
|
|
47 error os9 F$Exit
|
|
48
|
|
49 FPErr ldx <D.Proc
|
|
50 lda P$PATH+2,x get stderr path
|
|
51 beq Exit2
|
|
52 leas <-$56,s make room on stack
|
|
53 ldb R$B,u get error code
|
|
54 leau ,s point U to save area
|
|
55 sta ,u store path
|
|
56 stb 2,u store error code
|
|
57 bsr PErrOrg print error as originally done
|
|
58 lda #READ.
|
|
59 leax >ErrFile,pcr
|
|
60 os9 I$Open
|
|
61 sta 1,u save path to file
|
|
62 bcs Exit1
|
|
63 bsr L008D
|
|
64 bcs L0083
|
|
65 bne L0083
|
|
66 L0077 bsr L00D4
|
|
67 bsr ReadLine
|
|
68 bcs L0083
|
|
69 ldb ,x
|
|
70 cmpb #$30
|
|
71 bcs L0077
|
|
72 L0083 lda 1,u
|
|
73 os9 I$Close
|
|
74 Exit1 leas <$56,s
|
|
75 Exit2 clrb
|
|
76 rts
|
|
77
|
|
78 L008D bsr ReadLine
|
|
79 bcs L009B
|
|
80 bsr L00DE
|
|
81 cmpa #$30
|
|
82 bcc L008D
|
|
83 cmpb 2,u
|
|
84 bne L008D
|
|
85 L009B rts
|
|
86
|
|
87 * read a line from the error file
|
|
88 ReadLine lda 1,u get path number of file
|
|
89 leax 5,u point X to buffer
|
|
90 ldy #80 max 80 chars
|
|
91 os9 I$ReadLn read line
|
|
92 rts
|
|
93
|
|
94 PErrOrg leax >ErrMsg,pcr
|
|
95 leay 5,u point to buffer area
|
|
96 lda ,x+
|
|
97 CopyLoop sta ,y+
|
|
98 lda ,x+
|
|
99 bpl CopyLoop while hi bit not set in A
|
|
100 ldb 2,u get error number
|
|
101 lda #$2F
|
|
102 L00BA inca
|
|
103 subb #$64
|
|
104 bcc L00BA
|
|
105 sta ,y+
|
|
106 lda #$3A
|
|
107 L00C3 deca
|
|
108 addb #10
|
|
109 bcc L00C3
|
|
110 sta ,y+
|
|
111 tfr b,a
|
|
112 adda #$30
|
|
113 ldb #$0D
|
|
114 std ,y+
|
|
115 leax 5,u point X at buffer
|
|
116 L00D4 ldy #80 max string len
|
|
117 lda ,u get stderr path
|
|
118 os9 I$WritLn
|
|
119 rts
|
|
120
|
|
121 L00DE clrb
|
|
122 L00DF lda ,x+
|
|
123 suba #$30
|
|
124 cmpa #$09
|
|
125 bhi L00F0
|
|
126 pshs a
|
|
127 lda #10
|
|
128 mul
|
|
129 addb ,s+
|
|
130 bcc L00DF
|
|
131 L00F0 lda -1,x
|
|
132 rts
|
|
133
|
|
134 emod
|
|
135 eom equ *
|
|
136 end
|
|
137
|