flat assembler
Message board for the users of flat assembler.
Index
> Main > fine grained register stack saving |
| Author |
|
|
Fastestcodes 25 Jul 2026, 19:05
Save registers to memory.
mrax dq 0 start: mov qword[mrax],rax do something mov rax, qword[mrax] |
|||
|
|
AsmGuru62 25 Jul 2026, 22:09
So, if I understand this, we talking about preserving registers in a code flow:
Code: ; --- I am using "C" just for better look: if (...) { ; using only rbx, rsi push rbx rsi ; --- some code flow is here using the regs... pop rsi rbx } else { ; using only rdi, rsi, rbx, r12, r14 push rdi rsi rbx r12 r14 ; --- some code flow is here using the regs... pop r14 r12 rbx rsi rdi } It is unclear if you can achieve a significant optimization here. Only if your code flows are very small in size. If code flows are big, then a couple of additional PUSH/POP opcodes will not do much good. In my opinion, it looks like premature optimization (an enemy of a coder). |
|||
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2026, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.