News:

Download Pelles C here: http://www.smorgasbordet.com/pellesc/

Main Menu

@InStr issue

Started by Vortex, May 15, 2025, 11:25:37 PM

Previous topic - Next topic

Vortex

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
Code it... That's all...

Vortex

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
Code it... That's all...

Pelle

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...
/Pelle

Vortex

Hi Pelle,

Many thanks for your efforts. The new release V13.00.57 is solving the issue.
Code it... That's all...