EasyManua.ls Logo

Atari ST series - Page 273

Atari ST series
420 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Ptermres
Terminate and Stay Resident
Ptermres() Opcode = 49 ($31)
Like the Pterm() and PtermO() functions, this one terminates the current
process, closes all open files, and exits to the calling program, usually the
GEM Desktop. It allows a return code to be passed to the calling program
as well. Unlike the others, however, Ptermres() doesn't automatically clear
the memory space used by the process. All or part of the program may
remain loaded in memory even after the process terminates. TSR programs
can "steal" the vectors used by exception handlers, such as the system
timer, vertical blank interrupt, or the keyboard Alternate-HELP screen
dump routine, to create hot-key applications. This function is mainly of in
terest to machine language programmers, since the startup modules sup
plied with C language compilers automatically call one of the terminate
functions when the main() function exits.
C macro format
long keepsize;
int retcode;
Ptermres(keepsize, retcode);
Machine language format
move.w
move.l
move.w
trap
Inputs
retcode
keepsize
Results
None
See also
PtermO(), Pterm()
#retcode, - (sp)
#keepsize, - (sp)
#$31,-(sp)
#1
word The exit code that is returned to the call
ing program.
long The number of bytes of memory to keep
resident, starting at and including the
256-byte basepage.
265