Newsgroups: comp.sys.apple2.programmer,comp.sys.apple2 Subject: Re: Rusty Basic From: dempson@actrix.gen.nz (David Empson) Date: Wed, 21 Apr 1999 00:06:54 +1200 Message-ID: <1dql2yl.1kx0t1f17zruieN@dempson.actrix.gen.nz> References: <371C141F.EFC68888@intergate.bc.ca> Organization: Empsoft X-Newsreader: MacSOUP 2.3 NNTP-Posting-Host: 202.49.157.176 X-Trace: 21 Apr 1999 00:05:38 NZST, 202.49.157.176 Lines: 45 Path: news1.icaen!news.uiowa.edu!NewsNG.Chicago.Qual.Net!207.24.245.130!nyd.news.ans.net!news.idt.net!newsfeed.berkeley.edu!news-stock.gip.net!news.gsl.net!gip.net!news.iprolink.co.nz!news.actrix.gen.nz!dempson Xref: news1.icaen comp.sys.apple2.programmer:10513 comp.sys.apple2:147064 W Stewart 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