flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > Is it possible to shuffle definitions? |
Author |
|
bitRAKE 17 Aug 2021, 20:22
[fasmg] Maybe something like:
Code: struc PRNG val* ; your favorite prng function goes here . = rnd mod val end struc myRnd PRNG 6 ; need to get a random number in range [0-5] iterate <REG1,REG2,REG3>,\ eax,ebx,ecx,\ eax,ecx,ebx,\ ebx,eax,ecx,\ ebx,ecx,eax,\ ecx,eax,ebx,\ ecx,ebx,eax indx myRnd+1 mov REG1, REG2 lea REG2, [REG3 + 0x10] break end iterate |
|||
17 Aug 2021, 20:22 |
|
macomics 18 Aug 2021, 15:09
Quote:
What's wrong with that? Code: macro name REG1, REG2, REG3 { mov REG1, REG2 lea REG2, [REG3 + 0x10] } Code: list1 equ eax,ebx,ecx list2 equ ebx,ecx,eax ... macro name_call index {name list#index} |
|||
18 Aug 2021, 15:09 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.