flat assembler
Message board for the users of flat assembler.
Index
> Main > Stack pointer register |
Author |
|
DimonSoft 16 Mar 2018, 19:45
Mino wrote: Hello, How are these registers related to “stack pointers”? General purpose registers are… uhm… general purpose. You’re generally allowed to use them for whatever purpose. All of them. But you should keep in mind that certain GRPs are used implicitly by certain instructions and/or CPU mechanisms. For example, xSP is used as a pointer to the top of the stack. xSI and xDI are used by string-handling instructions. (I)MUL and (I)DIV may use xAX and xDX. LOOP uses xCX. (xCX stands for CX/ECX/RCX, the same for other examples). But I guess all this stuff is described in Intel SDM, so, please, give more detail on what you want to read in response. |
|||
16 Mar 2018, 19:45 |
|
Mino 16 Mar 2018, 20:47
So, if I understand correctly, any registry could be used for any operation?
|
|||
16 Mar 2018, 20:47 |
|
Furs 18 Mar 2018, 13:41
Depends on the instruction, some have special implicit register requirements, but most of the time yes, you're correct.
The only thing is that you need the stack pointer to point to valid stack memory in some OSes when exceptions or signals get thrown, so it's not a good idea to play with the stack pointer for "other purposes". |
|||
18 Mar 2018, 13:41 |
|
revolution 19 Mar 2018, 03:10
Mino wrote: So, if I understand correctly, any registry could be used for any operation? registry The thing MS implemented to centralise all the system settings. register A low level resource inside the CPU for holding temporary results. |
|||
19 Mar 2018, 03:10 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.