JAL manual - summary

previous up next

Jal is an algol-style meekly typed block scoped language. It looks a lot like Pascal, but if you call it a 'microcontroller Ada' or a 'structured Basic' that's fine with me.

The Jal build-in types are bit and byte for run-time variables and 32 bit 'universal integer' for compile-time calculations. Expressions are roughly the same as in C, but an assignment is not an expression. The available operators are: + - / * % ! & | ^ < < >> == != < = and >=. Priority is as in C and () can be used for grouping. There are no restrictions on the complexity of expressions. The user can define operators, but the priorities are fixed and the build-in operators can not be re-declared.

Variables must be declared before use and can either be tied to a particular address or allocated by compiler using the static-stack algorithm. A declaration can be put wherever a statement can. The scope is from the declaration to the end of the smallest enclosing block.

Procedures and functions can have parameters. Each parameter has a name, a type, a mode (in, out or in-out) and optionally a default. Parameter passing is either by reference or by value-result (copying), whichever suits the compiler best. (Currently this is value-result except for volatile parameters which are passed as a pointer to their access routines.) A parameters can have a default, in which case no actual needs to be supplied. Function calls can be used in expressions, procedures can be called as stand-alone statements. When no parameters are supplied the () in a procedure or function call can be omitted.

The statements are: assignment, if-then-elsif-else, for, loop and procedure call. The else part of an if-then-else is optional. A loop can have a count (for 10 loop ... ), a condition (while ... loop ...) or be unconditional (forever loop ...).

Put and get routines can be used to construct an interface which behaves like a variable. This is for instance used in jpic to hide the port value buffer which is needed to avoid the read-modify-write problem which is inherent in the PIC architecture.

In-line assembly is supported using the microchip syntax.

A CPU core simulator is build into the compiler. It is used to test the compiler. It might also be usefull for debugging and testing stand-alone code.

The compiler generates both a .hex file which can be downloaded directly to the target a .asm file which can be used with the microchip development tools.

previous up next