Mercurial > hg > Members > kono > nitros9-code
annotate level1/cmds/park.asm @ 1287:10957d54bf16
Made all modules rev 0
author | boisy |
---|---|
date | Sat, 30 Aug 2003 20:16:51 +0000 |
parents | d049083f7ab0 |
children | 84ea83668304 |
rev | line source |
---|---|
127 | 1 ******************************************************************** |
197 | 2 * Park - Park a hard drive |
127 | 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:
197
diff
changeset
|
8 * 1 From Tandy OS-9 Level One VR 02.00.00 |
e9ce43cc215e
Made major changes to headers for consistency and identification
boisy
parents:
197
diff
changeset
|
9 * 2 Changed name to a mixture of upper/lowercase BGP 02/07/13 |
127 | 10 |
197 | 11 nam Park |
127 | 12 ttl Park a hard drive |
13 | |
14 * Disassembled 02/07/06 21:41:10 by Disasm v1.6 (C) 1988 by RML | |
15 | |
16 ifp1 | |
17 use defsfile | |
18 endc | |
19 | |
915
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
20 DOHELP set 0 |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
21 |
127 | 22 tylg set Prgrm+Objct |
23 atrv set ReEnt+rev | |
24 rev set $01 | |
200
e9ce43cc215e
Made major changes to headers for consistency and identification
boisy
parents:
197
diff
changeset
|
25 edition set 2 |
127 | 26 |
27 mod eom,name,tylg,atrv,start,size | |
28 | |
915
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
29 org 0 |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
30 parmptr rmb 2 |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
31 devname rmb 20 |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
32 devbuff rmb 502 |
127 | 33 size equ . |
34 | |
197 | 35 name fcs /Park/ |
200
e9ce43cc215e
Made major changes to headers for consistency and identification
boisy
parents:
197
diff
changeset
|
36 fcb edition |
127 | 37 |
915
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
38 IFNE DOHELP |
127 | 39 HelpMsg fcb C$LF |
915
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
40 fcc "Use: Park <devname> [...]" |
127 | 41 fcb C$LF |
42 fcc " To park hard disk heads" | |
43 fcb C$LF | |
44 fcc " on inner track of drive" | |
45 fcb C$LF,C$CR | |
46 HelpMsgL equ *-HelpMsg | |
915
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
47 ENDC |
127 | 48 |
49 Parked fcc " has been parked. " | |
50 fcb C$CR | |
51 ParkedLen equ *-Parked | |
52 | |
53 NoOpen fcc " cannot be opened." | |
54 fcb C$CR | |
55 NoOpenL equ *-NoOpen | |
56 | |
57 NoPark fcc " has not been parked." | |
58 fcb C$CR | |
59 NoParkL equ *-NoPark | |
60 | |
915
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
61 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
|
62 cmpa #C$CR CR? |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
63 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
|
64 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
|
65 bne ShowHelp branch if not |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
66 bsr CopyDev copy device name |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
67 lda #READ. read permission |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
68 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
|
69 bcs OpenErr branch if error |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
70 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
|
71 os9 I$SetStt do it! |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
72 bcs NotPark branch if error |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
73 os9 I$Close close path |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
74 bsr ShowDev show device name |
127 | 75 leax >Parked,pcr |
76 ldy #ParkedLen | |
915
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
77 WriteMsg os9 I$WritLn |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
78 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
|
79 lda ,x get char |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
80 cmpa #C$CR CR? |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
81 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
|
82 ExitOk clrb |
127 | 83 os9 F$Exit |
915
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
84 ShowHelp equ * |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
85 IFNE DOHELP |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
86 lda #2 to stderr... |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
87 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
|
88 ldy #HelpMsgL get length |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
89 os9 I$WritLn then write |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
90 ENDC |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
91 bra ExitOk and exit |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
92 |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
93 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
|
94 lda #2 to stderr |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
95 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
|
96 os9 I$Write write it |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
97 rts |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
98 |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
99 OpenErr bsr ShowDev show device name |
127 | 100 leax >NoOpen,pcr |
101 ldy #NoOpenL | |
915
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
102 bra WriteMsg write open error |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
103 |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
104 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
|
105 bsr ShowDev show device name |
127 | 106 leax >NoPark,pcr |
107 ldy #NoParkL | |
915
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
108 bra WriteMsg write not parked message |
197 | 109 |
110 * Skip spaces | |
915
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
111 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
|
112 cmpa #C$SPAC space? |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
113 bne L0121 branch if not |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
114 leax 1,x else advance |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
115 bra SkipSpcs and get next char |
127 | 116 L0121 rts |
117 | |
915
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
118 CopyDev clrb |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
119 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
|
120 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
|
121 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
|
122 cmpa #C$SPAC space? |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
123 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
|
124 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
|
125 incb inc b |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
126 bra CopyX2Y and continue copy |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
127 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
|
128 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
|
129 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
|
130 bsr SkipSpcs skip any spaces |
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
131 stx <parmptr save updated pointer |
127 | 132 clra |
915
d049083f7ab0
Removed seemlngly useless variable and instructions to save the path to the device.
boisy
parents:
200
diff
changeset
|
133 std <devbuff,u save pathlist length |
127 | 134 puls pc,x |
135 | |
136 emod | |
137 eom equ * | |
138 end | |
139 |