flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
Tomasz Grysztar 08 Oct 2012, 09:43
IMO, the most clean solution would be to create multiple macros. Here's a simple example with splitter being the "||" characters:
Code: macro forwardLoop [arg] { forward display `arg,13,10 } macro reverseLoop [arg] { reverse display `arg,13,10 } macro ohMy [params] { common match firstBatch||secondBatch,params \{ forwardLoop firstBatch reverseLoop secondBatch \} } ohMy 1,2,3 || 4,5,6 Code: macro forwardLoop [arg] { forward display `arg,13,10 } macro reverseLoop [arg] { reverse display `arg,13,10 } macro ohMy [params] { common match firstBatch=,=@=,secondBatch,params \{ forwardLoop firstBatch reverseLoop secondBatch \} } ohMy 1,2,3,@,4,5,6 Last edited by Tomasz Grysztar on 08 Oct 2012, 09:45; edited 1 time in total |
|||
![]() |
|
Syrasia 08 Oct 2012, 10:01
Woha, exatly. Man the first one is just perfekt. Thanks a lot
|
|||
![]() |
|
hopcode 08 Oct 2012, 13:33
1,2,3 test,test Microphon Check...
increase readability, Code: macro ohMy [params] { define status 0 match =0 direct rest,status params \{ display \`direct,13,10 irp i,rest\\{ \direct display \\`i,13,10 dd a#_beep ;<--- display_hex 32,a#_beep display 13,10 dd 0 display_hex 32,a#_boop display 13,10 \\} define status 1 \} match =0,status \{ \common display "common " irp i,params\\{ display_hex 32,$ display " " label a\\#i ;<--- display \\`i,13,10 \\} \} } ohMy 15,16,_boop,<reverse 1,2,3>,<forward 5,6>,<reverse 11,12,13>,_beep,18,19 Quote:
Cheers, ![]() _________________ ⠓⠕⠏⠉⠕⠙⠑ |
|||
![]() |
|
Syrasia 16 Oct 2012, 18:57
Okay, the macro is working almost perfekt. Almost.
I would like to be able to let out parms, ie ohMy ard1,word|| or this: ohMy ||arg is thiy also posible (complex macros are welcome) ![]() _________________ Back to fasm, the best |
|||
![]() |
|
Tomasz Grysztar 16 Oct 2012, 21:33
It may be simply extended this way:
Code: macro forwardLoop [arg] { forward display `arg,13,10 } macro reverseLoop [arg] { reverse display `arg,13,10 } macro ohMy [params] { common match firstBatch||secondBatch,params \{ forwardLoop firstBatch reverseLoop secondBatch \} match firstBatch||,params \{ forwardLoop firstBatch \} match ||secondBatch,params \{ reverseLoop secondBatch \} } ohMy 1,2,3 || ohMy || 4,5,6 Code: macro forwardLoop [arg] { forward display `arg,13,10 } macro reverseLoop [arg] { reverse display `arg,13,10 } macro ohMy [params] { common local T match =T firstBatch||secondBatch,T params \{ forwardLoop firstBatch reverseLoop secondBatch define T \} match =T firstBatch||,T params \{ forwardLoop firstBatch define T \} match =T ||secondBatch,T params \{ reverseLoop secondBatch define T \} } ohMy 1,2,3 || ohMy || 4,5,6 |
|||
![]() |
|
yoshimitsu 16 Oct 2012, 21:36
Code: macro forwardLoop [arg] { forward display `arg,13,10 } macro reverseLoop [arg] { reverse display `arg,13,10 } macro ohMy [params] { common done@ohMy equ match firstBatch||secondBatch,params \{ forwardLoop firstBatch reverseLoop secondBatch restore done@ohMy \} match :||secondBatch,done@ohMy:params \{ reverseLoop secondBatch restore done@ohMy \} match :firstBatch||,done@ohMy:params \{ forwardLoop firstBatch restore done@ohMy \} match :firstBatch,done@ohMy:params \{ forwardLoop firstBatch restore done@ohMy \} } Edit: aww, too slow |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.