a1200   NEWS   APPS   DOCS   ABOUT
a1200
----
a1200
----
Autodocs
 Libraries:
 expansion.library
  AddBootNode
  AddConfigDev
  AddDosNode
  AllocConfigDev
  AllocExpansionMem
  ConfigBoard
  FindConfigDev
  FreeConfigDev
  FreeExpansionMem
  GetCurrentBinding
  MakeDosNode
  ObtainConfigBinding
  ReadExpansionByte
  ReadExpansionRom
  ReleaseConfigBinding
  RemConfigDev
  SetCurrentBinding
  WriteExpansionByte
Include
GuruMeditation
Docs » Autodocs » expansion.library » AllocExpansionMem

NAME

	AllocExpansionMem - allocate expansion memory

SYNOPSIS

	startSlot = AllocExpansionMem( numSlots, slotOffset )
D0 D0 D1

FUNCTION

	(Not typically called by user code)
This function allocates numslots of expansion space (each slot
is E_SLOTSIZE bytes). It returns the slot number of the
start of the expansion memory. The EC_MEMADDR macro may be
used to convert this to a memory address.
Boards that fit the expansion architecture have alignment
rules. Normally a board must be on a binary boundary of its
size. Four and Eight megabyte boards have special rules.
User defined boards might have other special rules.
If AllocExpansionMem() succeeds, the startSlot will satisfy
the following equation:
(startSlot - slotOffset) MOD slotAlign = 0

INPUTS

	numSlots - the number of slots required.
slotOffset - an offset from that boundary for startSlot.

RESULT

	startSlot - the slot number that was allocated, or -1 for error.
EXAMPLES
AllocExpansionMem( 2, 0 )
Tries to allocate 2 slots on a two slot boundary.
AllocExpansionMem( 64, 32 )
This is the allocation rule for 4 meg boards. It allocates
4 megabytes (64 slots) on an odd 2 meg boundary.
EXCEPTIONS

SEE ALSO

FreeExpansionMem()

BUGS

Comments

Name:
E-mail: Use this if you want a message if you get a response, will not be shown.
Comment:
Select correct short for:

Sanity

SCX
FC
RZR
SNT

Comments:

$VER: d0.se 1.14 Copyright © 2011-2024 Tobias Geijersson support at d0 dot se