hitec robonova - robobasic manual

RoboNova and Robobasic Intermediate Byte Code
Revision 0.1 23thJuly 2006 Introduction
This information on the Intermediate Byte code used by the is collected from t he tokenised codes downloaded from RoboBasic to the RoboNova and subsequently executed.
The RoboBASIC development environment.
The development environment comprises the following components:
Program Editor
Capability to perform Direct commands
Real time control
Downloader
Intermediate Code Builder
The Downloader is described in a separate document which shows the PC to RoboNova MR-C3024 serial command set. http://web.ukonline.co.uk/r.ibbotson/files/C3024Serial.pdf The downloader transfers the program header and the tokenised intermediate code to the External EEPROM memory on the MR-C3024. The download dialog starts at 9600 bps and shifts speed to 115K for the actual data transfer. The downloaded files are entirely self contained, and could be saved (not in Robobasic) and downloaded by a different application.
The Intermediate code builder:
Tokenizes the Program from the editor or .rsf file
Allocates variables to actual Data memory locations
Inserts actual Program EEPROM memory locations into IM Code
Replaces some Keywords with multiple tokens
The RoboScript development environment.
The RoboScript development environment is a cut down and simplified versio n of Robobasic. It generates identical intermediate code, but not as rich.
How to view the IM Code
The .bas and .rsf files stored by RoboBasic and Roboscript are in source file format and not in IM code. The converted or compiled code is not stored. The easiest way to see the code is to install a serial port monitor on the COM port used for the interface. I use the freeware:
http://www.serial-port-monitor.com/
Find the COM port used by the serial interface to the C3024, and install the monitor software on this port, before starting RoboBasic or RoboScript.
After starting Robobasic, the serial port monitor will capture all the PC to C3024 commands as described in:
http://web.ukonline.co.uk/r.ibbotson/files/C3024Serial.pdf
When the download command is invoked, then you can see the IM code.
Intermediate Code Storage in MR-C3024
The intermediate code is stored by the downloader into the external EEPROM of the controller.
The first 16 bytes of the EEPROM contain the program header:
Byte Usage 0 - 7 Program Name 8 Year 9 Month 10 Day 11 Hour 12 Minute 13 Seconds 14 Length in Bytes Low 15 Length in Bytes High
The tokenised code follows and starts at location 16 (0x10)
Intermediate Code Tokens
The following shows the tokens identified so far:
Token Value Decimal
Token Value HEX
Token Type Usage Notes
0 00 NULL 1 01 2 02 3 03 4 04
5 05 6 06 7 07 8 08
9 09 10 0A 11 0B 12 0C 13 0D 14 0E 15 0F 16 10 Literal 0 17 11 Literal 1
18 12 8 bit Literal
19 13 16 bit Literal 20 14
21 15 Byte Variable
22 16 Integer Variable 23 17 24 18 25 19 26 1A
1 byte number value follows
2 byte number value follows
1 byte number address follows
1 byte number address follows
27 1B "." BIT 28 1C 29 1D 30 1E 31 1F 32 20 33 21 Arithmetic + 34 22 Arithmetic ­35 23 Arithmetic * 36 24 Arithmetic / 37 25 38 26 Arithmetic % 39 27 Logic AND 40 28 Logic OR 41 29 42 2A Logic XOR 43 2B 44 2C Logic >> 45 2D Logic << 46 2E 47 2F 48 30 Relational < 49 31 Relational >
1 byte number address, then 1 byte number bitmap follows
for bits in integers address 2nd byte as byte at address + 1
Loading...
+ 6 hidden pages