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

Re: Need some help



> Chris Smolinski wrote:
> > Does anyone have handy the necessary info to read in a sector?

I believe this is the exact information you are looking for with regard
to reading in the sectors off a standard disk.  Now all you have to do
is init a comm port and output the bytes.

Good luck!
Ed

This info is form the FAQs at:
http://home.swbell.net/rubywand/Csa2DOSMM.html

From: Andy McFadden 

016- How can I use DOS 3.3 to read and write sectors from machine code? 

     DOS 3.3 works like this: 

     JSR  $3E3      ;get address of RWTS IOB (low in Y, high in A) 

    (you can either change the stuff that Y/A point to, or set up 
     your own IOB and skip the call to $3E3) 

     JSR  $3D9      ;call RWTS (with IOB address in Y/A) 
  

     The IOB (Input/Output Block) is small but non-trivial. Here's what
Beneath 
Apple DOS says: 

$00     table type (always $01) 
$01     slot *16 
$02     drive (1 or 2) 
$03     volume expected ($00 for any) 
$04     track ($0-$22) 
$05     sector ($0-$0f) 
$06-07  address (lo/hi) of the Device Characteristics Table 
$08-09  address (lo/hi) of the 256 byte buffer for read/write 
$0A     not used 
$0B     byte count for partial sector ($00 for 256 bytes) 
$0C     command code (0=seek, 1=read, 2=write, 4=format) 
$0D     return code (carry set on error): 

       $00 = no errors 
       $08 = error during initialization 
       $10 = write protect error 
       $20 = volume mismatch error 
       $40 = drive error 
       $80 = read error (obsolete) 

$0E  volume number of last access (must be initialized) 
$0F  slot number of last access *16 (must be initialized) 
$10  drive number of last access (must be initialized) 
  

Device characteristics table: 

$00     device type (should be $00 for DiskII) 
$01     phases per track (should be $01 for DiskII) 
$02-03  motor on time count (should be $EFD8 for DiskII) 
  

NOTE: RWTS uses zero-page location $48, which is also used by the Apple 
monitor to hold the P-register value.  Location $48 should be set to
zero 
after each call to RWTS.