我不清楚是静态和堆栈分配是什么?静态分配是静态的,堆栈分配是动态的吗?那么堆分配属于哪里呢?
激活记录与此有何关系?我认为激活记录是一个类似于激活树的概念性东西,并没有任何物理存在。
以下目标机器码是什么意思?
静态分配:
ST callee. staticArea , #here + 20
BR callee. codeArea
堆栈分配:
LD SP , #stackStart
code for the first procedure
HALT
ADD SP , SP , #caller. recordSize
ST *SP , #here + 16
BR callee. codeArea
BR *O (SP) // return to caller
SUB SP , SP , #caller. recordSize // decrement stack pointer