MaxBlock (SC)

This commit is contained in:
Kelvin Sherlock 2013-05-17 19:05:03 -04:00
parent 2fb4e67323
commit caa0b8b74f
3 changed files with 31 additions and 0 deletions

View File

@ -294,6 +294,29 @@ namespace MM
return mplite_maxmem(&pool); return mplite_maxmem(&pool);
} }
uint32_t MaxBlock(uint16_t trap)
{
/*
* The MaxBlock function returns the maximum contiguous space, in bytes, that you
* could obtain after compacting the current heap zone. MaxBlock does not actually
* do the compaction.
*/
/*
* on entry:
* (nothing)
*
* on exit:
* D0: function result (long word)
*
*/
Log("%04x MaxBlock()\n", trap);
SetMemError(0);
return mplite_maxmem(&pool);
}
uint32_t FreeMem(uint16_t trap) uint32_t FreeMem(uint16_t trap)
{ {
// total free memory. // total free memory.
@ -312,6 +335,9 @@ namespace MM
return mplite_freemem(&pool); return mplite_freemem(&pool);
} }
uint16_t ReserveMem(uint16_t trap) uint16_t ReserveMem(uint16_t trap)
{ {
/* /*

View File

@ -27,6 +27,7 @@ namespace MM
uint16_t BlockMove(uint16_t trap); uint16_t BlockMove(uint16_t trap);
uint32_t CompactMem(uint16_t trap); uint32_t CompactMem(uint16_t trap);
uint32_t MaxMem(uint16_t trap); uint32_t MaxMem(uint16_t trap);
uint32_t MaxBlock(uint16_t trap);
uint32_t FreeMem(uint16_t trap); uint32_t FreeMem(uint16_t trap);
uint16_t ReserveMem(uint16_t trap); uint16_t ReserveMem(uint16_t trap);

View File

@ -159,6 +159,10 @@ namespace ToolBox {
d0 = MM::StripAddress(trap); d0 = MM::StripAddress(trap);
break; break;
case 0xa061:
d0 = MM::MaxBlock(trap);
break;
// MoveHHi (h: Handle); // MoveHHi (h: Handle);
case 0xa064: case 0xa064:
d0 = MM::MoveHHi(trap); d0 = MM::MoveHHi(trap);