flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Struct and macro.

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1847
Roman 11 Mar 2023, 08:30
Fasmw 1.73
Macro auto fill all values in struct. How write ?
Code:
struct A
 x   dd 0
 y   dd 0
 flg db 0
 hh  dw 0
ends
struct B
 u  db 0
 ee dw 0
ends

macro fill { ... }
;in data
b1 A
b2 B
;in code
fill b1,1,2,3,2
fill b2,5,4
    
Post 11 Mar 2023, 08:30
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1847
Roman 11 Mar 2023, 10:48
Idea use irpv or restore equ.
Code:
struct A
 x   dd 0
A equ 4
 y   dd 0
A equ 4
 flg db 0
A equ 1
 hh  dw 0
A equ 2
ends

Macro fill restore A and get size element bytes

    
Post 11 Mar 2023, 10:48
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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.