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