F$All64

From NitrOS-9
Jump to: navigation, search
Allocate 64 Dynamically allocates 64-byte blocks of memory
OS9 F$All64 103F 30

Entry Conditions

X base address of the page table; 0 = the page table has not been allocated

Exit Conditions

A block number

X base address of the page table

Y address of the block

Error Output

CC carry set on error

B error code, if any

Additional Information

  • The Allocate 64 system call allocates the 64-byte blocks of memory by splitting pages (256-byte sections) into four sections.
  • NitrOS-9 uses the first 64 bytes of the base page as a page table. This table contains the page number (most significant byte of the address) of all pages in the memory structure. If Register X passes a value of zero, the call allocates a new base page and the first 64-byte memory block.
  • Whenever a new page is needed, a Request System Memory system call (F$SRqMem) executes automatically.
  • The first byte of each block contains the block number. Routines that use the Allocate 64 call should not alter this byte.
  • The following diagram shows how seven blocks might be allocated:
  Any Memory Page   Any Memory Page
Base Page -->      
  Page Table
(64 bytes)
  X
Block 4
(64 bytes)
  X
Block 1
(64 bytes)
  X
Block 5
(64 bytes)
  X
Block 2
(64 bytes)
  X
Block 6
(64 bytes)
  X
Block 3
(64 bytes)
  X
Block 7
(64 bytes)

krnp2