Qbasicnews.com

Full Version: Bug Reports
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
Is it normal that ^2 is really slow?

..

because it is quite slow.
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.
Quote:"expression shl 1"

Thanks, but what doesnt appear to work....

Code:
4 shl 1
yields 8...
Er, nm me.. value ^ 2 is equal to value * value, not value * 2 (same as shl 1).
O_o

So.... There isnt an asm type optimisation for "^"?
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.
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 Smile Wink Sad whatever...
Hey, 3 smiles, you must be kidding now, right??

Heh..
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:

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 Smile and the code was like 120 Kb and written 6 years ago... Really UGLY code.
Dark prevail... try SAL and SAR insead, if rel's not trying to mislead me *GLARE*
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30