
Code: Select all
Procedure a(var.l)
!mov eax,p.v_var ; <- not allowed :(
EndProcedure
v.l=34
a(v)
Code: Select all
Procedure a(var.l)
!mov eax,p.v_var ; <- not allowed :(
EndProcedure
v.l=34
a(v)
Code: Select all
Procedure test()
Static a
!mov [p.v_a], 4
EndProcedure
test()
Good oneTrond wrote:Code: Select all
Procedure test() Static a !mov [p.v_a], 4 EndProcedure test()
Fred just told me to look at the generated asm as if it wasn't a bug. But since it doesn't work as described in the manual I'd say it is.Psychophanta wrote:Good oneTrond wrote:Code: Select all
Procedure test() Static a !mov [p.v_a], 4 EndProcedure test()
Code: Select all
Procedure test()
Static a
!mov [s_test.v_a], 4
EndProcedure
test()
It's not about being lazy.freak wrote:The commented compiler output shows it all, if you are too lazy to look at it, we can't help you...Code: Select all
Procedure test() Static a !mov [s_test.v_a], 4 EndProcedure test()
Static variables are not on the stack but on a fixed location, like globals, so all the
p.v_var stuff is not needed there.
- It's possible to pass directly an assembly line to the assembler without being processed by the compiler by using the '!' character at the line start. This allow to have a full access to the assembler directives. When using this, it's possible to reference the local variables using the notation 'p.v_variablename' for a regular variable or 'p.p_variablename' for a pointer
Static allows to create a local persistent variable in a Procedure even if the same variable has been declared as Global in the main program.
Then I demand that this missing syntax error check is acknowledged without further discussion:Psychophanta wrote:Static variable is not a regular variable. So then the manual is correct. Only it omits how to access to static variable, nothing more, so then no bug.reference the local variables using the notation 'p.v_variablename' for a regular variable
Code: Select all
Procedure Test()
Protected Apple
!mov dword [p.v_Apple], 4
EndProcedure
Test()