Download HiSoft Devpac 3 (text version) [1992] [Manual: PDF]

Transcript
This call was added in GEMDOS 0.25.
$45 - Duplicate File Handle, fjdup
Parameters:
Result:
Stack:
word: standard handle
D0.W=new handle, or error code
4
Given a handle to a standard device (0-5), this function returns another handle that can be
used to address the same device. It can also be closed without affecting the standard device
handle.
$46 - Force file handle, fjforce
Parameters:
Result:
Stack:
word: non-standard handle, word: standard handle
D0.W=0 if OK, else error code
6
This forces the standard handle to point to the same device or file as the non-standard one,
and can be used, for example, to re-direct screen output to a disk file.
$47 - Get Current Directory, d_getpath
Parameters:
Result:
Stack:
word: drive number, long: pointer to buffer
DO. W=0 if OK, else error code
8
Given a drive number (default drive=0, A:=1, B:=2 etc.) this will return the current directory
in the given buffer, in null-terminated form.
$48 - Allocate Memory, m_alloc
Parameters:
Result:
Stack:
long: number of bytes required
DO.L=address of memory allocated, or 0 if failed
6
This allocates the given amount of memory from the system pool, if available. On the TT, the
system will attempt to allocate the memory from alternate RAM if the appropriate bits in its
header are set. See under COMMENT HEAD= in the assembler section of this manual. If this bit
is not set then the RAM will be allocated from system RAM.
When a program terminates all its memory allocations are cleaned up. This call can also be
used to find the amount of free memory, if -1 is passed, in which case the size of the largest
block of system or alternative RAM is returned depending on the malloc bit in the program's
header.
$49 - Free Allocated Memory, m_free
Parameters:
Result:
Stack:
long: address of area to free
DO.W=0 if OK, else an error code
6
This frees a block of memory allocated with m_alloc or m_xalloc above.
$4A - Shrink Allocated Memory, mshrink
Parameters:
Result:
Stack:
long: length to keep, long: start address to keep, word: 0
DO. W=0 if OK, else an error code
12
This is normally used when a program starts up and releases part of the allocated memory
The Operating System
Hisoft Devpac 3
Page 187