Mercurial > hg > Members > kono > nitros9-code
annotate level1/cmds/park.asm @ 3295:6b7a7b233925 default tip
makefile: Allow PORTS with level1/2 mix
https://sourceforge.net/p/nitros9/feature-requests/10/
author | Tormod Volden <debian.tormod@gmail.com> |
---|---|
date | Tue, 19 Apr 2022 18:12:17 +0200 |
parents | 84ea83668304 |
children |
rev | line source |
---|---|
127 | 1 ******************************************************************** |
197 | 2 * Park - Park a hard drive |
127 | 3 * |
4 * $Id$ | |
5 * | |
1325
84ea83668304
Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents:
915
diff
changeset
|
6 * Edt/Rev YYYY/MM/DD Modified by |
84ea83668304
Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents:
915
diff
changeset
|
7 * Comment |
127 | 8 * ------------------------------------------------------------------ |
1325
84ea83668304
Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents:
915
diff
changeset
|
9 * 1 ????/??/?? |
84ea83668304
Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents:
915
diff
changeset
|
10 * From Tandy OS-9 Level One VR 02.00.00. |
84ea83668304
Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents:
915
diff
changeset
|
11 * |
84ea83668304
Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents:
915
diff
changeset
|
12 * 2 2002/07/13 Boisy G. Pitre |
84ea83668304
Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents:
915
diff
changeset
|
13 * Changed name to a mixture of upper/lowercase. |
127 | 14 |
197 | 15 nam Park |
127 | 16 ttl Park a hard drive |
17 | |
18 * Disassembled 02/07/06 21:41:10 by Disasm v1.6 (C) 1988 by RML | |
19 | |
20 ifp1 | |
21 use defsfile | |
22 endc | |
23 | |
915
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
24 DOHELP set 0 |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
25 |
127 | 26 tylg set Prgrm+Objct |
27 atrv set ReEnt+rev | |
1325
84ea83668304
Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents:
915
diff
changeset
|
28 rev set $00 |
200
e9ce43cc215e
Made major changes to headers for consistency and identification
boisy
parents:
197
diff
changeset
|
29 edition set 2 |
127 | 30 |
31 mod eom,name,tylg,atrv,start,size | |
32 | |
915
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
33 org 0 |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
34 parmptr rmb 2 |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
35 devname rmb 20 |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
36 devbuff rmb 502 |
127 | 37 size equ . |
38 | |
197 | 39 name fcs /Park/ |
200
e9ce43cc215e
Made major changes to headers for consistency and identification
boisy
parents:
197
diff
changeset
|
40 fcb edition |
127 | 41 |
915
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
42 IFNE DOHELP |
127 | 43 HelpMsg fcb C$LF |
915
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
44 fcc "Use: Park <devname> [...]" |
127 | 45 fcb C$LF |
46 fcc " To park hard disk heads" | |
47 fcb C$LF | |
48 fcc " on inner track of drive" | |
49 fcb C$LF,C$CR | |
50 HelpMsgL equ *-HelpMsg | |
915
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
51 ENDC |
127 | 52 |
53 Parked fcc " has been parked. " | |
54 fcb C$CR | |
55 ParkedLen equ *-Parked | |
56 | |
57 NoOpen fcc " cannot be opened." | |
58 fcb C$CR | |
59 NoOpenL equ *-NoOpen | |
60 | |
61 NoPark fcc " has not been parked." | |
62 fcb C$CR | |
63 NoParkL equ *-NoPark | |
64 | |
915
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
65 start bsr SkipSpcs skip over spaces |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
66 cmpa #C$CR CR? |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
67 beq ShowHelp if so, show help |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
68 NextDev cmpa #PDELIM else is char delim? |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
69 bne ShowHelp branch if not |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
70 bsr CopyDev copy device name |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
71 lda #READ. read permission |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
72 os9 I$Open open path to device |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
73 bcs OpenErr branch if error |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
74 ldb #SS.SQD do park setstat |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
75 os9 I$SetStt do it! |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
76 bcs NotPark branch if error |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
77 os9 I$Close close path |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
78 bsr ShowDev show device name |
127 | 79 leax >Parked,pcr |
80 ldy #ParkedLen | |
915
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
81 WriteMsg os9 I$WritLn |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
82 ldx <parmptr get pointer to command line |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
83 lda ,x get char |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
84 cmpa #C$CR CR? |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
85 bne NextDev if not, park next device |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
86 ExitOk clrb |
127 | 87 os9 F$Exit |
915
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
88 ShowHelp equ * |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
89 IFNE DOHELP |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
90 lda #2 to stderr... |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
91 leax >HelpMsg,pcr point to help message |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
92 ldy #HelpMsgL get length |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
93 os9 I$WritLn then write |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
94 ENDC |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
95 bra ExitOk and exit |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
96 |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
97 ShowDev leax devname,u point to device name |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
98 lda #2 to stderr |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
99 ldy <devbuff get length of device |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
100 os9 I$Write write it |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
101 rts |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
102 |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
103 OpenErr bsr ShowDev show device name |
127 | 104 leax >NoOpen,pcr |
105 ldy #NoOpenL | |
915
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
106 bra WriteMsg write open error |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
107 |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
108 NotPark os9 I$Close close path |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
109 bsr ShowDev show device name |
127 | 110 leax >NoPark,pcr |
111 ldy #NoParkL | |
915
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
112 bra WriteMsg write not parked message |
197 | 113 |
114 * Skip spaces | |
915
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
115 SkipSpcs lda ,x get char at X |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
116 cmpa #C$SPAC space? |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
117 bne L0121 branch if not |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
118 leax 1,x else advance |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
119 bra SkipSpcs and get next char |
127 | 120 L0121 rts |
121 | |
915
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
122 CopyDev clrb |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
123 leay devname,u point to device name |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
124 pshs y and save ptr on stack |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
125 CopyX2Y lda ,x+ get byte at X |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
126 cmpa #C$SPAC space? |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
127 bls L0132 if same or lower, exit loop |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
128 sta ,y+ else save at Y |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
129 incb inc b |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
130 bra CopyX2Y and continue copy |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
131 L0132 lda #PENTIR get ENTIRE char |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
132 sta ,y+ save after copied device |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
133 leax -1,x back up one at X |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
134 bsr SkipSpcs skip any spaces |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
135 stx <parmptr save updated pointer |
127 | 136 clra |
915
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
137 std <devbuff,u save pathlist length |
127 | 138 puls pc,x |
139 | |
140 emod | |
141 eom equ * | |
142 end | |
143 |