PB5.11 compiler misses an undeclared variable

Just starting out? Need help? Post your questions and find answers here.
User_Russian
Addict
Addict
Posts: 1518
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

PB5.11 compiler misses an undeclared variable

Post by User_Russian »

Why the compiler misses an undeclared variable?

Code: Select all

EnableExplicit
EnableASM

mov ebx, *Point
jassing
Addict
Addict
Posts: 1885
Joined: Wed Feb 17, 2010 12:00 am

Re: PB5.11 compiler misses an undeclared variable

Post by jassing »

I thought it was just me -- but I've been seeing this w/o using ASM.
User avatar
blueb
Addict
Addict
Posts: 1111
Joined: Sat Apr 26, 2003 2:15 pm
Location: Cuernavaca, Mexico

Re: PB5.11 compiler misses an undeclared variable

Post by blueb »

Using 5.11 x86 version...

I get a compiler error (Assembler Error - undefined symbol 'Point')
- It was too lonely at the top.

System : PB 6.21(x64) and Win 11 Pro (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
User avatar
Josh
Addict
Addict
Posts: 1183
Joined: Sat Feb 13, 2010 3:45 pm

Re: PB5.11 compiler misses an undeclared variable

Post 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
sorry for my bad english
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: PB5.11 compiler misses an undeclared variable

Post 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
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
User avatar
tinman
PureBasic Expert
PureBasic Expert
Posts: 1102
Joined: Sat Apr 26, 2003 4:56 pm
Location: Level 5 of Robot Hell
Contact:

Re: PB5.11 compiler misses an undeclared variable

Post 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.
If you paint your butt blue and glue the hole shut you just themed your ass but lost the functionality.
(WinXPhSP3 PB5.20b14)
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: PB5.11 compiler misses an undeclared variable

Post 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.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
Zach
Addict
Addict
Posts: 1675
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

Re: PB5.11 compiler misses an undeclared variable

Post 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 ?
Post Reply