Last edited · 1 revision  

 


Below is the current reference document that describes the Rc/Pilot+ language.          
 
Lower case versions of the commands are also supported  
 
A:{var}{,var}{,...}          - Accept input
B:expr                       - Deallocate block of memory
B:var=expr                   - Allocate block of memory
C:var=expr                   - Compute
C:$var=$sexpr                - String expressions
E:                           - End subroutine/program
F:var                        - Read EF lines
I:var=expr                   - Read input port
J:*label                     - jump to labeled line
J:expr                       - Computed jump
J:expr,*label{,*label},{...} - On-goto style J
K:value{,value}{,...}        - Output values as ASCII
M:text{,text}{,$var}{,...}   - Match
N:text                       - Equivalent to TN
O:port,expr                  - Write to output port
Q:                           - Quit to OS
R:text                       - Remark
S:var=addr                   - Read byte from memory
S:addr,expr{,expr},{,...}    - Write byte to memory
T:text                       - Type output
U:*label                     - call subroutine
U:expr                       - Computed call
U:expr,*label,...            - On-goto style U
V:var=[var|$var]             - Return address of var's data
Y:text                       - Equivalent to TY
@:var=addr{,expr}            - Call ML subroutine
 
Command Aliases (Command aliases can be used in place of the single-char commands to make more readable source):
  Accept           A
  Alloc            B
  Dealloc          B
  Compute          C
  Let              C
  End              E
  Return           E
  Flags            F
  Inport           I
  Jump             J
  ASCII            K
  Match            M
  No               N
  Outport          O
  Quit             Q
  Remark           R
  Peek             S
  Poke             S
  Type             T
  Call             U
  Varptr           V
  Yes              Y
  Usr              @
 
Line format:
[*label] command{cond}:operands
  cond = Y | N | (expression) | (scomp)
  scomp = $var [ < | > | <= | >= | <> | = ] [ $var | "text" ]
 
Numeric expressions allow: +, -, *, /, &, |, ^, <, <=, >, >=, =, <>, (, )
   Special characters in numeric expressions:
     #var           - Numeric variable (# is optional)
     $var           - will produce the address of the strings data
     $hex           - Hex constant, first character after $ must be 0-9 (ex. $0c000)
     %binary        - Binary constant, only 1, 0, and _ are allowed (ex. %1010_0101)
 
   functions allowed in expressions:
     asc($var)        - ascii value of first char of string
     ef(0)            - read state of EF pins
     fre(0)           - amount of unallocated memory
     heap(0)          - amount of free heap memory
     inp(port)        - read input port
     len($var)        - length of string
     peek(address)    - read byte from memory
     rnd(range)       - random number, 0-(range-1)
     val($var)        - numeric value of string
 
string expressions:
  term { + term }{ + term }{...}
  term = "text"
         $var
         #var                - Implicit s(#var)
         c(expr)             - Character corresponding to expr, like BASIC CHR$
         l($var,len)         - Left portion of string, like BASIC LEFT$
         m($var,pos,len)     - Middle portion of string, like BASIC MID$
         r($var,len)         - Right portion of string, like BASIC RIGHT$
         s(expr)             - expr as ASCII, like BASIC STR$
         o($var)             - Convert to lowercase
         u($var)             - Convert to uppercase
         t($var)             - Trim leading spaces
         w($var)             - Get first word, ignores leading whitespace
         n($var)             - Get string starting from 2nd word
 
Notes:
  Special characters in T operands:
   \e       - output ESC
   \r       - output CR
   \n       - output LF
   \t       - output TAB
   \b       - output BELL
   \char    - output char, used to output special characters
   {expr}   - output value of numeric expression
   #var     - output value of integer variable
   $var     - output value of string variable
   \        - as last character on line will suppress auto CR/LF
 
 
  M will set $MATCH to matched text, $LEFT to text before match,
    and $RIGHT to text after match
 
  M can use text or string variables as search options