Page 1 of 1

PB 5.11 assembler and local labels

Posted: Mon Jun 17, 2013 2:44 pm
by User_Russian
Why assembler preprocessor, not work correctly with a local label?

Code: Select all

Procedure Test()
  EnableASM
  
  jmp m1
  
  m1:
EndProcedure
We have to explicitly specify the name of the label.

Code: Select all

Procedure Test()
  EnableASM
  
  jmp l_test_m1
  
  m1:
EndProcedure

Re: PB 5.11 assembler and local labels

Posted: Mon Jun 17, 2013 6:08 pm
by STARGÅTE
Label: is a PB-Syntax, use the ASM Syntax:

Code: Select all

Procedure Test()
  EnableASM
  
  jmp m1
  
  !m1:
EndProcedure

Re: PB 5.11 assembler and local labels

Posted: Mon Jun 17, 2013 7:02 pm
by User_Russian
STARGÅTE, In the case of a variable, do not use ASM-syntax.

Code: Select all

Procedure Test()
  x=0
  EnableASM
  mov x, 10
  DisableASM
  
  Debug x
EndProcedure

Test()
Then why is he (ASM-syntax) is required in the case of the labels?
Obviously flaw, ASM preprocessor.

Re: PB 5.11 assembler and local labels

Posted: Mon Jun 17, 2013 7:54 pm
by Demivec
User_Russian wrote:Test()[/code]Then why is he (ASM-syntax) is required in the case of the labels?
Obviously flaw, ASM preprocessor.
The variable or label has to be declared first. In your example code declared the variable 'x' by using it before the assembler code, but the label was declared after the assembler code.

Not a bug. Same as your other bug report. Read the information in the manual on assembly use or post in the Assembly Programming or Coding Questions forum if you have a question on use.

Re: PB 5.11 assembler and local labels

Posted: Mon Jun 17, 2013 8:20 pm
by User_Russian
Demivec wrote:The variable or label has to be declared first.
It does not matter.
Still does not work.

Code: Select all

Procedure Test()
  EnableASM
  m1:
  
  jmp m1
  DisableASM
  
EndProcedure

Test()

Re: PB 5.11 assembler and local labels

Posted: Mon Jun 17, 2013 9:14 pm
by Demivec
User_Russian wrote:We have to explicitly specify the name of the label.

Code: Select all

Procedure Test()
  EnableASM
  
  jmp l_test_m1
  
  m1:
EndProcedure
You already know how to do it correctly, why are you confused? Are you trying to make a feature request instead of a bug report?

Re: PB 5.11 assembler and local labels

Posted: Mon Jun 17, 2013 9:33 pm
by LuCiFeR[SD]
I'm pretty convinced he doesn't understand that the "!" bypasses the PBcompiler and gives him the access to fasm directly. but equally, I don't think he understands that there is a possibility of his label clashing with a pb internal label and giving him just as many headaches when code that should work, suddenly doesn't. which is why PB's procedural syntax requires the "l_test_m1"

but yes, it does sound more like a feature request than a bug :)

Re: PB 5.11 assembler and local labels

Posted: Mon Jun 17, 2013 10:30 pm
by User_Russian
Friends, this ASM code handles preprocessor pbcompiler, before it processes the fasm.
And this preprocessor should change the name of the label, as it does with the variable names.
After all, the preprocessor replaces

Code: Select all

mov x, 10
on

Code: Select all

mov dword [p.v_x], 10
Why can not he do the same with the labels?

Re: PB 5.11 assembler and local labels

Posted: Mon Jun 17, 2013 11:04 pm
by LuCiFeR[SD]
then make this a feature request and NOT a bug report, because it is not a bug as is explained in the documentation.