This is an old revision of the document!
Table of Contents
Intrinsic Statements
10LC includes some new intrinsic, or built-in, statements. Currently three of them are defined:
__Delay
- standard delay routine, causes a real-time delay in the execution of a program__Fill
- fill a range of memory with a specific byte__FillRamp
- fill a range of memory with a byte whose value keeps increasing (and resets to0x00
after0xFF
)
__Delay
The __Delay
statement causes statement execution to pause for a specified amount of time. Internally, a special program is called and a counter value is decremented and tested against zero. If the value is greater than zero, the value is decremented and tested again, etc. until the value reaches zero and processing resumes.
The syntax of the statement is: __Delay <count>;
The counter value is a 32-bit value and a value of 25 is about 1 second.
__Delay 50; // Delay For About 2 Seconds
__Delay
The __Delay
statement is causes execution to pause for a specified amount of time. Internally, a counter value is decremented and tested against zero. If the value is greater than zero, the value is decremented and tested again, etc. until the value reaches zero and processing resumes.
The syntax of the statement is: __Delay <count>;
The counter value is a 32-bit value and a value of 25 is about 1 second.
__Delay 50; // Delay For About 2 Seconds
Implementation
The intrinsic statements are implemented via a custom program (Program #99, __IP__P99
) that is created and added to the compiled file near the end of the compilation phase. Its implementation is as follows:
Program __IP__P99; Alias Command=RegF; // First Parameter - Intrinsic Command Alias FromOrDelay=RegE; // Second Parameter - Start Of Fill Range or Delay Counter/Value Alias To=RegD; // Third Parameter - End Of Fill Range Alias FillChar=RegC; // Fourth Parameter - Character to use for Fill/FillRamp If Command == 1 Goto Delay; // RegF == 1 - Delay If Command >= 2 Goto Fill; // RegF == 2 - Fill, RegF == 3 - FillRamp Goto End; :Delay // Delay Routine --FromOrDelay; If FromOrDelay > 0 Goto Delay; Goto End; :Fill // Fill/FillRamp Routine Write @ FromOrDelay = FillChar; // Write Fill Character Into Address ++FromOrDelay; // Increment Address If Command == 3 Goto RampInc; // If RampFill, Goto RampInc :FillReturn If To >= FromOrDelay Goto Fill; // If Not At End OF Fill Range, Goto Fill Goto End; :RampInc ++FillChar; // Increment Fill Character If FillChar > 0xFF Goto WrapChar; // If Character Greater Than 0xFF, Goto WrapChar Goto FillReturn; // Go Back To Fill Routine :WrapChar FillChar = 0; // Reset Fill Character To Zero Goto FillReturn; // Go Back To Fill Routine :End // End Of Program 99