annotate level1/cmds/printerr.asm @ 196:b213f39b1bc6

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