flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
LocoDelAssembly
You'll need to do the following change:
Code: macro hashtable_define2 hashtable, size { rept size i\{ list_define hashlist_#hashtable\#i \} } % is available in assembler stage but you need to create symbols so you need preprocessor stage. |
|||
![]() |
|
Plue
Ok, thanks.
Another question: how can I check whether a macro parameter was passed or not (I think I want assembly stage here)? |
|||
![]() |
|
LocoDelAssembly
Code: macro wasPassed arg { local passed passed equ match any, arg \{ display "Something was passed!", 13, 10 passed equ 1 \} match ,passed \{ display "Nothing was passed...", 13, 10 \} } ; Tests wasPassed alfa-beta-gamma wasPassed |
|||
![]() |
|
Plue
Thank you!
|
|||
![]() |
|
Plue
Is there any reason why I can't use match ,arg directly (instead of using passed)?
|
|||
![]() |
|
LocoDelAssembly
No reason, my answer simulated an "If passed/Else" instead of an "If passed/If not passed"
![]() |
|||
![]() |
|
Plue
Is it not possible to create a new macro inside a macro?
Code: macro hashtable_define table, size { if (size and (size-1)) <> 0 __ error: size must be a power of 2 end if macro hash_#table reg \{ ; doesn't seem to work and reg, size - 1 \} } |
|||
![]() |
|
revolution
Works for me:
Code: macro hashtable_define table, size { if (size and (size-1)) <> 0 __ error: size must be a power of 2 end if macro hash_#table reg \{ and reg, size - 1 \} } hashtable_define testing,8 hash_testing eax |
|||
![]() |
|
Plue
Thanks for testing it. It seems like it won't work when the invokation of hashtable_define is placed after the invokation of hash_testing.
|
|||
![]() |
|
revolution
Plue wrote: Thanks for testing it. It seems like it won't work when the invokation of hashtable_define is placed after the invokation of hash_testing. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.