[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Rusty Basic
----------
In article <371C141F.EFC68888@intergate.bc.ca>, 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?
>
> Wayne
>
I can't test this myself but this should work:
The BASIC program pokes in a small machine language program in page 3 at
address 768. (Wow! just the phrase "page 3" brings back memories of dozens
of small programs I typed in from magazines)
The first 3 bytes (32,13,197) form the machine language instruction JSR
$C50D (jump to subroutine at $C50D),which is a location in the slot 5 memory
space. There is presumably a routine in the drive controller card's ROM at
that location which ejects the disk. The rest of the program seems to pass
data to this routine,probably which command it wants to have executed e.g.
read,write,format or eject.
To change the slot,change the jump instruction to JSR $Cs05,where s is the
slot number e.g. JSR $C605 for slot 6,or in the BASIC program change the
third number in line 70 from 197 to 192+slot number e.g. slot 1=193,slot
5=197,slot 6=198.
So what's in slot 7? You have a hard drive and 3.5 drive in a II+? If
so,Cool!
Roger