Topic : The ATARI Compendium
Author : Scott Sanders / JAY Software
Version : 1.25 (20/6/2003)
Subject : Documentation
Nodes : 1117
Index Size : 32614
HCP-Version : 6
Compiled on : Atari
@charset : UTF-8
@lang : en
@default :
@help : %About
@options : +g -i -t4 +y +z
@width : 100
View Ref-FilePterm0()Pterm()Ptermres() GEMDOSSyntaxVOID Ptermres( keep, retcode )
LONG keep;
WORD retcode;
Function Ptermres() terminates a process leaving a portion of the
program's TPA intact and removing the memory left from
GEMDOS's memory list.
Opcode 49 (0x31)
Availability All GEMDOSversions.
Parameters keep is the length (in bytes) of the processes' TPA to
retain in memory after exit. retcode is the code returned on
exit.
Binding move.w retcode,-(sp)
move.l keep,-(sp)
move.w #$31,-(sp)
trap #1
addq.l #8,sp
Return Value Ptermres() never returns.
Comments This function is normally used by TSRTermitate and Stay Resident programm
's to stay resident in
memory. Any files opened by the process are closed. Any
memory allocated is, however, retained. The value for keep
is usually the sum of the length of the basepage (0x100),
the length of the text, data, and bss segments of the
application, and the length of the stack. It is important to
note that the memory retained by this call may not be freed
at a later point as it is removed from the GEMDOS memory
list altogether.
See Also Pterm0(), Pterm()