Users Guide: Network Microcontroller Supplement User Manual

High-Speed Microcontroller Users
Guide: Network Microcontroller
Supplement
194
rom_malloc_dirty
Description: void rom_malloc_dirty(
int blocksize); /* requested memory blocksize */
The rom_malloc_dirty function allocates memory from the heap but does not clear the allocated memory. It returns 0 in the
accumulator if successful, nonzer
o otherwise. This function is exported by the DS80C400 silicon software and also serves as
the default mallocdirty in the function redirect table.
rom_free
Description: void rom_free(
int blockhandle); /* blockhandle of memory to free. */
The rom_free function frees a block of memory with a blockhandle that had previously been allocated with rom_malloc or
rom_malloc_dirty. This function r
eturns 0 in the accumulator if successful, nonzero otherwise. It is exported by the DS80C400
silicon software and also serves as the default free in the function r
edirect table.
rom_deref
Description: void rom_deref(
int blockhandle); /* blockhandle of memory to derefence */
The rom_deref function dereferences a memory blockhandle into an absolute address pointer. It r
eturns 0 in the accumulator
if successful, nonzero otherwise. This function is expor
ted by the DS80C400 silicon software and also serves as the default
deref in the function redirect table.
rom_getfreeram
Description: void rom_getfreeram(void);
The rom_getfreeram function returns the amount of memory that is still available in the heap. This function returns 0 in the
accumulator if successful, nonzer
o otherwise. It is exported by the DS80C400 silicon software and also serves as the default
getfreeram in the function redirect table.
INPUT DESCRIPTION OUTPUT DESCRIPTION
-
ACC
R3:R0
Return value (= 0 for success)
Amount of free memory
Example: ROMCALL rom_getfreeram
INPUT DESCRIPTION OUTPUT DESCRIPTION
R3:R2 blockhandle
ACC
DPTR0
Return value (= 0 for success)
Pointer to memory block
Example: MOV R3, #high(MEMHANDLE)
MOV R2, #low(MEMHANDLE)
ROMCALL rom_deref
INPUT DESCRIPTION OUTPUT DESCRIPTION
R3:R2 blockhandle ACC
Return value (= 0 for success)
Example: MOV R3, #high(MEMHANDLE)
MOV R2, #low(MEMHANDLE)
ROMCALL rom_free
INPUT DESCRIPTION OUTPUT DESCRIPTION
R3:R2 blocksize
ACC
R3:R2
DPTR0
Return value (= 0 for success)
Memory block handle
Pointer to memory block
Example: MOV R3, #high(MEMLENGTH)
MOV R2, #low(MEMLENGTH)
ROMCALL rom_malloc_dirty
Maxim Integrated