flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > irpv create labels. |
Author |
|
Tomasz Grysztar 29 Sep 2022, 07:56
With fasmg it would work as simply as you imagine:
Code: a1 EQU macroA a1 EQU macroB a1 EQU macroC irpv v,a1 .branch#%: v end irpv Code: a1 EQU macroA a1 EQU macroB a1 EQU macroC __c equ 1 irpv v,a1 { rept 1 num:__c,next:__c+1 \{ .branch\#num: v __c equ next \} } |
|||
29 Sep 2022, 07:56 |
|
Roman 29 Sep 2022, 09:20
Thanks. Work fine.
|
|||
29 Sep 2022, 09:20 |
|
Tomasz Grysztar 29 Sep 2022, 11:48
Could in fact be a little simpler:
Code: a1 EQU macroA a1 EQU macroB a1 EQU macroC __c equ 0 irpv v,a1 { rept 1 num:__c+1 \{ .branch\#num: v __c equ num \} } |
|||
29 Sep 2022, 11:48 |
|
Roman 29 Sep 2022, 13:55
Tomasz Grysztar wrote: Could in fact be a little simpler: Ho do jmp nxt branch ? I mean: macroA must jmp .branch2 .branch2: macroB must jmp .branch3 .branch3: macroC must jmp .branch4 .branch4: Last edited by Roman on 29 Sep 2022, 15:01; edited 1 time in total |
|||
29 Sep 2022, 13:55 |
|
Roman 29 Sep 2022, 14:51
I try this work.
Code: __c equ 0 irpv v,a1 { rept 1 num:__c+1 \{ .branch\#num: v .branch_\#num .branch_\#num: __c equ num \} } |
|||
29 Sep 2022, 14:51 |
|
macomics 29 Sep 2022, 18:08
Can't you do that?
Code: macro macroA {local end_label jmp end_label ... end_label: } a1 EQU macroA a1 EQU macroB a1 EQU macroC __c equ 0 irpv v,a1 { rept 1 num:__c+1 \{ .branch\#num: v __c equ num \} } |
|||
29 Sep 2022, 18:08 |
|
Roman 29 Sep 2022, 20:16
This variant I try.
But some times local labels in macro not good, and create problems if I want do loop from macroC to macroA |
|||
29 Sep 2022, 20:16 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.