flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > macro use inside repeat block: symbol already defined |
Author |
|
revolution 25 Oct 2016, 22:06
You will need to use rept.
Code: rept 8 { do_something } |
|||
25 Oct 2016, 22:06 |
|
redsock 25 Oct 2016, 22:18
thanks for that... rept versus repeat means that % can't be used ... so iteration counts have to be done manually then? e.g. the following code doesn't do what I want:
Code: format ELF64 public _start _start: macro do_something i* { local .label jmp .label dd i,i+1,i+2,i+3 .label: } rept 8 { do_something % } mov eax, 60 ; exit xor edi, edi ; return code syscall |
|||
25 Oct 2016, 22:18 |
|
revolution 25 Oct 2016, 22:21
You can use an iteration counter with rept:
Code: rept 8 x { do_something x } |
|||
25 Oct 2016, 22:21 |
|
redsock 25 Oct 2016, 22:24
lol must've missed that in the docs, hahah, thx! Straight from the docs:
Code: So this: rept 3 counter { byte#counter db counter } will generate lines: byte1 db 1 byte2 db 2 byte3 db 3 As an aside, perhaps it is because of my "lean" use of macros in the first place that I have never had to use rept instead of repeat ... so much code and still learn new tricks mucho gracias |
|||
25 Oct 2016, 22:24 |
|
revolution 26 Oct 2016, 00:48
redsock wrote: Care to delete my obvious idiotic questions for me then? |
|||
26 Oct 2016, 00:48 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.