2591
|
1 s********************************************************************
|
|
2 * scsitest - Test a SCSI device through the SS.DCmd call
|
|
3 *
|
|
4 * $Id$
|
|
5 *
|
|
6 * Edt/Rev YYYY/MM/DD Modified by
|
|
7 * Comment
|
|
8 * ------------------------------------------------------------------
|
|
9 * 1 2005/12/11 Boisy G. Pitre
|
|
10 * Created.
|
|
11
|
|
12 NAM scsitest
|
|
13 TTL Test a SCSI device through the SS.DCmd call
|
|
14
|
|
15 IFP1
|
|
16 USE defsfile
|
|
17 USE scfdefs
|
|
18 ENDC
|
|
19
|
|
20 tylg SET Prgrm+Objct
|
|
21 atrv SET ReEnt+rev
|
|
22 rev SET $00
|
|
23 edition SET 1
|
|
24
|
|
25 MOD eom,name,tylg,atrv,start,size
|
|
26
|
|
27 ORG 0
|
|
28 code RMB 1
|
|
29 lsn RMB 3
|
|
30 left RMB 2
|
|
31 path RMB 1
|
|
32 txbuff RMB 2048 to accomodate CD-ROM sector sizes
|
|
33 RMB 200
|
|
34 size EQU .
|
|
35
|
|
36 IntroM FCC /SCSI Direct Command Test/
|
|
37 FCB C$CR
|
|
38 StartM FCC /Sending START UNIT... /
|
|
39 StartML EQU *-StartM
|
|
40 Done FCC /Done!/
|
|
41 FCB C$CR
|
|
42 StartUnit FCB $1B,$00,$00,$00,$01,$00
|
|
43 StopM FCC /Sending STOP UNIT.../
|
|
44 StopML EQU *-StopM
|
|
45 StopUnit FCB $1B,$00,$00,$00,$00,$00
|
|
46 ReadM FCC /Testing READ... /
|
|
47 ReadML EQU *-ReadM
|
|
48
|
|
49 name FCS /scsitest/
|
|
50 FCB edition
|
|
51
|
|
52 start leay txbuff,u
|
|
53 lda #$08
|
|
54 sta <code
|
|
55 clr <lsn
|
|
56 clr <lsn+1
|
|
57 clr <lsn+2
|
|
58 lda #$01
|
|
59 sta <left
|
|
60 clr <left+1
|
|
61 l@ lda ,x+
|
|
62 cmpa #C$CR
|
|
63 beq ok@
|
|
64 cmpa #C$SPAC
|
|
65 beq ok@
|
|
66 sta ,y+
|
|
67 bra l@
|
|
68 ok@ ldd #'@*256+C$CR
|
|
69 std ,y
|
|
70 leax txbuff,u
|
|
71
|
|
72 lda #READ.
|
|
73 os9 I$Open
|
|
74 lbcs exit
|
|
75 sta path,u
|
|
76
|
|
77 leax IntroM,pcr
|
|
78 lda #1
|
|
79 ldy #100
|
|
80 os9 I$WritLn
|
|
81
|
|
82 bsr DoStartUnit
|
|
83 bcs exit
|
|
84
|
|
85 bsr DoReadSector
|
|
86 bcs exit
|
|
87
|
|
88 bsr DoStopUnit
|
|
89 bcs exit
|
|
90
|
|
91 bsr DoStartUnit
|
|
92 bcs exit
|
|
93
|
|
94 exitok clrb
|
|
95 exit os9 F$Exit
|
|
96
|
|
97 * Do START UNIT
|
|
98 DoStartUnit leax StartM,pcr
|
|
99 ldy #StartML
|
|
100 lda #1
|
|
101 os9 I$Write
|
|
102
|
|
103 leay StartUnit,pcr
|
|
104 lda path,u
|
|
105 ldb #SS.DCmd
|
|
106 os9 I$SetStt
|
|
107 bcs exit@
|
|
108 leax Done,pcr
|
|
109 ldy #100
|
|
110 lda #1
|
|
111 os9 I$WritLn
|
|
112 exit@ rts
|
|
113
|
|
114 * Do READ of sector
|
|
115 DoReadSector leax ReadM,pcr
|
|
116 lda #1
|
|
117 ldy #READML
|
|
118 os9 I$Write
|
|
119
|
|
120 ldd <lsn+1
|
|
121 addd #1
|
|
122 std <lsn+1
|
|
123 bcc w
|
|
124 inc <lsn
|
|
125 w lda <lsn
|
|
126
|
|
127 leay code,u
|
|
128 leax txbuff,u
|
|
129 lda <path
|
|
130 ldb #SS.DCmd
|
|
131 os9 I$SetStt
|
|
132 bcs exit@
|
|
133 leax Done,pcr
|
|
134 ldy #100
|
|
135 lda #1
|
|
136 os9 I$WritLn
|
|
137 exit@ rts
|
|
138
|
|
139 * Do STOP UNIT
|
|
140 DoStopUnit leax StopM,pcr
|
|
141 ldy #StopML
|
|
142 lda #1
|
|
143 os9 I$Write
|
|
144
|
|
145 leay StopUnit,pcr
|
|
146 lda path,u
|
|
147 ldb #SS.DCmd
|
|
148 os9 I$SetStt
|
|
149 bcs exit@
|
|
150 leax Done,pcr
|
|
151 ldy #100
|
|
152 lda #1
|
|
153 os9 I$WritLn
|
|
154 exit@ rts
|
|
155
|
|
156 EMOD
|
|
157 eom EQU *
|
|
158 END
|