15 of 318
ZBasic System Library 5 ZX Microcontroller Family Data Manipulation Routines FlipBits() reverse the order of bits in a byte HiByte() extract the high byte of a value HiWord() extract the high word of a value LoByte() extract the low byte of a value LoWord() extract the low word of a value MakeDword() construct a 32-bit value from two 16-bit values MakeWord() construct a 16-bit value from two 8-bit values MakeString() construct a string from a sequence of bytes MidWord() extract the middle two bytes of a 4-byte value SetBits() set the state of specified bits in a byte Shl() shift a value to the left Shr() shift a value to the right ToggleBits() change the state of specified bits in a byte Task-related Routines CallTask prepare a task to begin execution DisableInt() disable interrupts Delay() pause a task DelayUntilClockTick() pause a task EnableInt() conditionally re-enable interrupts ExitTask() cause a task to terminate LockTask() suspend normal task switching Pause() pause a task without relinquishing control ResumeTask() cause a waiting task to resume execution RunTask() cause a specific task to run Semaphore() coordinate the use of a resource SetInterval() set the interval timer period Sleep() pause a task StackCheck() enable or disable stack checking StatusTask() determine the status of a task System.TaskHeadRoom() determine the unused space in a task’s stack TaskIsLocked() determine if a task is locked TaskIsValid() determine if a task stack is in the task list UnlockTask() resume normal task switching UpdateRTC() update RTC registers to account for missed ticks WaitForInterrupt() pause a task until an external event occurs WaitForInterval() pause a task until an interval timer expires Yield() allow another task to run Miscellaneous Routines CloseWatchDog() deactivate the watchdog timer CPUSleep() cause the CPU to go into sleep mode CRC16() compute a 16-bit CRC value CRC32() compute a 32-bit CRC value FirstTime() determine if this is the first the program has been run since downloading GetMicroTime() populate a buffer with higher precision timing information GetElapsedMicroTime() determine the elapsed time relative to previous time information IIf() select the value of one of two expressions LBound() determine the lower bound of an array LongJmp() perform a non-local goto (e.g. for exception handling) NoOp() execute a “nop” instruction OpenWatchDog() activate the watchdog timer ParityCheck() check the parity of a data byte