flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
qeos
haw may I combine variables at some plase/segment?
like this: Code: new a, 'dsds' mov ax, ax ... new b, 'asfasd' to this ==> Code: mov ax, ax ... a db 'dsds' b db 'asfasd' |
|||
![]() |
|
AlexP
?! I think that's a little much than he required, but good macro(s). Does he want a more OOP-style of initializing variables? He may try this:
Code: macro new name,string { name db string } Note this is just a high-level view of what the macro would look like, I highly doubt the one I just posted would actually work. I can't test it now, school computers... EDIT: Oh, I see he would like them to be grouped in one section. I believe the only way to do this is to not use the macro in the middle of the code, but group them like so: Code: section '.data' data readable writeable .. new a 'asd' new b 'asdflas' .. ; would give .. a db 'asd' b db 'asdflas' .. |
|||
![]() |
|
revolution
AlexP wrote: ?! I think that's a little much than he required, but good macro(s). Does he want a more OOP-style of initializing variables? |
|||
![]() |
|
AlexP
Well then.. fine... and I did not call your macros OOP-style. I simply stated that it looks like (from his 'new' keyword) that he was trying to build a more OOP-style ASM programming. I may make use of those macros, I have an idea...
|
|||
![]() |
|
qeos
2revolution, I think this is what I need.. thank
|
|||
![]() |
|
qeos
Code: .gvar_list equ macro vars { local z .gvar_list equ .gvar_list,z macro z } macro globalVar { match var_list,.gvar_list \{ irp instr,var_list \\{ instr \\{ \} } Code: vars { asdf db 'asdfasdf' } globalVar Quote: flat assembler version 1.67.26 (1031068 kilobytes memory) I dont understand where is trouble? |
|||
![]() |
|
revolution
qeos wrote:
Code: .gvar_list equ macro vars { local z .gvar_list equ .gvar_list,z macro z } macro globalVar { match var_list,.gvar_list \{ irp instr,var_list \\{ instr \\} \} } |
|||
![]() |
|
qeos
big thanks!
|
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.