NO

Author Topic: Issue with symbol defined by CATSTR  (Read 800 times)

Offline Vortex

  • Member
  • *
  • Posts: 797
    • http://www.vortex.masmcode.com
Issue with symbol defined by CATSTR
« on: June 04, 2023, 04:57:49 PM »
Hello,

Below, the symbol Sample1 is not defined correctly :

Code: [Select]
level=1

@CatStr(<Sample>,level) CATSTR <test>,level

The output is :

Code: [Select]
.echo @CatStr(<Sample>,level)

.echo Sample1

"Sample1"
Sample1

The correct assignment should output :

Code: [Select]
"test1"
test1

Code tested with Poasm Version 12.00.1
Code it... That's all...

Offline Vortex

  • Member
  • *
  • Posts: 797
    • http://www.vortex.masmcode.com
Re: Issue with symbol defined by CATSTR
« Reply #1 on: September 10, 2023, 09:09:04 PM »
Hi Pelle,

Thanks for replying my bug reports

Here is another attempt to solve the issue but this one didn't work too :

Code: [Select]
level=1

Sample # <level> CATSTR <test>,level

Code: [Select]
Test.asm(13): error: Invalid use of 'Sample'.
Test.asm(13): fatal error: Invalid use of '#'.
Code it... That's all...

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Re: Issue with symbol defined by CATSTR
« Reply #2 on: September 11, 2023, 02:59:42 PM »
We'll see. What is really needed is a simplified, non-bloated, non-MASM-ish syntax. But since this is 2023, I can.t really see this happening...
/Pelle

Offline Vortex

  • Member
  • *
  • Posts: 797
    • http://www.vortex.masmcode.com
Re: Issue with symbol defined by CATSTR
« Reply #3 on: September 11, 2023, 09:32:44 PM »
Hi Pelle,

Poasm is a very good assembler and it's not bloated. Today, an assembler without a powerful macro engine does not mean much. You did a lot for this tool and in my modest opinion, you should preserve the current state of the macro engine. Modifying radically the macro engine could break a lot of code.  I never asked from you to implement exotic features to Poasm, the forum records are supporting my arguments. We know that maintaining a toolset like Pelles C is not an easy job. My personal opinion is that there is no need to add any new features to Poasm. All what we need is to correct those bugs. The macros can do a lot to support code written with Poasm. What we have so far :

- With thanks to Steve Hutchesson , we can use the master include file of Masm32 with Poasm.
- Converting the import libraries to include files is very easy.
- The Masm32 and Masm64 SDKs can support Poasm again with thanks to Hutch.
- As a long time user of Poasm, I believe that we can create interesting projects.

You are mainly interested in developing the C compiler and the IDE. Naturally, you are right in your choices and I can understand you. All my desire is to cooperate with you and the other forum members to eliminate those bugs. Thanks for your efforts.
Code it... That's all...

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Re: Issue with symbol defined by CATSTR
« Reply #4 on: September 26, 2023, 06:20:15 PM »
Hello,

Trust me, it is bloated... I have the source code...  ;D

You may need a powerful macro engine when only/mostly programming in assembly, but I strongly suspect this is a fairly small group not getting any larger (with any assembler, not just POASM).

When POASM was new (like 2005), there were many wishes for more MASM features and I got carried away. I wish I hadn't because after that I have spent way too many hours, days, sometimes weeks to make old macro examples continue to work with more recent changes/fixes. This is really the problem: almost every change to POASM takes longer than it should, but any attempt at really improving things would take even longer (so not an option).

I will try to fix what you have reported recently, but we are getting closer to a point when it's just not worth the effort...

/Pelle

Offline Vortex

  • Member
  • *
  • Posts: 797
    • http://www.vortex.masmcode.com
Re: Issue with symbol defined by CATSTR
« Reply #5 on: September 26, 2023, 07:44:48 PM »
Hi Pelle,

Quote
You may need a powerful macro engine when only/mostly programming in assembly, but I strongly suspect this is a fairly small group not getting any larger (with any assembler, not just POASM).

We have here in the forum some members who are doing programming with Poasm and the other assemblers. High level languages are more popular and the assembly language's audience is not so large as you said. The Masm Forum is another venue welcoming coders interested in assembly programming with Poasm, Masm and the Watcom derivative assemblers.

Quote
When POASM was new (like 2005), there were many wishes for more MASM features and I got carried away. I wish I hadn't because after that I have spent way too many hours, days, sometimes weeks to make old macro examples continue to work with more recent changes/fixes. This is really the problem: almost every change to POASM takes longer than it should, but any attempt at really improving things would take even longer (so not an option).

I appreciate all your efforts and say thank you for your tools. Maintaining a tool like an assembler is a challenge. I can understand your point of view.

Quote
I will try to fix what you have reported recently, but we are getting closer to a point when it's just not worth the effort...

Thanks for taking in account my reports. What makes Poasm powerful is the full featured 64-bit mode not crippled like ml64 from MS. The 64-bit version of ml ( 64-bit Masm ) does not provide the built-in invoke macro and the other high level constructs.
« Last Edit: September 26, 2023, 08:42:39 PM by Vortex »
Code it... That's all...

Offline jj2007

  • Member
  • *
  • Posts: 536
Re: Issue with symbol defined by CATSTR
« Reply #6 on: October 04, 2023, 03:01:43 AM »
Hi Vortex, try this in Masm:
Code: [Select]
  level=111
  @CatStr(<Sample>, level) CATSTR <test>, %level
  % echo Sample111
  level=222
  @CatStr(<Sample>, %level, < equ @CatStr(<test>, %level)>)
  echo Sample222
  .DATA
  Sample222 dd 123
  ; test222 dd 456 ; Error A2056: Symbol already defined: test222
  .CODE
  % echo Sample222
  mov eax, Sample222
  mov ecx, test222

Output:
Code: [Select]
Sample111
Sample222
test222

Same problem: with echo, you need the % before. The mov ... work, though.

What makes Poasm powerful is the full featured 64-bit mode not crippled like ml64 from MS. The 64-bit version of ml ( 64-bit Masm ) does not provide the built-in invoke macro and the other high level constructs.

@Pelle: I can echo that. The Masm64 SDK suffers a lot from being linked to a CrippleWare assembler.
« Last Edit: October 04, 2023, 03:05:11 AM by jj2007 »

Offline Vortex

  • Member
  • *
  • Posts: 797
    • http://www.vortex.masmcode.com
Re: Issue with symbol defined by CATSTR
« Reply #7 on: October 04, 2023, 09:30:06 PM »
Hi jj2007,

Thanks for the Masm test. Poasm does not use the symbol %. The tool provides a nice alternative, the .ECHO directive instead of % echo.

Code: [Select]
.ECHO directive (IA32, AMD64)
 
Purpose:
Displays specified expression(s) on the screen during translation time.

Syntax:
.ECHO [ expression [,] ... ]

Description:
The .ECHO directive evaluates as much as possible of expression and displays it on the screen.

Example:
.ECHO 1 SHL 16, mongo
Code it... That's all...