Page 1 of 1

PB5.11 compiler misses an undeclared variable

Posted: Mon Jun 17, 2013 2:25 pm
by User_Russian
Why the compiler misses an undeclared variable?

Code: Select all

EnableExplicit
EnableASM

mov ebx, *Point

Re: PB5.11 compiler misses an undeclared variable

Posted: Mon Jun 17, 2013 4:12 pm
by jassing
I thought it was just me -- but I've been seeing this w/o using ASM.

Re: PB5.11 compiler misses an undeclared variable

Posted: Mon Jun 17, 2013 4:16 pm
by blueb
Using 5.11 x86 version...

I get a compiler error (Assembler Error - undefined symbol 'Point')

Re: PB5.11 compiler misses an undeclared variable

Posted: Mon Jun 17, 2013 5:24 pm
by Josh
User_Russian wrote:Why the compiler misses an undeclared variable?

Code: Select all

EnableExplicit
EnableASM

mov ebx, *Point
Maybe you should have first a look to the name conventions for ASM

Re: PB5.11 compiler misses an undeclared variable

Posted: Tue Jun 18, 2013 1:39 am
by PB
> Maybe you should have first a look to the name conventions for ASM

Josh is right. Using inline ASM doesn't follow the standard rules. See here (italics mine):
PureBasic manual wrote:You have several rules to closely follow if you want to include ASM in a BASIC code :
- The used variables or pointers must be declared before to use them in an assembler keyword

Re: PB5.11 compiler misses an undeclared variable

Posted: Wed Jun 19, 2013 9:43 pm
by tinman
PB wrote:> Maybe you should have first a look to the name conventions for ASM

Josh is right. Using inline ASM doesn't follow the standard rules. See here (italics mine):
PureBasic manual wrote:You have several rules to closely follow if you want to include ASM in a BASIC code :
- The used variables or pointers must be declared before to use them in an assembler keyword
I think that is the OP's point - he does not declare *Point but he does not get an error, which is contrary to the expected behaviour (and your quote from the user manual). Or at least that is what it looks like he is saying.

Re: PB5.11 compiler misses an undeclared variable

Posted: Thu Jun 20, 2013 1:48 am
by PB
As far as I know, using Inline ASM throws out all the normal rules of the IDE/compiler.
It just compiles it as it is. So not declaring the variable won't throw an error at all;
it'll just cause FASM to throw an assembler compile-time error, as shown.

Re: PB5.11 compiler misses an undeclared variable

Posted: Thu Jun 20, 2013 6:01 pm
by Zach
Which seems fine. It would be redundant to add ASM syntax checking to the IDE code, since FASM will already verify problems, no ?