The three registers R0, R1 and R2 are the core virtual machine registers.
They are used to facilitate data entry, register addressing and programming, and related general purpose functions such as data display and address arithmetic.
The techniques described here are used to program all the registers required to make use of BitScope's programmable features.
The following data entry commands "assemble" data in R0, the Data Register:
For example, the script to enter the hex value A6 to R0 is [a6].
Address Register Programming
The following register operation commands move data between R0 and registers pointed to by the Address Registers R1 and R2. Two commands are available to initialize the Address Registers:
For example, the script to write the hex value B2 to the R1 Address Register is [b2]@ and the script to program the hex value 34 to the R2 Source Address Register is #.
General Register Programming
All other registers are programmed using the following two commands which move data between R0 and any other register addressed by R1 or R2.
For example, the script to program the hex value 0xA0 to the R4 register is @[a0]s. To move a value from register R3 to R9 it is#@ls.
The value in any register may be "printed" to the serial port to read its value:
For example, the script to print the value in R12 is [c]@p. The register's value is printed to the serial port as four characters <CR><DIGIT><DIGIT><CR>.
Increment and Decrement
Increment and decrement commands are available for the convenience of programming:
The n command can be quite convenient to write a value to range of registers. For example, to clear registers R3 and R4 use @[sns
Copyright © 2017 BitScope Designs