.\" ENVIRONMENTS: TOS
.TH "system addresses" "" "" "Technical information"
.PC
.PP
.br
The \*(OS operating system uses a number of
\*(QLmagic locations\*(QR where it stores key system variables.
By using the
.B peek
and
.B poke
routines included with \*(PN, you can alter these variables directly,
to customize \*(OS more closely to your needs and tastes.
.PP
You can safely
manipulate the address 0x0 to 0x800 only when your program is
in supervisor mode.
You can enter supervisor mode by calling the
.B gemdos
function
.BR super .
.PP
The following table gives each \*(QLmagic location\*(QR, the common
Atari mnemonic for it (should you wish to build a header to
work with these locations), the length of the system variable,
and a brief description.
.RS
.IP \fB0x400/etv_timer/long\fR
.br
Points to the timer event handler.
.IP \fB0x404/etv_critic/long\fR
.br
Points to the critical error handler.
.IP \fB0x408/etv_term/long\fR
.br
Points to routine that ends a program.
.IP \fB0x04C/etv_xtra/long\fR
.IP \fB0x420/memvalid/int\fR
.br
Check if the memory controller's configuration is valid.
.IP \fB0x424/memcntrl/int\fR
.br
Copy of configuration value in memory controller.
.IP \fB0x426/resvalid/long\fR
.br
If proper value given,
jump is made to reset routine pointed to by address
.BR 0x42A .
.IP \fB0x42A/resvector/long\fR
.br
Address of reset routine.
.IP \fB0x42E/phystop/long\fR
.br
Top of RAM.
.IP \fB0x432/membot/long\fR
.br
Points to beginning of transient program area.
.IP \fB0x436/memtop/long\fR
.br
Points to end of transient program area.
.IP \fB0x43A/memval2/long\fR
.br
This
if set properly,
declares memory configuration to be valid.
.IP \fB43E/flock/int\fR
.br
If set to a value other than zero, disk access is in progress.
.IP \fB0x440/seekrate/int\fR
.br
Set disk drive seek rate, as follows:
zero, six milliseconds; one, 12 milliseconds; two, two milliseconds; and
three, three milliseconds.
.IP \fB0x442/timr_ms/int\fR
.br
Clock rate, in microseconds.
.IP \fB0x444/fverify/int\fR
.br
If set to a value other than zero, every
disk write access is verified.
.IP \fB0x446/bootdev/int\fR
.br
Number of disk drive from which operating system was loaded.
.IP \fB0x448/palmode/int\fR
.br
If set to a value other than zero, system is in PAL mode (50 Hz);
otherwise, system is in NTSC mode.
.IP \fB0x44A/defshiftmd/int\fR
.br
If Atari shifted from monochrome to color, new resolution is set here:
zero indicates low resolution; one, medium resolution.
.IP \fB0x44C/sshiftmd/int\fR
.br
Screen resolution, as follows:
zero, low resolution; one, medium resolution; two, high resolution.
.IP \fB0x44E/v_bas_ad/long\fR
.br
Points to logical screen base.
Address always begins on a 256-byte boundary.
.IP \fB0x452/vblsem/int\fR
.br
If set to zero, vertical blank routines are not executed.
.IP \fB0x454/nvbls/int\fR
.br
Number of vertical blank routines queued for execution.
.IP \fB0x456/vblqueue/long\fR
.br
Points to the list of routines queued to be executed
during vertical blanking.
.IP \fB0x45A/colorptr/long\fR
.br
If other than zero, holds pointer to color palette to be
executed during next vertical blank.
.IP \fB0x45E/screenpt/long\fR
.br
Points to beginning of video RAM.
.IP \fB0x462/vbclock/long\fR
.br
Number of vertical blank interrupt routines.
.IP \fB0x466/frclock/long\fR
.br
Number of vertical blank routines executed.
.IP \fB0x46A/hdv_init/long\fR
.br
Points to hard-disk initialization.
.IP \fB0x46E/swv_vec/long\fR
.br
Points to routine to change screen resolution.
.IP \fB0x472/hdv_bpb/long\fR
.br
Points to fetch BIOS parameter block for hard disk.
.IP \fB0x476/hdv_rw/long\fR
.br
Points to read/write routine for hard disk.
.IP \fB0x47A/hdv_boot/long\fR
.br
Points to routine to reboot hard disk.
.IP \fB0x47E/hdv_mediach/long\fR
.br
Points to routine to handle medium change for hard disk.
.IP \fB0x482/cmdload/int\fR
.br
If set to a value other than zero, system will attempt to load file
.B command.prg
after \*(OS has been loaded.
.IP \fB0x484/conterm/char\fR
.br
Set console attributes.
This is a byte-length bit map, whose first four bits signify the following:
bit 0, toggle key click; bit 1, toggle key repeat;
bit 2, toggle bell when
.B <ctrl-G>
is typed; and bit 3, toggle returning
.B Kbshift
in bits 24-31 for the function
.BR Conin .
.IP "\fB0x48E/themd/four long\fRs"
.br
Memory descriptor filled by function
.BR Getmpb .
.IP \fB0x4A2/savptr/long\fR
.br
Pointer to save area for process registers after a BIOS call.
.IP \fB0x4A6/nflops/int\fR
.br
Number of floppy disk drives.
.IP \fB0x4AE/sav_context/long\fR
.br
Points to temporary areas used by exception-handling routines.
.IP "\fB0x4B2/bufl0/long\fR"
.br
Points to head of data sector list.
.IP "\fB0x4B2/bufl1/long\fR"
.br
Points to head of file allocation table (FAT).
.IP \fB0x4BA/hz_200/long\fR
.br
Counter for 200-Hz system clock.
.IP "\fB0x4BE/the_env/four char\fRs"
.br
Default environment string, four null characters.
.IP \fB0x4C2/drvbits/long\fR
.br
Bit map indicating connected drives:
bit zero indicates drive A, bit one indicates drive B, etc.
.IP \fB0x4C6/dskbufp/long\fR
.br
Pointer to 1,024-byte disk buffer.
.IP \fB0x4EE/prt_cnt/int\fR
.br
If set to one, a dump of the current screen is sent to the
printer port.
Dump can be aborted by typing
.B help
and
.B alt
keys simultaneously.
.IP \fB0x4F2/sysbase/long\fR
.br
Pointer to beginning of operating system.
.IP \fB0x4F6/shell_p/long\fR
.br
Pointer to global shell information.
.IP \fB0x4FA/end_os/long\fR
.br
Pointer to end of operating system.
.IP \fB0x4FE/exec_os/long\fR
.br
Pointer to start of AES.
.RE
.SH Example
The following example
.BR poke s
address
.B 0x484
to turn off the key click:
.DM
#include <stddef.h>
#include <stdlib.h>
.DE
.DM
main()
{
	pokeb(0x484L, peekb(0x484L) & ~1);
	return(EXIT_SUCCESS);
}
.DE
.SH "See Also"
.B
memory allocation, peekb, peekl, peekw, pokeb, pokel, pokew,
technical information
.R
