flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
revolution 08 Jan 2023, 00:26
I like to make functions/procedures that only need to use the stack to save the callers registers. That is, when it doesn't need local stack variables, it only uses registers. So if it looks like the current code is getting unwieldy I look into how to split it into two more more parts to call independently.
It isn't always possible, but when I can get that it feels satisfying. However all of that gets ignored in critical code paths. When performance matters a single call/ret overhead might really hurt. |
|||
![]() |
|
sylware 08 Jan 2023, 11:46
Yeah, this is the register dance I was talking about.
Before that step, prototyping while having an infinite amount of regs is really fluid. |
|||
![]() |
|
bitRAKE 11 Jan 2023, 02:57
I've been honing a technique using macros. To remove ambiguity, I force all used registers to be passed as parameters. An added complexity is hidden in how the registers are used: read, write, or read-write. Application of the technique sometimes makes this obvious.
Prior I also applied an optimistic allocation of registers with refactoring as needed. The macronization [not a word, implying: replaced fragments with macros] makes it so I do not need to search-and-replace registers as I refactor. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.