flat assembler
Message board for the users of flat assembler.
Index
> High Level Languages > Rapid Bull C9 |
Author |
|
Plue 31 Oct 2006, 15:39
I am making a compiler for a basic-like language (programmed in PureBasic, outputs fasm-syntax assembly).
It's lacking a lot (most) functionality yet, mainly because I've focused exclusively on the code quality until now to get a solid base. Summary: Basic-like language Three variable types: Int, Float and Byte (all signed) Five operators: = + - * / Precedence levels: (* and /), then (+ and -) then (=) Use parenthesis to force operator precedence. So in a+b*c, b*c is done first, but in (a+b)*c, a+b is done first Do an assignment by typing variable = expression Declare a variable by typing DIM variablename AS TYPE The compiler is case-INsensitive and must be run from the command line. It processes the contents of input.rq IF .. ENDIF and WHILE .. WEND and REPEAT .. UNTIL The generated code for the conditionals isn't very good yet, but this will be fixed. At the moment I have also added IF .. ELSE .. ENDIF and two more operators (< and >), but the compiler is in the middle of a turmoil to implement units, automatic assembling and linking and strings, so I can't show it as it is. Please try it and tell me what you think of the generated code (except for if, while and repeat) and report any bugs you find. Download: http://home.no.net/tsg1zzn/c9.zip Forums: http://lasic.frac.dk/forum/ Some useless sample code: Code: Dim a As int dim b as int dim c as int dim d as int dim e as int dim pineapple as int dim r as byte dim g as byte Dim float As FLOAT dim goat as float a = b*(float*(c/(d*(e)))) a = 0 repeat a = a + 1 b = a until a = 50000000 while b b = b + 1 wend _________________ Roses are red Violets are blue Some poems rhyme And some don't. |
|||
31 Oct 2006, 15:39 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.