Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagenone
titleRST 20H, DEFW $D2
IN:
     IX = memory handle
     B = explicit bank
     H = explicit page

OUT, if call successful:
     Fc = 0, OK

OUT, if call failed:
     Fc = 1
          A = RC_FAIL, failed to allocate memory


Registers changed after return:
     ..BCDEHL/IXIY same
     AF....../.... different

Notes

...

Since a memory page
are
is on a 256 byte
boundaries
boundary, the L register is ignored.
OS_Axp might be useful for applications; when properly allocating 512 bytes or more contiguous memory area. The first page is allocated with OS_Mal. Next pages are allocated with OS_Axp specifying B and H+1 (and more...).

Bugs

IX memory handle is not verified.
 Refer to explicit memory allocation for further informations. 

Related calls

OS_Bix, Bind in extended address
OS_Box, Restore bindings after OS_Bix
OS_Fc, Select fast code (fast bank switching)
OS_Mal, Allocate memory
OS_Mcl, Close memory (free memory pool)
OS_Mfr, Free (previously allocated block) memory
OS_Mgb, Get current bank binding in segment
OS_Mop, Open memory (allocate memory pool)
OS_Mpb, Set new bank binding in segment
OZ_Mgb, Get current bank binding in segment
OZ_Mpb, Set new bank binding in segment