flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Initializing a structure with data using EQU

Author
Thread Post new topic Reply to topic
FoXx



Joined: 25 Feb 2025
Posts: 35
FoXx 17 Nov 2026, 13:07
Explain to me where I went wrong. What’s the problem with EQU?


Description:
Filesize: 27.11 KB
Viewed: 116 Time(s)

true.jpg


Description:
Filesize: 48.4 KB
Viewed: 116 Time(s)

false.jpg


Post 17 Nov 2026, 13:07
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8583
Location: Kraków, Poland
Tomasz Grysztar 17 Nov 2026, 13:25
MYSTRUCT_INIT isn't evaluated at the time the macro is called, so the macro sees it as a single argument. You'd need to evaluate it manually:
Code:
match value, MYSTRUCT_INIT 
{ MyData MYSTRUCT value }    
Post 17 Nov 2026, 13:25
View user's profile Send private message Visit poster's website Reply with quote
FoXx



Joined: 25 Feb 2025
Posts: 35
FoXx 17 Nov 2026, 13:50
Tomasz, in the first case everything works. My assumption was that the EQU directive would substitute the value, and the compilation process would take place subsequently.
Post 17 Nov 2026, 13:50
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2026, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.