flat assembler
Message board for the users of flat assembler.

Index > Windows > macros like c++ style.

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1286
Roman 18 Aug 2013, 06:05
My macro
Quote:

macro _ [ar]{ common
define Ok 0
match z c b, ar \{

match =0 == ,Ok c \\{
; display '17',13,10
invoke b
define Ok 1
mov [z],eax \\}


match =0 =: ,Ok c \\{
match d v f ,b \\\{
invoke d
; display Ok,13,10
define Ok 1
sub eax,[f]
mov [z],eax \\\}
\\}

match =0 - ,Ok c \\{
match d v f g,b \\\{
invoke v
;display Ok,13,10
define Ok 1
sub eax,[g]
sub [z],eax \\\}
\\}



match =0 - ,Ok c \\{
match d v,b \\\{
invoke v
;display '2',13,10
define Ok 1
sub [z],eax \\\}
\\}


\}
}
Post 18 Aug 2013, 06:05
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1286
Roman 18 Aug 2013, 06:09
in code write:
Quote:

_ Tim = GetTickCount
_ Tim : GetTickCount - Tim



But how fix : on =.
I mean i want write _ Tim = GetTickCount - Tim
But if i write _ Tim = GetTickCount - Tim my macro failed.
For this reason i write _ Tim : GetTickCount - Tim . But this is not very readable (_ Tim : GetTickCount - Tim )
I write c++ style macro for this:
_ C1 = GetDlgItem,[hwnddlg],IDR_PICT
C1 this is DD 0


Last edited by Roman on 18 Aug 2013, 06:31; edited 2 times in total
Post 18 Aug 2013, 06:09
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1286
Roman 18 Aug 2013, 06:13
And how write Tim = GetTickCount instead of _ Tim = GetTickCount
I mean not write this symbol _
Post 18 Aug 2013, 06:13
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1286
Roman 18 Aug 2013, 09:48
Please help
Post 18 Aug 2013, 09:48
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 3515
Location: vpcmipstrm
bitRAKE 18 Aug 2013, 21:51
Tim would need to be a macro. If you abstract away from the actual label name and use Tim at your high-level. Need a macro to create Tim macro.
Post 18 Aug 2013, 21:51
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1286
Roman 19 Aug 2013, 14:39
I expected to be used this macro with different variables
Post 19 Aug 2013, 14:39
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 3515
Location: vpcmipstrm
bitRAKE 19 Aug 2013, 18:22
Macro names can be variable.
Post 19 Aug 2013, 18:22
View user's profile Send private message Visit poster's website Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 3515
Location: vpcmipstrm
bitRAKE 19 Aug 2013, 22:20
Code:
macro A B,[C] {
  common
    display `B
  forward
    irps D,C \{ display \`D \}
}

struc B {
  macro . [C] \{ \common A .,C \}
}


Tim B


Tim = B + C    
...just an example. Macro A could also be integrated into STRUC macro creation.
Code:
macro DoubleWord [name] {
  forward
    macro name [C] \{ \common A name,C \}
}


DoubleWord Tim,Sue,Vicky

Tim = B + C    
Hope it is clearer.

[Maybe an OP will be so kind as to move this to macro section of the board?]
Post 19 Aug 2013, 22:20
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1286
Roman 20 Aug 2013, 07:59
bitRAKE
Thanks !
Post 20 Aug 2013, 07:59
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-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.