Atari ST series Technical Reference Manual page 32

Hide thumbs Also See for ST series:
Table of Contents

Advertisement

long
m__length;
struct pd
*m__own;
};
The Getmpb() function fills the designated Memory Pa­
rameter Block with initial system values. At the beginning,
the memory allocated list pointer is 0, since no memory
blocks have been allocated by programs yet. The memory
free list pointer contains the address of a memory descriptor
that specifies the entire Transient Program Area from system
variables membot to memtop. For more information on these
system variables, see Appendix K, memory locations 1074
($432) and 1078 ($436).
The next system call reads or sets exception vectors. Ex­
ception vectors are a collection of addresses stored in low
memory reserved for the use of the 68000 processor or the
Operating System. Whenever an exception occurs, the pro­
cessor goes into supervisor mode and program execution is
diverted through the appropriate vector. For example, when
a program tries to execute an illegal instruction, an exception
occurs and program execution resumes at the address pointed
to by exception vector 4, which starts at memory location 16.
The 68000 processor supports many kinds of exceptions,
including interrupts, TRAP instructions, and several kinds of
error conditions. One error of particular interest is called a
bus error. On the ST, a bus error occurs when a program tries
to access memory locations below 2048 ($800), or the hard­
ware registers above $FF8000 from user mode. That's why
this call is necessary: It allows you to change the exception
vectors located in protected memory without switching into
supervisor mode. The format for this call is
int vecnum;
long vecaddr, oldaddr;
oldaddr = Setexec(vecnum, vecaddr);
where vecnum is the vector number to read or change, and
vecaddr is the new address to be stored in that vector. If ve­
caddr contains a - 1 (OxFFFF), it indicates that you want only
to read the current address stored in the vector, not change
it. In either case, the address stored in the vector before the
call was made is returned in the variable oldaddr. Your pro­
24
CHAPTER 2
/* size of mem block (bytes) */
/* ptr to MD owner's process-
descriptor [NULL] */

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents