Hello Horacio,
This may not be applicable to your case, but I would normally use the stack for any temporary variables (when programming in assembly code). The stack pointer can then be adjusted when the variables are no longer required (when the sub-routine exits).
If you are programmin in C, this will occur automatically for local variables within a function.
Regards,
Mac
Hello,
An alternative approach that could also be adapted for absolute assembly - simply use equates to define a new label for the different uses of each temporary variable, as required.
So the temporary variable block would be allocated only once.
MY_TEMP: SECTION SHORT
TEMP: DS.B 16
XDEF TEMP
Then to use the variables in different modules of the program -
Case 1:
XREF TEMP
prot_cnt EQU TEMP+2
etc.
Case 2:
XREF TEMP
time_temp EQU TEMP+2
etc.
Regards,
Mac