•  Back 
  •  Assembling Language(s) 
  •  Index 
  •  Tree View 
  •  Cross references 
  •  Help page 
  •  Show info about hypertext 
  •  View a new file 
Topic       : 
Author      : 
Version     : 
Subject     : 68000 machine code
Nodes       : 74
Index Size  : 2808
HCP-Version : 2
Compiled on : Atari
@charset    : atarist
@lang       : 
@default    : 
@help       : 
@options    : -i -s +x
@width      : 75

          GEMDOS QUICK REFERENCE GUIDE. (TRAP #1)


CALL   NAME      QUICK DESCRIPTION
$01     CONIN     Get (wait for) a single keyboard char (and display).
$02     CONOUT    Put a single char. to the screen.
$03     CAUXIN    Get a character from the RS 232 port
$04     CAUXOUT   Output a character to the RS 232 port
$05     CPRNOUT   Put a character to the printer.
$06     CRAWIO    Parameter $FF gets a key (if there) like CONIN
                  Any other parameter and it acts like CONOUT
$07     CRAWCIN   Same as CONIN but not displayed to screen.
$08     CNECIN    Exactly the same as 07 CRAWIN
$09     CCONWS    Print a LINE to the screen at current position.
$0A     CCONRS    Read a LINE from the keyboard
$0B     CCONIS    Check whether a keypress has been stored in the buffer.
                  (CONIN will loop till char. arrives, this just checks)
$0E     DSETDRV   Change the currently active drive.
$10     CCONOS    Checks whether screen is ready (don't blame me)
$11     CPRNOS    Checks printer status (Ready/not ready)
$12     CAUXIS    See if a character is available from RS 232
$13     CAUXOS    Checks if RS 232 is ready for next output.
$19     DGETDRV   Get which drive is currently active
$1A     FSETDTA   Set up 44 byte buffer address for disk info
$20     SUPER     Patched into Gemdos to allow change to Supervisor mode.
$2A     TGETDATE  Gets the system date (Not the keyboard one)
$2B     TSETDATE  Sets the system date (Not the keyboard one)
$2C     TGETTIME  Same for getting the time
$2D     TSETTIME  And set the time
$2F     FGETDTA   Gets the address of the current buffer (see $1A)
$30     SVERSION  Gets the Gemdos version number (NOT THE TOS VERSION)
$31     PTERMRES  Terminate program but keep it in memory.
$36     DFREE     Get the free space left on the disk
$39     DCREATE   Create a new folder
$3A     DDELETE   Delete a folder
$3B     DSETPATH  Change the directory pathname (open/close folder)
$3C     FCREATE   Create a new file
$3D     FOPEN     Open an existing file
$3E     FCLOSE    Close a file (if you open, make sure you close)
$3F     FREAD     Read a file (or part thereof)
$40     FWRITE    Write (any number of bytes) to a file
                  (The file must already exist, see FOPEN and FCREATE)
$41     FDELETE   Delete a file (And don't change your mind later)
$42     FSEEK     Allows access from any point in the file.
$43     FATTRIB   Change file attributes (read only etc.)
$45     FDUP      Get a handle number for a device (watch out!)
$46     FFORCE    Should be able to force a change of input or output.
                  Don't know of anyone having used this succesfully.
$47     DGETPATH  Returns the current pathname (max 64 bytes)
$48     MALLOC    Returns either avail memory(-1) or reserves it
$49     MFREE     Releases memory reserved with MALLOC. Make sure you
                  have the address correct.
$4A     MSHRINK   When loading a program, the system reserves ALL avail.
                  memory. To release some of this (you may not be the
                  only thing running), use the MSHRINK function.
$4B     PEXEC     Allows one program to call and run another (chaining)
$4C     PTERM     Terminate program. Releases not only the programs own
                  memory (and zeroes it) but also any and all memory
                  that may have been reserved from the program.
$4E     FSFIRST   Search for a given filename on the disk. (If you use
                  *.*, will find the first name on the disk.
$4F     FSNEXT    Gets the next matching filename.
$56     FRENAME   Rename a file from .... to ....
$57     FDATIME   Get or set the time/date of file creation/update.


  QUICK REFERENCE CHART TO BIOS (Basic Input/Output System) (trap #13)

00      GETMPB    Gives a list of pointers to another list of pointers
                  which show what memory is reserved where.
01      BCONSTAT  Returns the status of a device (e.g keyb. RS 232 etc.)
02      CONIN     Gets a char. from an input device
03      BCONOUT   Outputs a char. to an output device.
04      RWABS     Allows reading any number of sectors from disk.
05      SETEXEC   Change an exception vector to point somewhere else.
                  You better have something valid where it points!
06      TICKAL    Returns the number of milliseconds between system
                  timer calls. (No, I don't know what use this is)
07      GETBPB    Returns the (reworked) boot sector information
08      BCOSTAT   Get the status of an output device.
09      MEDIACH   Returns whether the disk was/maybe/was not changed
0A      DRVMAP    Returns a bit map of available drives
0B      KBSHIFT   -1 returns the current setting of the special keys
                  Also can be used to set these (Alt,Shifts,Control,
                  Caps lock, r and L mouse buttons)

        You may notice that a lot of these calls (and some of the XBIOS
ones) mirror the Gemdos ones. This is because Gemdos, which is the
interface between user and operating system) calls these functions in
its turn. The BIOS and XBIOS can be thought of as the interface between
GEM and the actual machine itself.


           THE XBIOS (Extended BIOS) CALLS (Trap #14)

$00     INITMOUS   Sets up the way the mouse movements are read
$01     SSBRK      Simply points to an RTS. Forget it.
$02     PHYSBASE   Returns address of the screen being displayed.
$03     LOGBASE    Returns address of screen being written to.
Normally these would be the same, but it is possible to display
one screen, while drawing/redrawing another and then change over.
$04     GETREZ     Returns current resolution (0=low 1=med 2=high)
$05     SETSCREEN  Allows setting of any or all of the following:
                   resolution, physbase, logbase. Beware: when you
                   change the resolution, GEM stays as it was!
$06     SETPALETTE Allows setting of a new color palette.
$07     SETCOLOR   Allows changing of just one color.
$08     FLOPRD     Access a disk by side/track/sector.
$09     FLOPWR     Write to the disk as above
$0A     FLOPFMT    Format a track on the disk. Lots of parameters.

$0C     MIDIWS     Output a whole string through the midi port
$0D     MFPINT     Initialise one of the MFP interrupts
$0E     IOREC      Get pointer to a buffer param block
$0F     RSCONF     Sets the RS 232 parameters.
$10     KEYTBL     Point to a new keyboard layout.
$11     RANDOM     Returns a random number (16 million possibles)
$12     PROTOBT    Create a disk boot sector (read up on it first)
$13     FLOPVER    Verify (after formatting)
$14     SCRDMP     Dumps current screen to printer
$15     CURSCONF   Set cursor params (show/hide/flash/steady/flash rate)
$16     SETTIME    Sets both the time and date in the keyboard chip.
$17     GETTIME    Gets time/date from the keyboard processor
$18     BIOSKEYS   Resets the keyboard table (see KEYTBL)
$19     IKBDWS     Send commands to the (intelligent) keyboard
$1A     JDISINT    Disable one of the MFP interrupts
$1B     JENABINT   Enable one of the MFP interrupts
$1C     GIACCESS   Allows access to the sound chip registers
$1D     OFFGIBIT   Bits of port A can be reset with this command
$1E     ONGIBIT    Set bits in port A (set=one=ON, reset=0=OFF)
$1F     XBTIMER    Set up one of the timers.
$20     DOSOUND    Get/set pointer to string of sound commands
$21     SETPRT     Set/get printer configuration
$22     KBDVBASE   Pointer to a list of pointers for devices
$23     KBRATE     Set/get keyboard delay and repeat rate
$24     PRTBLK     Output screen to printer with many options.
$25     WVBL       Wait for Vertical blank. Returns when vbl occurs
$26     SUPEXEC    A different way to get into Supervisor mode.
$27     PUNTAES    Not valid in TOS in ROM