RosettaCodeData/Task/Memory-allocation/Action-/memory-allocation.action
2023-07-01 13:44:08 -04:00

14 lines
475 B
Text

CARD EndProg ;required for ALLOCATE.ACT
INCLUDE "D2:ALLOCATE.ACT" ;from the Action! Tool Kit. You must type 'SET EndProg=*' from the monitor after compiling, but before running this program!
PROC Main()
DEFINE SIZE="1000"
BYTE POINTER ptr
AllocInit(EndProg) ;required before any memory allocation
ptr=Alloc(SIZE) ;allocate memory of 1000 bytes
SetBlock(ptr,SIZE,$FF) ;fill the memory block with $FF
Free(ptr,SIZE) ;free allocated memory
RETURN