Name: FreeRAMBlock
Address: G0$500C

Function: Frees up a 64Kb bank in expansion RAM for the Wheels OS.

Pass: Bank number ($01-$fe) in r6L.

Uses:
ramExpSize
($88c3).
bit masking tables at $522d-34.
expansion RAM's BAM workspace at $5045-64.
RAM BAM checksum at $5024.

Return: X = $00 (no error.), .X=$06 (BAD_BAM).

Destroyed: .A, .X, & .Y

Synopsis: This routine frees up Wheels' expansion RAM memory in 64Kb chunks by marking the RAM BAM (copy) wherever appropriate. The routine merely uses the bank value ($01-$fe) passed via r6L and calls up the toggle routine, marking the copy of the RAM BAM's corresponding entry to a value of '1', freeing it. This toggle routine is shared by the AllocRAMBlock routine. It then recomputes the RAM BAM's checksum value and stores the value back onto $5024.

See Also: AllocAllRAM, AllocRAMBlock, RamBlkAlloc.

EOF