Skip to main content

GEMDOS FUNCTIONS by Richard Karsmakers

Originally  published in ST NEWS Volume 1 Issue  4,  launched  on 
September 7th, 1986.

The  GEMDOS functions in the Atari ST look very much  like  MS-DOS 
routines.  Especially the UNIX functions of MS-DOS can be found in 
GEMDOS, whereas the hardware-specific functions - ofcourse - won't 
be found.
All GEMDOS functions can be supplied with parameters on the  stack 
and  can be called from assembler using the TRAP #1  command.  You 
must  know that D0 and A0 will be changed at any time if  you  use 
GEMDOS functions. The return value will be found in D0, whereas A0 
contains  the pointer to the stack-address on which  the  function 
number is located - most of the time, anyway.
You  can  read  most specific things about  the  GEMDOS  functions 
(detailed  decriptions) can be found in the book "ST Intern"  from 
Data Becker (Merowingestraße 30,  4000 Düsseldorf,  West-Germany). 
The  authors are Klaus Gerits,  Lothar English and Rolf  Brückmann 
(ST Intern,  ISBN 3-89011-119-X, price about DM 80,-), but here we 
have just included a small summary of GEMDOS  functions,  together 
with a very brief description.
Number:     Name:          Brief description:
------------------------------------------------------------------

 00         TERM           Terminate program
 01         CONIN          Get character from console
 02         CONOUT         Output character to screen
 03         AUXILIARY
              INPUT        Get character from RS232
 04         AUXILIARY
              OUTPUT       Send character to RS232
 05         PRINTER OUTPUT Send character to Centronics
 06         RAWCONIO       Get character and send it to screen
 07         DIRECT CON IN
              WITHOUT ECHO Get character from console
 08         CON IN WITHOUT
              ECHO         Get character from console
 09         PRINT LINE     Output several characters to screen
 0A         READLINE       Input several characters from console
 0B         CONSTAT        Check if keyboard buffer is filled
 0E         SETDRV         Define current drive
 10         CONOUT START   Give console status
 11         PRTOUT STAT    Give Centronics status
 12         AUXIN STAT     Check for character availability on
                             RS232
 13         AUXOUT STAT    Check if RS232 is able to send or not
 19         CURRENT DISK   What is the current drive?
 1A         SET DISK
              TRANSFER
              ADDRESS      Set buffer for disk operations
 20         SUPER          Toggle supervisor mode
 2A         GET DATE       Get the system date
 2B         SET DATE       Set the system date
 2C         GET TIME       Get the system time
 2D         SET TIME       Set the system time
 2F         GET DTA        Get buffer for disk operations
 30         GET VERSION
              NUMBER       Get the TOS version number
 31         KEEP PROCESS   Terminate program. Read the exact
                             difference with 01 in ST Intern
 36         GET DISK FREE
              SPACE        Get free space on disk
 39         MKDIR          Create a folder
 3A         RMDIR          Remove (delete) a folder
 3B         CHDIR          Change current directory (folder)
 3C         CREATE         Create file
 3D         OPEN           Open file
 3E         CLOSE          Close file
 3F         READ           Read file
 40         WRITE          Write file
 41         UNLINK         Delete file
 42         LSEEK          Move filepointer
 43         CHMOD          Change mode (file attributes)
 45         DUP            Get handlenumber
 46         FORCE          Manipulate handlenumber
 47         GETDIR         Set current directory
 48         MALLOC         Allocate memory
 49         MFREE          Free memory that was allocated
 4A         SETBLOCK       Allocate specific memory
 4B         EXEC           Load a program
 4C         TERM           Terminate program
 4E         SFIRST         Check for filename
 4F         SNEXT          Check for filename continued
 56         RENAME         Rename a file
 57         GSDTOF         Check date/time

Disclaimer
The text of the articles is identical to the originals like they appeared in old ST NEWS issues. Please take into consideration that the author(s) was (were) a lot younger and less responsible back then. So bad jokes, bad English, youthful arrogance, insults, bravura, over-crediting and tastelessness should be taken with at least a grain of salt. Any contact and/or payment information, as well as deadlines/release dates of any kind should be regarded as outdated. Due to the fact that these pages are not actually contained in an Atari executable here, references to scroll texts, featured demo screens and hidden articles may also be irrelevant.