flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > dd is a macro ?

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1847
Roman 29 Dec 2022, 10:15
Fasmw 1.73
I want writed my dc type for data.
And i want see macro dd.
Code:
Hero         dd 0,0,0,0
HeroStatus   db 0,0,0,0
HeroFun1     dc Hero,procHero
proc procHero
       ret
endp
macro InitHero v,a { 
if v eqtype dc
      mov eax,[v]
      mov ebx,a
      call dword [v+4]
end if
mov [v],a
}
InitHero Hero,10                ;do only mov [Hero],10
InitHero HeroFun1,HeroStatus    ;do call procHero
    
Post 29 Dec 2022, 10:15
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1847
Roman 29 Dec 2022, 11:14
I try:
Code:
Hero         dd 0,0,0,0
HeroStatus   db 0,0,0,0
HeroFun1     dq Hero,procHero

macro InitHero v,a { 
if v eqtype dq
      mov eax,dword [v]
      mov ebx,a
      call dword [v+8]
      display 'ok;;'
end if
mov dword [v],a
}
;but not work ! Why ?
InitHero Hero,5
InitHero HeroFun1,HeroStatus ;,macro not do call !
    
Post 29 Dec 2022, 11:14
View user's profile Send private message Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 669
Location: Ukraine
Overclick 23 Jan 2023, 07:31
Try to use struc for that
Post 23 Jan 2023, 07:31
View user's profile Send private message Visit poster's website 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.