Next Previous Contents

9. Other hints

9.1 Passing arguments to the program

Command line arguments can be passed to main() after BLOAD. Since this is not supported by BASIC, the following syntax was chosen:


  1. Arguments are separated by spaces.
  2. Arguments may be quoted.
  3. Leading and trailing spaces around an argument are ignored. Spaces within a quoted argument are allowed.
  4. The first argument passed to main is the program name.
  5. A maximum number of 10 arguments (including the program name) are supported.

9.2 Interrupts

The runtime for the Apple ][ uses routines marked as .INTERRUPTOR for ProDOS 8 interrupt handlers. Such routines must be written as simple machine language subroutines and will be called automatically by the interrupt handler code when they are linked into a program. See the discussion of the .CONDES feature in the assembler manual.

9.3 DIO

Drive ID

The function dio_open() has the single parameter device to identify the device to be opened. Therefore an Apple II slot and drive pair is mapped to that device according to the formula

device = slot + (drive - 1) * 8

so that for example slot 6 drive 2 is mapped to device 14.

Sector count

The function dio_query_sectcount() returns the correct sector count for all ProDOS 8 disks. However for any non-ProDOS 8 disk it simply always returns 280 (which is only correct for a 140 KB disk). This condition is indicated by the _oserror value 82.

Next Previous Contents