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