System

calloc View Source

Allocates memory for a given number of elements of a given size (that is, BC * A bytes total), then fills it with zeros.

Inputs

A

Size of element

BC

Number of elements

Outputs

A

Error code (on failure)

IX

First byte of allocated and zeroed memory (on success)

Z

Set on success, reset on failure

contextSwitch View Source

Triggers a context switch early. This will transfer control from your thread to another and eventaully return to yours with interrupts enabled.

formatMem View Source

Formats memory in preparation for memory allocation.

Notes

This function will deallocate all allocated memory.

free View Source

Frees a previously allocated section of memory

Inputs

IX

Pointer to first byte of section

loadLibrary View Source

Loads a library into memory, or references one that may already be loaded.

Inputs

Z

Set on success, reset on failure

DE

Pointer to full path of library

malloc View Source

Allocates the specified amount of memory.

Inputs

BC

Length of requested section, in bytes

Outputs

A

Error code (on failure)

IX

First byte of allocated memory (on success)

Z

Set on success, reset on failure

memSeekToEnd View Source

Move IX to the end of the memory section it points to.

Inputs

IX

Pointer to anywhere in a section of allocated memory

Outputs

IX

Pointer to last byte of section

memSeekToStart View Source

Move IX to the beginning of the memory section it points to.

Inputs

IX

Pointer to anywhere in a section of allocated memory

Outputs

IX

Pointer to first byte of section

memset View Source

Sets the value of an entire allocated section of memory.

Inputs

A

Value to set

IX

Pointer to anywhere in allocated section

reassignMemory View Source

Reassigns a given block of memory to the specified thread ID.

Inputs

A

Thread ID for new owner

IX

Pointer to any location within the target block.

reboot View Source

Restarts the device.

shutdown View Source

Shuts off the device.

suspendDevice View Source

Turns off the screen, enters low power mode, and halts system operation until the ON key is pressed.