[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rusty Basic



W Stewart <waynes@intergate.bc.ca> wrote:

> I've been using the following program to eject 3.5 inch disks on a II+
> and boot slot 7. I know how to change it to drive 2 and how to change
> boot slots but I don't recall how to change the eject slot from 5.
> 
> 10 REM 3.5 INCH DISK DRIVE EJECTOR
> 20 REM SLOT 5 DRIVE 1 ONLY
> 30 RESTORE
> 40 FOR I = 0 TO 17: READ N
> 50 POKE 768 + I,N: NEXT I
> 60 CALL 768
> 70 DATA 32,13,197,4,11,3,141,10
> 80 DATA 3,96,0,3,1,16,3,4,0,0
> 90 PRINT CHR$ (4); "PR#7"

OK, let's translate that poked-in code to assembly language, so I can
read it.  (Hand assembly and decimal-to-hex conversion to the rescue...)

0300: 20 0D C5       JSR $C50D           ; Smartport entry point
0303: 04             DFB $04             ; Command code = control
0304: 0B 03          DA  $030B           ; Parameter block ptr
0306: 8D 0A 03       STA $030A           ; Store return value
0309: 60             RTS                 ; Return to caller
030A: 00             DS  1               ; Error code storage
030B: 03             DFB $03             ; Parameter count
030C: 01             DFB $01             ; Unit number
030D: 10 03          DA  $0310           ; Control list pointer
030F: 04             DFB $04             ; Control code = eject
0310: 00 00          DA  $0000           ; Count = 0

This code is not very portable.  It has a hard-coded entry point for the
SmartPort firmware on whichever 3.5" disk controller card you are using.
It almost certainly won't work on any other card, unless you identify
the SmartPort entry point on the other card.

Assuming you are just rearranging things in the same machine, then to
change the 3.5" controller slot, you need to replace the 197 byte on
line 70.  The value should be 192 plus the slot, i.e. 193 for slot 1,
194 for slot 2, etc., up to 199 for slot 7.

-- 
David Empson
dempson@actrix.gen.nz
Snail mail: P.O. Box 27-103, Wellington, New Zealand