12-03-2004, 09:10 PM
12-03-2004, 09:45 PM
Power of, yeah, unless the left operand is a constant, that will be evaluated at compile-time.
You could just use "expression shl 1" if the left operand is an integer. FB doesn't do the "^ powerof2constant" to "shl" optimization yet.
You could just use "expression shl 1" if the left operand is an integer. FB doesn't do the "^ powerof2constant" to "shl" optimization yet.
12-03-2004, 10:07 PM
Quote:"expression shl 1"
Thanks, but what doesnt appear to work....
Code:
4 shl 1
12-03-2004, 10:21 PM
Er, nm me.. value ^ 2 is equal to value * value, not value * 2 (same as shl 1).
12-03-2004, 10:40 PM
O_o
So.... There isnt an asm type optimisation for "^"?
So.... There isnt an asm type optimisation for "^"?
12-03-2004, 11:17 PM
No, it must be implemented as a library, but expr ^ 2 could be optimized to expr * expr by the compiler, i will see what i can do.
12-03-2004, 11:22 PM
Quote:you know, loads of different cultures mixed, a "thumbs up!" can mean "hey, it looks good" in some countries or "hey babe, lets f*ck".
i hope for your health that this was not an invitation to have intercourse or something whatever...
12-03-2004, 11:24 PM
Hey, 3 smiles, you must be kidding now, right??
Heh..
Heh..
12-06-2004, 12:33 AM
I'm trying to compile some old code, a bit spaghetti'ish, to really proof-test the compiler.
I've found that the compiler does not understand some QB stuff:
---
The compiler complains with, stopping at the comma:
Also with this line, stopping at the ":" (error: expected ","):
---
I had to change it for:
to make it work. Plus LINE INPUT throws a "?" on screen, when it shouldn't. Not a single LINE INPUT variable$ worked in the code, it needs a string literal and a ";" before the variable to work.
---
QB accepted:
Which closed every open file. FB doesn't, it complains about "expression expected".
---
I also got something you should document (I dunno if you have done it already): If your BAS filename has a "-" the assembler fails with
My BAS file was called OPA-OPA.BAS.
The ASM lines that are not working are those:
Error messages:
I renamed the file to OPAOPA.BAS and it compiled without problems.
Awesome work! Those are just minor issues and the code was like 120 Kb and written 6 years ago... Really UGLY code.
I've found that the compiler does not understand some QB stuff:
---
The compiler complains with, stopping at the comma:
Code:
NEXT x, y
Also with this line, stopping at the ":" (error: expected ","):
---
Code:
LINE INPUT sn$: sn$ = LCASE$(sn$)
I had to change it for:
Code:
LINE INPUT ">"; sn$: sn$ = LCASE$(sn$)
to make it work. Plus LINE INPUT throws a "?" on screen, when it shouldn't. Not a single LINE INPUT variable$ worked in the code, it needs a string literal and a ";" before the variable to work.
---
QB accepted:
Code:
CLOSE
Which closed every open file. FB doesn't, it complains about "expression expected".
---
I also got something you should document (I dunno if you have done it already): If your BAS filename has a "-" the assembler fails with
Code:
junk at the end of line, first unrecognized character is `-'
My BAS file was called OPA-OPA.BAS.
The ASM lines that are not working are those:
Code:
.globl fb_opa-opa_entry
.globl FB_OPA-OPA_ENTRY
fb_opa-opa_entry:
FB_OPA-OPA_ENTRY:
Error messages:
Code:
opa-opa.asm: Assembler messages:
opa-opa.asm:10: Error: junk at end of line, first unrecognized character is `-'
opa-opa.asm:11: Error: junk at end of line, first unrecognized character is `-'
opa-opa.asm:12: Error: invalid character '_' in mnemonic
opa-opa.asm:13: Error: invalid character '_' in mnemonic
I renamed the file to OPAOPA.BAS and it compiled without problems.
Awesome work! Those are just minor issues and the code was like 120 Kb and written 6 years ago... Really UGLY code.
12-06-2004, 12:49 AM
Dark prevail... try SAL and SAR insead, if rel's not trying to mislead me *GLARE*