General

The operating system (TOS) is a mixture of GEM and an Atari OS, both can completely control the system but the programmer is advised to use the GEM host facilities, although calls to the various types of utilities can be mixed. There are many reasons for using a consistent set of calls, not the least being that the programmer can write programs which are portable to other computers that contain the same operating systems. Although the writers present intention may not be to provide the program on an alternative computer system, it is wise to adhere preferably to GEM calls if possible. Those who have programs generated on older 8-bit machines, and now find that they cannot be used, will understand the need for portability.

The BIOS and BDOS use and preserve registers in a rather haphazard manner, the following may be used as a guide:

Trap #13 BIOS calls preserve d3-d7/a3-a7
Trap #14 Extended BIOS calls preserve d3-d7/a3-a7
Trap # 1 BDOS calls use d0-d4/a0-a4

The A-line routines provide access to the graphic primitives; they will not produce portable code but will give very rapid execution of graphic functions.

Lastly a word of warning. GEM was developed for use on the IBM PC, and as such ran on the Intel 8086 processor, which stores addresses in memory low byte first. Atari GEM uses the same convention in some of the tables and parameter blocks, it is a point programmers should be aware of, as a mixture of conventions of this kind is likely to cause problems.