symsyn‎ > ‎


C   :   'This is a character string'
D   :   40 '  '                          | a character string of 40 spaces
C2  :   X'ABCD1234567890'                | a string of hexadecimal digits
X   :   3 1000                           | three word array with a value of 1000
X1  :   0XABCDEF                         | a word with a hexadecimal value of ABCDEF
X2  :   0b100101                         | a word with a binary value of 100101
Y   :   @C                               | a word with a value equal to the address of C
Y1  :   #C                               | a word with a value equal to the size of C

CEQ = X                                  | CEQ will use the address of X but be treated as a
                                         | character 

 X                                       | set X to zero
 + X                                     | increment X by 1
 + 0XA9822B Y                            | add hex value to Y
 X  Y                                    | move X to Y
 X:3:4 Y                                 | move 4 bits starting with bit number 3 to Y
 C   $S                                  | move the character string C to the ansi string $S
 $S   C   #C                             |  move (size of C) characters from ansi string $S to C  
 C D N                                   | move N characters from C to D
 +   'ABC'   $S                          | add character string 'ABC' to the end of ansi string $S
 #$S   X                                 | move the size of string $S to X
 find   'A'   $R   Z                     | find the position of 'A' in string $R, store in Z
 wait  'EV'   $T                         | wait for the event 'EV' to be posted and store data in $T
 'hello world'   []                      | display 'hello world' on the console (stdout)
 maketext 'tfile1'  tfh                  | create a text file named 'tfile1' , tfh will be the file handle 
 'hello world'  [tfh]                    | move (write) 'hello world' to the text file
 close tfh                               | close file

 X.I  Z                                  | move the Ith word in array X to Z

 datetime   $R                           | set string $R to system date and time
 buildabuick X Y                         | not yet implemented

| the following if clause

   if i LT 1000
       + 5 x

| becomes a 'while' clause with the addition of a 'goif' instruction

   if i LT 1000
       + 5 x

| and becomes an iterative 'for' loop with the addition of an index variable

   if i LT 1000
       + 5 x
        + i

|  the following prog (T1) will cause 99 progs to run
    symsyn 'R T1'            | command to Symsyn to run T1
    delay 100                | sleep for 100 milliseconds
    go lp  

| the following prog (benchmark) will time a loop and display the result on the console

 datetime strt               | system date and time to strt

 if I LT 100000000
    + I

 datetime stopp              | system date and time to stopp
 msbetween strt stopp rslt   | milliseconds between strt and stopp
 ~ rslt $s                   | convert binary to decimal string
 $s []                       | display result

| the following prog (readtext) will read a text file and display it on the console

 opentext 'sorttext.txt' fid   
 if ioresult eq 0            | ioresult = -1 at end of file
     [fid] $s                | move a record from the file to the string
     $s []                   | display string on the console

| the square root of the sum of the squares

x : 2 0                      | array (vector) x ( 2 members each a value of 0 )
 3 x.0                       | first member = 3
 4 x.1                       | second member = 4
 vmul x x x                  | multiply each member of array x by same in x, store in x
 vsum x y                    | add all the members of array x place total in word y
 sqrt y z                    | square root of y in z (rounded) = 5

| DES encryption

key :  x'0e329232ea6d0d73'
data : x'8787878787878787'

 edes key data               | encrypt data with key 
 data $s                     | move data to string
 unpackhex $s $s             | unpack
 $s []                       | output result - 0000000000000000