Z88 Developers' Notes
Contents   Contents of System Calls

OS_Mop, open memory (allocate memory pool)

RST 20H, DEFB $4E

IN:

     A = memory mask arguments (several arguments OR'ed together):

          Destination segment (allocated memory addressed for segment):
          MM_S0 ($00), segment 0
          MM_S1 ($40), segment 1
          MM_S2 ($80), segment 2
          MM_S3 ($C0), segment 3

          Source of memory (to be allocated):
          MM_FIX ($02), fixed workspace (not subject to swapping)
          or
          MM_SLT ($04), explicit slot usage, mask also following:
               MC_CI ($10), internal memory
               MC_C1 ($01), card 1
               MC_C2 ($02), card 2
               MC_C3 ($03), card 3

          Allocation variations:
          MM_EXC ($10), exclusive use of bank
          MM_MUL ($20), use multiple banks

     BC = 0, always
OUT, if call successful:
     Fc = 0
     IX = memory pool handle
OUT, if call failed:
     Fc = 1
     A = error code:
          RC_NA ($06), handle not available
          RC_ROOM ($07), no room
Registers changed after return:
     A.FBCDEHL/..IY same
     .F......./IX.. different
Notes:
MM_EXC and MC_CI use the same argument bit. We don't know why, but believe its the same function (Internal & Explicit slot usage).

If only the memory segment mask are specified, it is probably default'ed to MM_MUL - for the rest of the arguments, we don't know.

MM_FIX is probably an internal usage.
 

Bugs:
 

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_Mpb, set new bank binding in segment