Micro Virtual - R gives access to some utility commands like reset , clear , .parse , etc by default, However to enable scripting you need to use the prog command. Which prints the confirmation message.
Programming in Micro Virtual - R is very simple and straightforward.
STEP 1 : Use the prog command to enable scripting
STEP 2 : Enter Micro Symbolic Script line by line
STEP 3 : Use the /prog keyword to exit programming mode
STEP 4 : Use the run command to run your script and view the output.
NOTE : Only one script can be loaded at a time, hence using prog will wipe the previously entered script. You can also use erase command to clear program buffer without entering programming mode.
The different notation used represent a system operation or a token
DOT NOTATION : Keywords with a "." prefix represent script operations.
KEYWORDS : These symbols represent Arithmetic , Logical or System Command Handlers.
ARITHMETIC AND LOGICAL
add : Addition two values
sub : Subtraction of two values
mul : Multiplication of two values
div : Division of two values
mod : Get modulo of two values
rshift : Bitwise Shift Right
lshift : Bitwise Shift Left
and : Bitwise AND
or : Bitwise OR
not : Compliment a value
xor : Bitwise XOR
.inc : Increment a Value
.dec : Decrement a Value
STACK OPERATIONS
.define : Define a Variable
.assign : Assign value to a variable
.copy : Copy a variable into another
.delete : Delete a variable and free stack space
BRANCHING AND PROGRAM FLOW
.if : Conditional IF Statement
.fi : END-IF Statement
.block : Define a code block
.endblk : Indicates the end of a block
.goto : Execute a per-defined code block
.loop : Conditional Loop
TERMINAL IO
.print : Print the value of a variable or accumulator in decimal or ascii binary
TIMING AND DELAYS
sleep : Delay execution of next instruction by X (Minimum Delay 100ms)
ACCUMULATOR DATA TRANSFER
.load : Load the Primary or Secondary Accumulator
.store :Store the lower byte of Primary or Secondary Accumulator
SYSTEM CALLS - (CANNOT BE USED IN PROGRAMMING MODE)
clear : Clear Serial Terminal
reset : Runtime Hardware Reset
.parse : Parse a string of characters to get underlying byte-code
prog : Programming Enable
run : Start Script Execution
erase : Erase loaded program from memory
Micro Symbolic Script supports Immediate Operations , Accumulator Driven Operations & Stack Operations.
The different flags listed below are used across add , sub , mul , div , or , and , xor , mod , not , rshift , lshift commands
.data : Represents operating on two user-defined symbols and their values
.value : Represents Immediate Operands
.result : Represents Primary Accumulator
.xword : Represents Secondary Accumulator
&d : Decimal Formatting
&b : ASCII Binary Formatting
&d&b : Decimal followed by ASCII Binary
&
.read : Read from PORT and store in a user defined variable
.write : Write from user defined variable to PORT
.wrdata : Update PORT data with an immediate value.
precedes : Represents "LESS THAN"
exceeds : Represents "GREATER THAN"
neq : Represents "NOT EQUALS TO"
equ : Represents "EQUALS TO"