Next: Reentrancy, Previous: The instruction set, Up: Top
To use GNU lightning, you should include the lightning.h file that is put in your include directory by the ‘make install’ command.
Each of the instructions above translates to a macro or function call.
All you have to do is prepend jit_
(lowercase) to opcode names
and JIT_
(uppercase) to register names. Of course, parameters
are to be put between parentheses.
This small tutorial presents three examples:
• incr: | A function which increments a number by one | |
• printf: | A simple function call to printf | |
• RPN calculator: | A more complex example, an RPN calculator | |
• Fibonacci: | Calculating Fibonacci numbers |