What is the difference between ESP register and CC register?

I'm just new to assembly language. As I know, ESP and SS refer to stack registers, but do not quite understand the differences between them.

+4
source share
2 answers

SS is the register of the stack segment. It indicates the total memory area that will be used for the stack. ESP is the stack pointer register. It indicates the exact location that is located at any given point on the top of the stack, in the memory area of ​​the stack segment.

+8
source

SS (relatively) top of the stack; boot loaders are usually set to 0x7e00 so that the stack 0x7e00 directly above the executable code. This means "Stack Segment".

ESP is the (absolute) bottom of the stack; it is installed on something above SS and it is growing. It means "(extended) stack pointer". To get the amount of space that you have on the stack, move the ESP to a temporary register and subtract the SS from it. Please note that this probably only works in real mode.

-1
source

Source: https://habr.com/ru/post/1388097/


All Articles