Rapid Bull is a basic-like language. It is the rewritten version of Lasic, and produces much better code than its predecessor. It also has more features already, with 4 data types, subs and functions, local variables, function parameters (well, one per function), and automatic assembling and linking.
The language:
Four types: Int, Byte, Word and Float (And long=int and single=float)
Literal numbers including floating-point numbers like 1.5
Eight operators, in order of precedence:
- (unary minus]
= < >
* /
+ -
Use parentheses to force the expression to be evaluated in a certain order.
Note that a division always returns a float.
Comparision operators returns 1 or 0 for true or false, so you can do this: a = b = c. (The generated code for the IF statement is still good!)
Variables must be declared before they are used (dim name[, name] as type)
Highly optimized (except for one small case which will be fixed) control flow contructs:
IF <condition> [.. ELSE] .. ENDIF
REPEAT .. UNTIL <condition>
WHILE <condition> .. WEND
Comments (start with ' and goes to the end of the line)
Inline asm (starts with ! and goes to the end of the line, must start at the start of a line.)
Subs: procedures with no return value. They can't be called where you expect a result from them (ie a = Sub() is not allowed)
Functions: procedures with a return value
Local variables in subs and functions, shadows global ones
ONE parameter (or none) per sub or function
Compiler options:
-o: Compile and assemble, but do not link
-a: Compile to asm only
If no option is specified, an asm file, an object file, and an executable file will be generated. You can't specify an option without a filename.
Last edited by Trond on Sun Jan 14, 2007 7:01 pm, edited 1 time in total.