3 ms·
It's been so long I had to look it up: SS is the stack segment.
by lallysingh 9y ago
It's been so long I had to look it up: SS is the stack segment.
- 0x0 9y agoAnd furthermore, the current stack address is determined by the combination of two registers: ss for the segment and rsp/esp/sp for the stack pointer within the segment. I guess the strange behavior around modifying ss comes from the fact that you need to also modify sp immediately afterwards, because otherwise you are running with a wild stack address pointing to random memory. You also can't modify sp before modifying ss because then you are also running with a wild stack, and an interrupt could come in at any time and push things onto random memory.