【发布时间】:2010-03-17 08:07:42
【问题描述】:
是否可以在程序集中分配本地范围的内存?
例如,考虑以下(完全人为的)情况:
我有两个宏,其中一个依赖于另一个。第一个是:
minimum MACRO dest, num1, num2
; Finds the minimum of two unsigned numbers, stores the result in dest
第二个是:
tripMin MACRO dest, num1, num2, num3
; Finds the minimum of three unsigned numbers, stores the result in dest
minimum firstMin, num1, num2
minimum secondMin, num2, num3
minimum dest, firstMin, secondMin
(由于各种原因,我知道这不是一个现实的例子,但请耐心等待。)
假设所有寄存器都被占用,有没有办法在宏中本地声明firstMin和secondMin?
或者我是否最好通过将寄存器的值压入堆栈并在完成后将其弹出来释放寄存器?
【问题讨论】: