System variables and low RAM
===========#==#=======#===============================================#=====
----------------------|TT MFP Vectors |-----
===========#==#=======#===============================================#=====
$00000140.L|RW|TTMFP00|GPI 0 |TT
$00000144.L|RW|TTMFP01|GPI 1 |TT
$00000148.L|RW|TTMFP02|SCC-DMA Controller |TT
$0000014C.L|RW|TTMFP03|Ring Indicator SCC B |TT
$00000150.L|RW|TTMFP04|Timer D (RS232 baud rate generator) |TT
$00000154.L|RW|TTMFP05|Timer C (SCC TRxCB) |TT
$00000158.L|RW|TTMFP06|Reserved, GPI 4 |TT
$0000015C.L|RW|TTMFP07|SCSI DMA Controller |TT
$00000160.L|RW|TTMFP08|Timer B |TT
$00000164.L|RW|TTMFP09|Send Error |TT
$00000168.L|RW|TTMFP10|Send buffer empty |TT
$0000016C.L|RW|TTMFP11|Receive error |TT
$00000170.L|RW|TTMFP12|Receive buffer full |TT
$00000174.L|RW|TTMFP13|Timer A |TT
$00000178.L|RW|TTMFP14|TT Clock (MC146818A) |TT
$0000017C.L|RW|TTMFP15|TT-SCSI Drive Controller NCR 5380 |TT
===========#==#=======#===============================================#=====
----------------------|SCC Interrupt Vectors |-----
===========#==#=======#===============================================#=====
$00000180.L|RW| - |SCC Port B Transmit Buffer Empty |SCC
$00000184.L|RW| - |Unused |SCC
$00000188.L|RW| - |SCC Port B External Status Change |SCC
$0000018C.L|RW| - |Unused |SCC
$00000190.L|RW| - |SCC Port B Receive Character Available |SCC
$00000194.L|RW| - |Unused |SCC
$00000198.L|RW| - |SCC Port B Special Receive Condition |SCC
$0000019C.L|RW| - |Unused |SCC
$000001A0.L|RW| - |SCC Port A Transmit Buffer Empty |SCC
$000001A4.L|RW| - |Unused |SCC
$000001A8.L|RW| - |SCC Port A External Status Change |SCC
$000001AC.L|RW| - |Unused |SCC
$000001B0.L|RW| - |SCC Port A Receive Character Available |SCC
$000001B4.L|RW| - |Unused |SCC
$000001B8.L|RW| - |SCC Port A Special Receive Condition |SCC
$000001BC.L|RW| - |Unused |SCC
| | | CORRECTED: this table was previously built |SCC
| | | densely (4 consecutive different meanings per |SCC
| | | channel). The real layout is sparse, every |SCC
| | | other slot unused, confirmed by the Atari |SCC
| | | Compendium AND Atari's own TOS 2.06/3.06 |SCC
| | | source (tos3x bios/chardev.S, sccvect: table).|SCC
===========#==#=======#===============================================#=====
----------------------|Exception Crash Save Area |-----
===========#==#=======#===============================================#=====
$00000380.L|RW|PRCLIVE|Validates crash page, if $12345678 |
$00000380 to $000003CC Processor state save area
When TOS survives a crash it saves the processor state here
before displaying the bombs, so a debugger can recover it.
$380 proc_lives set to $12345678 if the save succeeded
$384 proc_dregs saved D0-D7, 32 bytes
$3A4 proc_aregs saved A0-A7, 32 bytes
$3C4 proc_enum the exception number that caused the crash
$3C8 proc_usp saved user stack pointer
$3CC proc_stk top 16 words from the exception stack frame
Only valid when proc_lives holds the magic value. TOS clears
it once the state has been read.
From the Atari Compendium and Atari TOS common/tosvars.inc.
$00000384. |RW|PRCDREG|Saved registers D0-D7 (32 bytes) |
$000003A4. |RW|PRCAREG|Saved registers A0-A7 (32 bytes) |
$000003C4.L|RW|PRCENUM|Vector number of crash exception |
$000003C8.L|RW|PRC_USP|Saved user stack pointer |
$000003CC. |RW|PRC_STK|16 words from exception stack (32 bytes) |
===========#==#=======#===============================================#=====
----------------------|GEM Vectors |-----
===========#==#=======#===============================================#=====
$00000400.L|RW|ETVTIMR|etv_timer - GEM event timer vector |
$00000404.L|RW|ETVCRIT|etv_critic - GEM critical error handler |
$00000408.L|RW|ETVTERM|etv_term - GEM program termination vector |
$0000040C.L|RW|ETVXTRA|etv_xtra - 5 additional vectors, unused |
===========#==#=======#===============================================#=====
----------------------|System Variables |-----
===========#==#=======#===============================================#=====
$00000420.L|RW|MEMVALD|memvalid - memory conf valid if $752019F3 |
$00000420 memvalid Memory configuration valid flag
Longword. Holds $752019F3 when the memory configuration is
valid. Checked together with memval2 at $0000043A ($237698AA)
and memval3 at $0000051A ($5555AAAA).
If all three match, TOS trusts the existing memory setup and
performs a warm start. If any is wrong it runs the full memory
sizing routine, which is slower and clears RAM.
Clearing these is how a program forces a cold start.
From the Atari Compendium and Atari TOS common/tosvars.inc.
$00000424.B|RW|MEMCTRL|memcntlr - copy of $FFFF8001 %____xxxx |
| | | Bank 0 size 00:128k,01:512k,10:2Mb-------+||| |
| | | Bank 1 size 00:128k,01:512k,10:2Mb---------+| |
$00000426.L|RW|RESVALD|resvalid - resvector valid if $31415926 |
$00000426 and $0000042A resvalid and resvector
$426 resvalid longword, magic number $31415926
$42A resvector longword, address to jump to
If resvalid holds $31415926 at reset time, TOS jumps through
resvector very early in the reset sequence, before most of the
system is initialised.
This is the standard hook for reset-resident code. The routine
must be extremely careful: almost nothing is set up yet.
From the Atari Compendium and Atari TOS common/tosvars.inc.
$0000042A.L|RW|RESVECT|resvector - system reset bailout vector |
$0000042E.L|RW|PHYSTOP|phystop - physical top of ST RAM |
$0000042E to $00000436 Memory extent variables
$42E phystop longword, physical top of ST RAM
$432 _membot longword, lowest address available to the heap
$436 _memtop longword, highest address available to the heap
phystop is the real end of ST RAM as found by the memory
sizing routine. _membot and _memtop bracket the area GEMDOS
will allocate from, so they exclude the screen buffer and any
memory TOS has reserved for itself.
Alternative RAM (TT RAM, fast RAM) is tracked separately by
ramtop at $000005A4 and ramvalid at $000005A8.
From the Atari Compendium and Atari TOS common/tosvars.inc.
$00000432.L|RW|_MEMBOT|_membot - bottom of TPA (user memory) |
$00000436.L|RW|_MEMTOP|_memtop - top of TPA (user memory) |
$0000043A.L|RW|MEMVAL2|memval2 - validates memcntlr if $237698AA |
$0000043E.W|RW|_FLOCK |flock - if <>0, VBL floppy routine is off |
$0000043E flock Floppy and DMA lock
Word. Set to a non-zero value before touching the DMA or FDC
registers directly, and clear it again afterwards.
While flock is non-zero the vertical blank floppy routine
leaves the hardware alone. If it is left clear, the VBL can
deselect the drive or disturb a transfer part way through.
This is the single most important variable to get right when
writing directly to the floppy hardware.
From the Atari Compendium and Atari TOS common/tosvars.inc.
$00000440.W|RW|SEEKRAT|seekrate - floppy step rate %______xx | | | | 0:6ms 1:12ms 2:2ms 3:3ms (WD1772)----------+| |
$00000440 seekrate Floppy drive step rate
Word. Sets the step rate for BOTH floppy drives.
0 = 6 ms
1 = 12 ms
2 = 2 ms
3 = 3 ms (default)
These values are written straight into the low two bits of a
WD1772 Type I command, so they are the chip's own encoding.
IMPORTANT: these are WD1772 values. The WD1770 uses 6, 12, 20
and 30 ms for the same four encodings, so values must never be
carried between the two chips.
On the Atari 3 ms is the normal setting. 2 ms works but gives
less reliable seeks in practice.
TOS declares this as _seekrate at $440 in common/tosvars.inc.
Values from the Atari Compendium, cross-checked against the
WD1772 command encoding.
$00000442.W|RW|TIMR_MS|_timr_ms - system timer calibration, ms |
$00000442 _timr_ms System timer period
Word. The interval between system timer ticks, in
milliseconds. Normally 20, giving the 50 Hz tick that drives
the GEM event timer.
Not the same as the 200 Hz counter at $000004BA, which is
driven directly by MFP Timer C.
From the Atari Compendium and Atari TOS common/tosvars.inc.
$00000444.W|RW|FVERIFY|_fverify - if <>0, verify floppy writes |
$00000444 _fverify Floppy write verify flag
Word. When non-zero, every floppy write is read back and
compared. When zero, no verification is done.
Verification roughly doubles write time. TOS defaults it on.
From the Atari Compendium and Atari TOS common/tosvars.inc.
$00000446.W|RW|BOOTDEV|_bootdev - default boot drive |
$00000446 _bootdev Boot device
Word. The device the system was booted from.
0 = A: 1 = B: 2 = C: and so on
Hatari writes this directly during machine setup
(src/stMemory.c: STMemory_WriteWord(0x446, nBootDrive)),
commented "Boot up on A(0) or C(2)".
TOS declares it as _bootdev at $446 in common/tosvars.inc.
Meaning from the Atari Compendium.
$00000448.W|RW|PALMODE|palmode - 0:NTSC(60Hz), else PAL(50Hz) |
$00000448 palmode Video standard flag
Word. Zero indicates NTSC (60 Hz) video, any other value
indicates PAL (50 Hz).
Reflects the state of the sync mode register at $FFFF820A
bit 1, which is set from the country code in the OS header.
From the Atari Compendium and Atari TOS common/tosvars.inc.
$0000044A.B|RW|DEFSHFT|defshiftmd - default video resolution |
$0000044C.B|RW|SSHIFTM|sshiftmd - copy of $FFFF8260 %_____xxx | | | | 0:low 1:medium 2:high resolution----------+|| |
$0000044C sshiftmd Shifter mode shadow
Byte. A copy of the hardware shift mode register at
$FFFF8260, kept so software can read the current resolution
without touching the hardware.
0 = low 320x200, 4 planes
1 = medium 640x200, 2 planes
2 = high 640x400, 1 plane
The related variable defshiftmd at $0000044A holds the
resolution to use at the next reset.
From the Atari Compendium and Atari TOS common/tosvars.inc.
$0000044E.L|RW|V_BAS_A|_v_bas_ad - screen base address |
$0000044E _v_bas_ad Logical screen address
Longword. The address of the logical screen, the buffer that
drawing operations write into.
Before TOS 1.06 this had to be on a 256 byte boundary, since
the ST video base register has no low byte. From TOS 1.06 and
on an STE or later it can be any even address.
The physical screen, the one the shifter is actually reading,
is set by the video base registers at $FFFF8201, $FFFF8203 and
$FFFF820D. The two can point at different buffers, which is
how double buffering works.
From the Atari Compendium and Atari TOS common/tosvars.inc.
$00000452.W|RW|_VBLSEM|vblsem - if >0, VBL routine is executed |
$00000452 to $0000045E Vertical blank control
$452 vblsem word, 0 disables all VBL processing, 1 enables
$454 nvbls word, number of slots in the VBL handler list
$456 _vblqueue longword, pointer to the list of handlers
$45A colorptr longword, palette to load at the next VBL
$45E screenpt longword, screen base to set at the next VBL
The VBL queue is an array of nvbls longword pointers. A zero
entry is skipped, so installing a handler means finding a free
slot and writing your routine's address into it.
colorptr and screenpt are one-shot: if non-zero at VBL time,
the value is used and the variable is cleared. That gives a
tear-free way to change palette or screen base.
From the Atari Compendium and Atari TOS common/tosvars.inc.
$00000454.W|RW|_NVBLS |nvbls - number of VBL routines |
$00000456.L|RW|VBLQUEU|_vblqueue - pointer to list of VBL routines |
$0000045A.L|RW|COLORPT|colorptr - palette to load at next VBL |
$0000045E.L|RW|SCREENP|screenpt - video RAM base for next VBL |
$00000462.L|RW|VBCLOCK|_vbclock - count of VBL interrupts |
$00000462 and $00000466 Vertical blank counters
$462 _vbclock longword, VBLs actually processed
$466 frclock longword, VBLs that occurred
frclock counts every vertical blank. _vbclock counts only
those where processing was allowed to run, so the difference
between them is the number of VBLs blocked by vblsem.
Note the wiki label FRCLOCK matches Atari's own name; the
Atari Compendium calls the same variable _frlock.
From the Atari Compendium and Atari TOS common/tosvars.inc.
$00000466.L|RW|FRCLOCK|frclock - count of unblocked VBL interrupts |
$0000046A.L|RW|HDVINIT|hdv_init - hard disk initialisation vector |
$0000046A to $0000047E Hard disk vectors
$46A hdv_init initialisation routine
$46E swv_vec called on a monitor resolution change
$472 hdv_bpb used by Getbpb()
$476 hdv_rw used by Rwabs()
$47A hdv_boot JSRed through to boot from hard disk
$47E hdv_mediach used by Mediach()
All longwords. A value of zero means no hard disk driver is
installed for that function.
These are the standard hook points a hard disk driver patches
during boot. swv_vec is the odd one out: it is called when the
system detects the monitor has been changed between colour and
monochrome.
From the Atari Compendium and Atari TOS common/tosvars.inc.
$0000046E.L|RW|SWV_VEC|swv_vec - resolution change vector |
$00000472.L|RW|HDV_BPB|hdv_bpb - hard disk Getbpb vector |
$00000476.L|RW|HDV_RW |hdv_rw - hard disk read/write vector |
$0000047A.L|RW|HDVBOOT|hdv_boot - hard disk boot vector |
$0000047E.L|RW|HDVMEDC|hdv_mediach- hard disk media change vector |
$00000482.W|RW|CMDLOAD|_cmdload - if <>0, load COMMAND.PRG at boot |
$00000482 _cmdload Command shell load flag
Word. If non-zero at boot, the system attempts to load and run
COMMAND.PRG from the root of the boot drive instead of going
straight to the desktop.
Set by a boot sector or an AUTO folder program that wants to
replace the shell.
From the Atari Compendium and Atari TOS common/tosvars.inc.
$00000484.B|RW|CONTERM|conterm - console attributes %____SBRK | | | | Bconin returns shift status--------------+||| | | | | System bell 0:off,1:on--------------------+|| | | | | Key repeat 0:off,1:on----------------------+| | | | | Key click 0:off,1:on------------------------+ |
$00000484 conterm Console attribute bits
Byte. A bit array controlling several console behaviours:
Bit 3 Cause Bconin() to return the shift status in the
high word of its return value
Bit 2 Enable system bell
Bit 1 Enable key repeat
Bit 0 Enable key click
Bit 3 is the useful one for anything reading the keyboard
directly: with it set, Bconin() returns the state of the
shift, control and alternate keys alongside the character.
The byte at $00000485 immediately after is reserved.
TOS declares this as _conterm at $484 in common/tosvars.inc,
described there as the attribute vector for console output.
Bit meanings from the Atari Compendium.
$00000485.B|RW| - |Reserved |
$00000486.L|RW|TRP14RT|trp14ret - trap #14 return address, unused |
$0000048A.L|RW|CRITRET|criticret - critical error handler return |
$0000048E. |RW|_THEMD |themd - first memory descriptor (16 bytes)|
$0000048E and $0000049E Memory descriptors
$48E themd first memory descriptor, 16 bytes
$49E _md longword, space for an additional descriptor
A memory descriptor block describes one contiguous region
GEMDOS may allocate from:
long m_link pointer to the next descriptor, 0 if last
long m_start start address of the region
long m_length length in bytes
long m_own owner process, 0 if free
On a machine with alternative RAM there are two descriptors,
one for ST RAM and one for TT RAM, chained through m_link.
From the Atari Compendium and Atari TOS common/tosvars.inc.
$0000049E.L|RW|___MD |_md - space for additional descriptor |
$000004A2.L|RW|SAVPTR |savptr - pointer to BIOS register save area|
$000004A2 savptr BIOS register save area pointer
Longword. Points to the buffer the BIOS uses to save its
internal registers when re-entered.
Because the BIOS is not re-entrant, a routine that calls BIOS
functions from inside an interrupt must give it a separate
save area: allocate /2 bytes/, point savptr at it, make the
call, then restore savptr. Otherwise the interrupted call's
saved state is overwritten.
From the Atari Compendium and Atari TOS common/tosvars.inc.
$000004A6.W|RW|_NFLOPS|nflops - number of floppy drives attached |
$000004A6 _nflops Number of floppy drives
Word. The number of floppy drives actually connected, 0, 1
or 2.
This is the variable to test for a second physical drive.
_drvbits at $000004C2 always shows both A and B set when any
floppy is present, because of virtual drive swapping.
From the Atari Compendium and Atari TOS common/tosvars.inc.
$000004A8.L|RW|CONSTAT|con_state - vector for screen output |
$000004A8 and $000004AC Console state
$4A8 con_state longword, vector to the current console
output routine
$4AC save_row word, temporary store for the cursor row
con_state is switched between several internal routines as the
console works through a VT-52 escape sequence, so its value
depends on how much of a sequence has been received.
save_row holds the cursor row while an ESC-Y cursor
positioning sequence is being decoded, since the row arrives
before the column.
From the Atari Compendium and Atari TOS common/tosvars.inc.
$000004AC.W|RW|SAVEROW|save_row - temporary cursor line storage |
$000004AE.L|RW|SAVCTXT|sav_context- exception processing save area |
$000004B2. |RW|_BUFL |bufl - 2 GEMDOS buffer list heads(8bytes)|
$000004B2 bufl GEMDOS buffer list heads
Two longwords, 8 bytes total.
$4B2 pointer to the data sector buffer list
$4B6 pointer to the FAT and directory sector buffer list
Each points to a chain of buffer control blocks GEMDOS uses to
cache disk sectors. Walking these chains is how disk cache
utilities find and flush TOS's own buffers.
From the Atari Compendium and Atari TOS common/tosvars.inc.
$000004BA.L|RW|_HZ_200|hz_200 - 200 Hz system clock counter |
$000004BA _hz_200 200 Hz system counter
Longword. Increments 200 times a second, driven directly by
MFP Timer C. Free running from power on.
The most useful timing reference available without touching
hardware: read it, do the work, read it again and subtract.
Resolution is 5 ms.
Also commonly used as a random number seed.
From the Atari Compendium and Atari TOS common/tosvars.inc.
$000004BE.L|RW|THE_ENV|the_env - default environment string |
$000004C2.L|RW|DRVBITS|_drvbits - bit map of mounted drives |
$000004C2 _drvbits Connected drive bitmap
Longword. One bit per drive letter:
Bit 0 = A:, bit 1 = B:, through to bit 25 = Z:
A set bit means that drive exists.
Note: if at least ONE floppy drive is connected, BOTH the A
and B bits are always set. This is because of virtual drive
swapping, where a single physical drive answers as both A and
B with a disk change prompt. Testing bit 1 does not tell you
whether a second physical drive is fitted; use nflops at
$000004A6 for that.
From the Atari Compendium and Atari TOS common/tosvars.inc.
$000004C6.L|RW|DSKBUFP|_dskbufp - pointer to 1K disk buffer |
$000004C6 and $000004CA Disk buffer and autoexec path
$4C6 _dskbufp longword, pointer to a 1K disk buffer
$4CA _autopath longword, pointer to the AUTO folder path
The 1K buffer at _dskbufp is used by TOS for disk operations
and is also borrowed by some graphics routines. It is safe to
use as scratch space between disk calls, but not across one.
_autopath points to the GEMDOS path specification of the
directory programs are loaded from at boot.
From the Atari Compendium and Atari TOS common/tosvars.inc.
$000004CA.L|RW|AUTOPAT|_autopath - pointer to autoexec path |
$000004CE. |RW|VBLLIST|_vbl_list - 8 VBL routine pointers (32 bytes) |
$000004EE.W|RW|DUMPFLG|_dumpflg - screen dump flag |
$000004EE and $000004F0 Screen dump control
$4EE _dumpflg word, screen dump flag
$4F0 prtabt word, printer abort flag
_dumpflg is initialised to $FFFF. The ALT-HELP screen dump
code sets it to 0 while a dump is in progress and back to
$FFFF when finished, so setting it to 0 yourself prevents a
dump starting.
Note: the Atari Compendium calls the variable at $4EE
_prt_cnt. Atari's own TOS source calls it _dumpflg, which is
the name used here.
From the Atari Compendium and Atari TOS common/tosvars.inc.
$000004F0.W|RW|_PRTABT|prtabt - printer abort flag |
$000004F2.L|R-|SYSBASE|_sysbase - pointer to start of OS |
$000004F2 _sysbase Pointer to the operating system
Longword. Points to the start of TOS in memory, which begins
with the OS header structure:
Offset Size Field Meaning
$00 word os_entry BRA.S to the reset handler
$02 word os_version TOS version number
$04 long reseth pointer to the reset handler
$08 long os_beg base address of the OS
$0C long os_end end of ST-RAM used by the OS
$10 long os_rsv1 reserved, default UI entry point
$14 long os_magic GEM memory usage parameter block
$18 long os_date TOS date
$1C word os_conf PAL flag and country code
$1E word os_dosdate TOS date in GEMDOS format
$20 long os_root BDOS quick pool pointer (1.2+)
$24 long os_kbshift pointer to the shift state (1.2+)
$28 long os_run pointer to current basepage(1.2+)
$2C long reserved (1.2+)
The last four fields only exist from TOS 1.2 onward. Check
os_version before reading them.
os_version is BCD: $0102 is TOS 1.02, $0404 is TOS 4.04.
CONFLICT on os_date format: the Atari Compendium gives it as
$YYYYMMDD. EmuTOS include/biosdefs.h comments it as BCD
MMDDYYYY. Not resolved here.
EmuTOS note: EmuTOS puts the ASCII signature 'ETOS' in the
final longword at offset $2C, where real TOS leaves it
reserved. That is a reliable way to detect EmuTOS.
Structure from the Atari Compendium and EmuTOS
include/biosdefs.h. Hatari reads this variable at
src/gemdos.c to locate the OS.
$000004F6.L|RW|SHELL_P|_shell_p - pointer to shell |
$000004F6 to $000004FE OS pointers
$4F6 _shell_p longword, shell process pointer
$4FA end_os longword, end of the OS in RAM
$4FE exec_os longword, OS entry point
_shell_p allows a shell process to be installed which is
entered when the current program terminates. Normally unused.
exec_os is jumped through once operating system initialisation
is complete, normally pointing at the AES startup.
From the Atari Compendium and Atari TOS common/tosvars.inc.
$000004FA.L|R-|_END_OS|end_os - pointer to end of OS in RAM |
$000004FE.L|R-|EXEC_OS|exec_os - pointer to OS entry point |
$00000502.L|RW|SCR_DMP|scr_dump - pointer to screen dump routine |
$00000502 to $00000512 Printer and auxiliary vectors
$502 scr_dump called when ALT-HELP is pressed
$506 prt_stat check status of the PRN: device
$50A prt_vec output a byte to the PRN: device
$50E aux_stat check status of the AUX: device
$512 aux_vec output a byte to the AUX: device
All longwords. The four printer and auxiliary vectors are used
by Prtblk(), so replacing them redirects printer output
without patching GEMDOS.
Atari's own source names the last four prv_lsto, prv_lst,
prv_auxo and prv_aux.
From the Atari Compendium and Atari TOS common/tosvars.inc.
$00000506.L|RW|PRTSTAT|prt_stat - pointer to prv_lsto |
$0000050A.L|RW|PRT_VEC|prt_vec - pointer to prv_lst |
$0000050E.L|RW|AUXSTAT|aux_stat - pointer to prv_auxo |
$00000512.L|RW|AUX_VEC|aux_vec - pointer to prv_aux |
$00000516.L|RW|PUN_PTR|pun_ptr - pointer to pun_info if AHDI |
$00000516 pun_ptr AHDI partition information
Longword. Points to a PUN_INFO structure maintained by AHDI,
Atari's hard disk driver, describing the mounted partitions.
The structure begins:
word puns number of drives supported, including
floppies (maximum 16)
then pun[16] one byte per drive:
bits 0-2 physical ACSI unit
bit 7 set if the drive is not
present
then start[16] longword starting sector of each
partition
A null pointer means AHDI is not loaded.
This is a driver structure rather than hardware, so its exact
layout depends on the AHDI version in use. Treat the above as
indicative.
TOS declares it as _pun_ptr at $516 in common/tosvars.inc with
the comment "if AHDI, pointer to pun_info". Structure from the
Atari Compendium.
$0000051A.L|RW|MEMVAL3|memval3 - memory conf valid if $5555AAAA |
$0000051E. |RW|BCONSTA|bconstat_vec - 8 input status vectors(32 bytes)|
$0000051E to $0000057E BIOS device vector tables
Four tables of eight longwords each:
$51E bconstat_vec input status routines
$53E bconin_vec input routines
$55E bcostat_vec output status routines
$57E bconout_vec output routines
Indexed by BIOS device number:
0 = PRT printer
1 = AUX RS-232
2 = CON console (screen and keyboard)
3 = MIDI
4 = IKBD keyboard controller
5 = RAW console without VT-52 processing
6 and 7 unused on most machines
Replacing an entry redirects that device's I/O. This is how
serial port drivers and screen accelerators hook in.
From the Atari Compendium and Atari TOS common/tosvars.inc.
$0000053E. |RW|BCONIN |bconin_vec - 8 input vectors (32 bytes) |
$0000055E. |RW|BCOSTAT|bcostat_vec - 8 output status vectors(32bytes)|
$0000057E. |RW|BCONOUT|bconout_vec - 8 output vectors (32 bytes) |
$0000059E.W|R-|LNGFRAM|_longframe - if <>0, CPU uses long stack frames|
$0000059E _longframe Processor stack frame format
Word. Zero means the processor uses short (68000) exception
stack frames; any other value means long (68010 and above)
frames.
This matters to any exception handler that inspects the stack:
the offset to the saved PC differs between the two formats.
Testing this variable is the correct way to handle both,
rather than assuming the CPU type.
From the Atari Compendium and Atari TOS common/tosvars.inc.
$000005A0.L|R-|P_COOKI|_p_cookie - pointer to cookie jar |1.06+
$000005A0 _p_cookie Cookie jar pointer
Longword. Points to the cookie jar, a table of longword pairs
describing installed hardware and software features.
Each entry is two longwords: a four character tag and a value.
The list ends with an entry whose tag is zero, where the value
gives the total number of slots allocated.
Common tags include _CPU, _FPU, _SND, _MCH, _VDO, _FLK and
_IDT. A null pointer means no cookie jar exists, which is the
case before TOS 1.06.
Present from TOS 1.06 onward.
From the Atari Compendium and Atari TOS common/tosvars.inc.
$000005A4.L|RW|_RAMTOP|ramtop - top of alternative (Fast) RAM |TT,F
$000005A8.L|RW|RAMVALD|ramvalid - validates ramtop if $1357BD13 |TT,F
$000005AC.L|RW|BELHOOK|bell_hook - vector for system bell |1.06+
$000005AC and $000005B0 Sound hooks
$5AC bell_hook vector jumped through to sound the bell
$5B0 kcl_hook vector jumped through for key clicks
Both longwords. The key click routine is entered with the
scancode of the key just pressed, so a replacement can vary
the click by key.
Replacing these is the supported way to change or silence the
system sounds without patching the BIOS.
Present from TOS 1.06 onward.
From the Atari Compendium and Atari TOS common/tosvars.inc.
$000005B0.L|RW|KCLHOOK|kcl_hook - vector for keyclick |1.06+
===========#==#=======#===============================================#=====
----------------------|STBook |-----
===========#==#=======#===============================================#=====
$00000889.B|RW|LCDPSHD|Shadow of LcdPowerControl ($FFFF827F) |STB
===========#==#=======#===============================================#=====
Magic validation values, collected for reference:
memvalid $420 = $752019F3
resvalid $426 = $31415926
memval2 $43A = $237698AA
memval3 $51A = $5555AAAA
ramvalid $5A8 = $1357BD13
proc_lives $380 = $12345678
flock ($43E) must be non-zero before any direct FDC or DMA access, so
the VBL floppy routine does not deselect the drive or disturb the DMA
mid-transfer. Clear it again afterwards.
Sources: addresses and labels from Atari's own TOS source
(th-otto/tos1x, common/tosvars.inc), cross-checked against Hatari,
EmuTOS (bios/tosvars.S) and The Atari Compendium Appendix B. Sizes are
inferred from address spacing and the Compendium; the byte-versus-word
calls on memcntlr, defshiftmd and sshiftmd are judgement rather than
documented. Read-only marks reflect convention, not hardware
enforcement.