63
After the program is entered it can be downloaded to the MicroLYNX. If using
the LYNX Terminal program, this is as simple as clicking the menu item “Trans-
fer > Download”. Otherwise, the program can be copied and pasted from the
text editor to the terminal.
S t e p 4 : P r o g r a m E x e c u t i o n
When a program is executed, it will run in the sequence in which it is written.
There are basically four methods of program execution:
1]
Program executes on power-up: This is done by labeling the
program “STARTUP”. Only one program in memory can
have this label.
2]
Program executes by label: The label of the program can be
used as a keyword to execute that program by typing the
program label directly into the terminal in immediate mode.
3]
Program executes by input: An input can be defined to start
a program, this is usually accomplished by using the GO
dedicated input function.
4]
Program executes by address: This method requires the use
of the EXEC instruction. Typing “EXEC” followed by a
space and the address where the program begins will execute
the program.
S t e p 5 : P r o g r a m E d i t i n g / D e b u g g i n g
The final step in the LYNX program development process is to debug and tweak
the program to a state of perfection. Unless your program is no more advanced
than “turn the motor
x
distance and stop”, it will be a rare circumstance of a
program working perfectly the first time. This is true in any programming
language, be it BASIC, C++, Java or LYNX. There are several tools built into
the LYNX that assist the programmer in debugging. These are:
1]
Error codes.
2]
EXEC instruction modes:
EXEC <lbl/addr>,1: Trace mode, code printed to
screen as it is run.
EXEC <lbl/addr>,2: Single step mode, single steps
through program.
3]
ONER: instruction accommodates the use of a subroutine to
capture an error location.
4]
BREAK: Instruction allows the user to set break points
within a program.
These and other program debugging tools are explained in greater detail in
Appendix B:
Troubleshooting.
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from