Instructions

The instructions PicForge is been created for resembling the more possible to the Basic and therefore to constitute a language to the more possible high-level.
All the syntaxes are described in this paragraph; however a help is always active on line on the bar of state of the form of the editor. Every qual' turns an education comes followed by a space it activates a string that points out the necessary fields to the completion of the command.


   Arithmetic operators

· [/]       division 

· [*]      multiplication  

· [**]       multiplication that returns only the tallest Byte for varying Byte  

· [+]       sum  

· [-]       subtraction  

· [AND]    logical operator  

· [XOR]    logical operator  

   Varying

Il dimensionamento delle variabili avvieve tramite l'istruzione DIM e possono essere di 4 tipi:

· Bit      1 Bit       es: Dim MYvar As Bit oppure Dim Myvar As PORTB,1  

· Byte      1 Byte      es: Dim MYvar As Byte   

· Word      2 Byte      es: Dim MYvar As Word  

· Long      3 Byte      es: Dim MYvar As Long  


   Constant numerical and string

le costanti sono riconosciute tali se precedute da :
 

· [b']      precedes a binary string               es: b'0001010'  

· [.]      precedes a decimal number             es:.128  

· [0x]       precedes a number hex                es: 0xAA  

· [' ]       pex precedes a comment or it contains a value ASCII    es: 'a'  

· ["]       the quotation marks contain a string          es: "hello"  



   Use of the expressions - examples

Dim Myvar0 As Word
Dim Myvar1 As Byte
Dim Myvar2 As Byte
Dim Myvar3 As Byte
Dim Myvar4 As Byte

Myvar0 = Myvar1 + Myvar2   |
Myvar0 = Myvar0 * Myvar3   | = Myvar0 = ( Myvar1 + Myvar2 ) * Myvar3 / .2   
Myvar0 = Myvar0 / .2      |


ReAD 0, Myvar0      |
ReAD 1, Myvar1      |
ReAD 2, Myvar2      | = Myvar3 = ((ReAD 0) + (ReAD 1) + (ReAD 2)) / .3
Myvar3 = Myvar0 + Myvar1   |
Myvar3 = Myvar3 + Myvar2   |
Myvar3 = Myvar3 / .3      |


   PicForge command admitted inside an expression and formality


OWin      es: Myvar3 = ((OWin) + (ReAD 1) + (ReAD 2))    
Input      es: Myvar3 = ((Input) + (ReAD 1) + (ReAD 2)) 
Rnd      es: Myvar3 = ((Input) + (Rnd) + (ReAD 2)) 
Capture    es: Myvar3 = ((Capture 1) + (ReAD 1) + (ReAD 2)) / .3
ECapture   es: Myvar3 = ((ECapture 1) + (ReAD 1) + (ReAD 2)) / .3
GP2in      es: Myvar3 = ((ECapture 1) + (GP2in 0) + (ReAD 2)) / .3
Get      es: Myvar3 = ((ECapture 1) + (GP2in 0) + (Get .5)) / .3
Peek      es: Myvar3 = ((Peek .1) + (GP2in 0) + (Get .5)) / .3
Read
PulseIN   es: Myvar3 = ((Peek .1) + (PulseIN pin,0) + (Get .5)) / .3 
HID Receive   es: Myvar3 = ((Peek .1) + (PulseIN pin,0) + (HID Receive)) / .3 
USART Receive   es: Myvar3 = ((Peek .1) + (PulseIN pin,0) + (USART Receive)) / .3
Glcd Read   es: Myvar3 = ((Glcd Read) + (PulseIN pin,0) + (USART Receive)) / .3


 

It is possible to visualize on the list assembler the development of the expressions,  

selecting "print developement of the expression" in the menu tools  

 

 
   All the fields that compose an command have to be separate from a space or from a comma.