我在看PIC16F87X的文档时发现,这款单片机的硬件堆栈是个循环缓冲器(circular buffer),即第九次“压入“”将覆盖第一次“压入”,即使出现这种情况,也是没有提示的。用起来感觉有点虚啊。
原文:
The stack operates as a circular buffer. This means that after the stack has been PUSHed eight times, the ninth push overwrites the value that was stored from the first push. The tenth push overwrites the second push (and so on).
Note 1: There are no status bits to indicate stack overflow or stack underflow conditions.
2: There are no instructions/mnemonics called PUSH or POP. These are actions that occur from the execution of the CALL, RETURN, RETLW and RETFIE instructions, or the vectoring to an interrupt address.