Pelles C forum

Pelles C => Bug reports => Topic started by: Vortex on May 15, 2025, 11:25:37 PM

Title: @InStr issue
Post by: Vortex on May 15, 2025, 11:25:37 PM
Hello,

Poasm Version 13.00.49 reports the following error messages while assembling the code below :

\PellesC\bin\poasm.exe /AIA32 Sample.asm
11
Sample.asm(12): error: Expected ','.
Sample.asm(12): error: Expected ','.
Sample.asm(12): error: Expected ')'.
01, <This is a macro test.>, <test>Sample.asm(12): fatal error: Invalid use of ')'.

.386
.model flat,stdcall
option casemap:none

sample MACRO var

LOCAL t

t INSTR var,<macro>
.echo t

.echo @InStr(t+1,var,<test>)

ENDM

.code

start:

   sample <This is a macro test.>

   xor  eax,eax
   ret

END start
Title: Re: @InStr issue
Post by: Vortex on May 16, 2025, 03:30:05 PM
Hello,

The code adapted for Uasm can be assembled without issues. The purpose is to test if the statement @InStr(t+1,var,<test>) is a valid one.

.386
.model flat,stdcall
option casemap:none

sample MACRO var

LOCAL t,temp

t INSTR <var>,<macro>
temp TEXTEQU %(t)
% echo temp

temp TEXTEQU %(@InStr(t+1,<var>,<test>))

% echo temp

ENDM

.code

start:

   sample <This is a macro test.>

   xor  eax,eax
   ret

END start
Title: Re: @InStr issue
Post by: Pelle on May 16, 2025, 06:32:40 PM
It's a tricky case with the first argument to INSTR and @InStr() being an optional expression (which can be almost anything).

Try the attached POASM version (13.00.57). This has to be last (macro) fix for a while, I think...
Title: Re: @InStr issue
Post by: Vortex on May 16, 2025, 08:26:09 PM
Hi Pelle,

Many thanks for your efforts. The new release V13.00.57 is solving the issue.