JAL manual - language - types

previous up next


bit

The type bit has two values, on (true, high) and off (false, low). In certain contexts (if and while statements) an expression of type bit is required.

examples
   var bit a = high
   var byte x
   a = x > 5


byte

A byte is an 8-bit integer with modulo 256 semantics. Negative values are interpreted modulo 256 so (for expressions of the type byte) -1 and 255 are two notations of the same value.

examples
   var byte n = 1, m = 257
   if n == m then
      -- will be executed!
   end if


universal

Another type, universal, is available at compile time only. An expression which is not forced to be of a certain type is of the type universal. Such expressions can involve only constants, literals and build-in oprators and are evaluated by the compiler as signed integers of at least 32 bits.

examples
   const xtal = 10_000_000
   const mips = xtal / 4

previous up next