为什么8051上电时SP寄存器的值为07h?

Why is the value of SP register 07h when 8051 is powered up?

当 8051 上电时,堆栈指针 寄存器包含值 07h 而不是 00h?

因为 Bank 08051 使用的默认寄存器组。 bank 0 使用寄存器 0 - 7.

如果 SP0 寄存器开始 R0 - 7 将覆盖 SP 并至少导致未定义的行为。

通常 SP 使用启动代码

设置到所需位置