Mercurial > hg > Members > kono > nitros9-code
annotate level2/cmds/wcreate.asm @ 1500:b00cf13c9f61
Major changes for new NitrOS-9 manual
author | boisy |
---|---|
date | Mon, 05 Jan 2004 00:51:19 +0000 |
parents | 90a09e6e9f12 |
children |
rev | line source |
---|---|
0 | 1 ******************************************************************** |
2 * WCreate - Create a window | |
3 * | |
4 * $Id$ | |
5 * | |
1255 | 6 * Edt/Rev YYYY/MM/DD Modified by |
7 * Comment | |
0 | 8 * ------------------------------------------------------------------ |
1255 | 9 * 3 ????/??/?? |
10 * Original Tandy/Microware version. | |
0 | 11 |
12 nam WCreate | |
13 ttl Create a window | |
14 | |
15 * Disassembled 98/09/11 18:26:55 by Disasm v1.6 (C) 1988 by RML | |
16 | |
17 ifp1 | |
18 use defsfile | |
19 endc | |
20 | |
922
b62985f61614
Added DOHELP conditional, montype now requires dash before options
boisy
parents:
0
diff
changeset
|
21 DOHELP set 0 |
b62985f61614
Added DOHELP conditional, montype now requires dash before options
boisy
parents:
0
diff
changeset
|
22 |
0 | 23 tylg set Prgrm+Objct |
24 atrv set ReEnt+rev | |
1255 | 25 rev set $00 |
0 | 26 edition set 3 |
27 | |
28 mod eom,name,tylg,atrv,start,size | |
29 | |
30 u0000 rmb 2 | |
31 u0002 rmb 1 | |
32 u0003 rmb 7 | |
1440 | 33 newtype rmb 1 |
34 winpath rmb 1 | |
0 | 35 u000C rmb 1 |
1440 | 36 zflag rmb 1 |
0 | 37 u000E rmb 480 |
38 size equ . | |
39 | |
40 name fcs /WCreate/ | |
41 fcb edition | |
922
b62985f61614
Added DOHELP conditional, montype now requires dash before options
boisy
parents:
0
diff
changeset
|
42 |
b62985f61614
Added DOHELP conditional, montype now requires dash before options
boisy
parents:
0
diff
changeset
|
43 IFNE DOHELP |
b62985f61614
Added DOHELP conditional, montype now requires dash before options
boisy
parents:
0
diff
changeset
|
44 HelpMsg fcb C$CR |
0 | 45 fcb C$LF |
46 fcc "WCreate <windpath> [-s=stype] xpos ypos width height fcol bcol [bord]" | |
47 fcb C$CR | |
48 fcb C$LF | |
49 fcc "Use: Create a new window" | |
50 fcb C$CR | |
51 fcb C$LF | |
52 fcc "Options: -s=stype place the window on a new screen, must also" | |
53 fcb C$CR | |
54 fcb C$LF | |
55 fcc " include the border color." | |
56 fcb C$CR | |
57 fcb C$LF | |
58 fcc " -z receive commands from standard input" | |
59 fcb C$CR | |
60 fcb C$LF | |
61 fcc " -? receive help message" | |
62 fcb C$CR | |
63 fcb C$LF | |
922
b62985f61614
Added DOHELP conditional, montype now requires dash before options
boisy
parents:
0
diff
changeset
|
64 ENDC |
b62985f61614
Added DOHELP conditional, montype now requires dash before options
boisy
parents:
0
diff
changeset
|
65 |
b62985f61614
Added DOHELP conditional, montype now requires dash before options
boisy
parents:
0
diff
changeset
|
66 CurOn fdb $1B21 |
0 | 67 |
1440 | 68 start clr <zflag |
0 | 69 clra |
70 coma | |
71 sta <u000C | |
1440 | 72 lbsr skipspc skip spaces |
73 lda ,x get next character | |
74 cmpa #PDELIM path delimiter? | |
75 bne L015D branch if not | |
0 | 76 bsr L01B2 |
922
b62985f61614
Added DOHELP conditional, montype now requires dash before options
boisy
parents:
0
diff
changeset
|
77 bra Exit |
0 | 78 L015D cmpa #'- |
922
b62985f61614
Added DOHELP conditional, montype now requires dash before options
boisy
parents:
0
diff
changeset
|
79 lbne ShowHelp |
0 | 80 leax 1,x |
81 lda ,x+ | |
1440 | 82 IFNE DOHELP |
83 cmpa #'? | |
922
b62985f61614
Added DOHELP conditional, montype now requires dash before options
boisy
parents:
0
diff
changeset
|
84 lbeq ShowHelp |
1440 | 85 ENDC |
86 cmpa #'z | |
0 | 87 beq L0177 |
1440 | 88 cmpa #'Z |
922
b62985f61614
Added DOHELP conditional, montype now requires dash before options
boisy
parents:
0
diff
changeset
|
89 lbne ShowHelp |
0 | 90 L0177 lda #$01 |
1440 | 91 sta <zflag |
0 | 92 L017B clra |
93 leax u000E,u | |
1440 | 94 ldy #80 |
0 | 95 os9 I$ReadLn |
96 bcs L019C | |
97 lda ,x | |
98 cmpa #$2A | |
99 beq L0177 | |
1440 | 100 lbsr skipspc skip spaces |
0 | 101 lda ,x |
102 cmpa #C$CR | |
103 beq L01A0 | |
104 bsr L01B5 | |
922
b62985f61614
Added DOHELP conditional, montype now requires dash before options
boisy
parents:
0
diff
changeset
|
105 bcs Exit |
0 | 106 bra L017B |
1440 | 107 L019C cmpb #E$EOF |
922
b62985f61614
Added DOHELP conditional, montype now requires dash before options
boisy
parents:
0
diff
changeset
|
108 bne Exit |
0 | 109 L01A0 lda #$01 |
1440 | 110 lbsr cursoron turn on text cursor |
0 | 111 lda <u000C |
922
b62985f61614
Added DOHELP conditional, montype now requires dash before options
boisy
parents:
0
diff
changeset
|
112 bmi ExitOk |
0 | 113 os9 I$Close |
922
b62985f61614
Added DOHELP conditional, montype now requires dash before options
boisy
parents:
0
diff
changeset
|
114 bcs Exit |
b62985f61614
Added DOHELP conditional, montype now requires dash before options
boisy
parents:
0
diff
changeset
|
115 ExitOk clrb |
b62985f61614
Added DOHELP conditional, montype now requires dash before options
boisy
parents:
0
diff
changeset
|
116 Exit os9 F$Exit |
b62985f61614
Added DOHELP conditional, montype now requires dash before options
boisy
parents:
0
diff
changeset
|
117 |
1440 | 118 L01B2 lbsr skipspc skip spaces |
119 L01B5 clr <newtype | |
0 | 120 clr <u0002 |
1440 | 121 lda ,x get character at X |
122 cmpa #PDELIM pathlist delimiter? | |
123 lbne Exiting branch if not | |
124 lda #UPDAT. | |
0 | 125 pshs u,x,a |
1440 | 126 leax 1,x point past pathlist delimiter |
127 os9 I$Attach attach device | |
0 | 128 puls u,x,a |
1440 | 129 lbcs L0253 branch if error |
130 os9 I$Open open device | |
131 bcs L0253 branch if error | |
132 sta <winpath save path | |
133 lbsr skipspc skip spaces | |
0 | 134 lda ,x+ |
135 cmpa #'- | |
1440 | 136 bne Get6 |
0 | 137 lda ,x+ |
1440 | 138 cmpa #'s |
0 | 139 beq L01EA |
1440 | 140 cmpa #'S |
141 bne Exiting | |
0 | 142 L01EA lda ,x+ |
1440 | 143 cmpa #'= |
144 bne Exiting | |
0 | 145 leay u0002,u |
1440 | 146 lbsr asc2num |
147 bcs Exiting | |
148 inc <newtype | |
149 ldb #$07 get 7 numbers (last one is border) | |
0 | 150 bra L0203 |
1440 | 151 Get6 leay u0003,u |
152 ldb #$06 get 6 numbers | |
0 | 153 leax -1,x |
1440 | 154 L0203 bsr asc2num |
155 bcs Exiting | |
0 | 156 decb |
157 bne L0203 | |
158 leax ,u | |
159 lda #$1B | |
160 sta ,x | |
161 lda #$20 | |
162 sta 1,x | |
1440 | 163 tst <newtype |
0 | 164 beq L021E |
165 ldy #$000A | |
166 bra L0222 | |
167 L021E ldy #$0009 | |
1440 | 168 L0222 lda <winpath |
0 | 169 os9 I$Write |
170 bcs L0253 | |
1440 | 171 tst <zflag |
0 | 172 beq L024E |
1440 | 173 tst <newtype |
0 | 174 beq L024E |
175 tst <u000C | |
176 bpl L0239 | |
177 lda #$01 | |
1440 | 178 bsr cursoron turn on text cursor |
179 L0239 lda <winpath | |
180 bsr cursoron turn on text cursor | |
0 | 181 bcs L0253 |
182 tst <u000C | |
183 bmi L0248 | |
184 lda <u000C | |
185 os9 I$Close | |
1440 | 186 L0248 lda <winpath |
0 | 187 sta <u000C |
188 bra L0253 | |
1440 | 189 L024E lda <winpath |
0 | 190 os9 I$Close |
191 L0253 rts | |
1440 | 192 |
193 cursoron leax >CurOn,pcr | |
0 | 194 ldy #$0002 |
195 os9 I$Write | |
196 rts | |
1440 | 197 |
198 skipspc lda ,x+ | |
199 cmpa #C$SPAC | |
200 beq skipspc | |
0 | 201 leax -1,x |
202 rts | |
1440 | 203 |
204 Exiting leas $02,s | |
922
b62985f61614
Added DOHELP conditional, montype now requires dash before options
boisy
parents:
0
diff
changeset
|
205 ShowHelp equ * |
b62985f61614
Added DOHELP conditional, montype now requires dash before options
boisy
parents:
0
diff
changeset
|
206 IFNE DOHELP |
b62985f61614
Added DOHELP conditional, montype now requires dash before options
boisy
parents:
0
diff
changeset
|
207 lda #$01 |
b62985f61614
Added DOHELP conditional, montype now requires dash before options
boisy
parents:
0
diff
changeset
|
208 leax >HelpMsg,pcr |
0 | 209 ldy #$0133 |
210 os9 I$Write | |
922
b62985f61614
Added DOHELP conditional, montype now requires dash before options
boisy
parents:
0
diff
changeset
|
211 ENDC |
b62985f61614
Added DOHELP conditional, montype now requires dash before options
boisy
parents:
0
diff
changeset
|
212 lbra ExitOk |
1440 | 213 |
214 * Entry: X = address of ASCII string to convert | |
215 * Y = location to store byte | |
216 * Exit: B = converted value | |
217 asc2num pshs b | |
0 | 218 clrb |
219 stb ,y | |
1440 | 220 L0280 lda ,x+ |
221 cmpa #'0 | |
0 | 222 blt L029B |
1440 | 223 cmpa #'9 |
0 | 224 bhi L029B |
1440 | 225 suba #'0 |
0 | 226 pshs a |
1440 | 227 lda #10 |
0 | 228 ldb ,y |
229 mul | |
230 addb ,s+ | |
231 stb ,y | |
232 bvs L02A7 | |
233 bra L0280 | |
234 L029B cmpa #C$CR | |
235 beq L02AA | |
236 cmpa #C$SPAC | |
1440 | 237 bsr skipspc skip spaces |
0 | 238 bra L02AA |
239 bne L02A7 | |
240 L02A7 comb | |
241 bra L02AD | |
242 L02AA clrb | |
243 leay $01,y | |
244 L02AD puls pc,b | |
245 | |
246 emod | |
247 eom equ * | |
248 end | |
249 |