Pelles C > Bug reports

Invalid syntax in macro definition

(1/2) > >>

Vortex:
Hi Pelle,

I coded a Poasm macro to easily handle rip-relative addressing on Windows 64-bit programming. The purpose is to replace the following syntax :


--- Code: ---        mov     rip+hBrush,rax
--- End code ---

with


--- Code: ---        mov     hBrush,rax
--- End code ---

The second hBrush statement is an equate defined as rip+_hBrush where _hBrush is declared in the .data? section by the macro.


--- Code: ---ripVar MACRO var,type

    @CatStr( <_>,<var>,< >,<type>,< >,<?>)

    .echo @CatStr( <_>,<var>,< >,<type>,< >,<?>)

    var CATSTR <rip>,<+>,<_>,var

    .echo var

ENDM
--- End code ---

Usage of the macro :


--- Code: ---.data?

ripVar  hBrush,QWORD
--- End code ---

The .echo statements are for debugging purpose.

Poasm Version 11.00.0 reports the following correct outputs and the source code is assembled without any issues:


--- Code: ---"_hBrush QWORD ?"
"rip+_hBrush"
"_hModule QWORD ?"
"rip+_hModule"
--- End code ---

Poasm Version 12.00.0 reports the following error messages :


--- Code: ---ColorDlg.asm(26): error: Invalid use of '_hBrush'.
"_hBrush "
"rip"

ColorDlg.asm(27): error: Invalid use of '_hModule'.
"_hModule "
"rip"

--- End code ---

Attached is the source code assembled with Poasm V11. Kindly, could you try the code with Poasm V12? Thanks.

Pelle:
I think it's the same problem that was also recently reported through email:
new Unicode handling counted terminator in the length for literal strings, so from "aa\0" and "bb\0" concat produced "aa\0bb\0\0" rather than "aabb\0".

Should be fixed by this version:
http://www.smorgasbordet.com/pellesc/1200/poasm_12_00_1.zip

Vortex:
Hi Pelle,

Thanks for the attachment. Poasm Version 12.00.1 solved the problem.

Pelle:
Great news, thanks. This version of POASM will be in the next Setup (either final or RC3, depending on events...)

Vortex:
Hi Pelle,

I wrote a second macro to handle structures :


--- Code: ---ripSt MACRO var,type

;   .echo command for debugging purpose

LOCAL t

t TEXTEQU <{}>

    @CatStr( <_>,var,< >,type,< >,t )

;  .echo  @CatStr( <_>,var,< >,type,< >,t )

    var CATSTR <rip+_>,var

   .echo var

ENDM
--- End code ---

The test of this new macro reports an error message :


--- Code: ---.data?
.
.
ripSt       pnt,POINT
--- End code ---

error: Symbol 'pnt' is undefined :


--- Code: ---    mov     pnt.y,10
--- End code ---

The POINT structure :


--- Code: ---POINT STRUCT
  x  DWORD ?
  y  DWORD ?
POINT ENDS
--- End code ---

Navigation

[0] Message Index

[#] Next page

Go to full version