Hello to all the community. I wish to make a counter in assembler visible to all files .asm, and any .asm file can continue the count up.
I've done something, assigning a value to the SET directive but is only visible within the same file. I mean, I have a macro that runs and is incremented a counter (label) that use. The structure is as follows:
MY_MACRO MACRO
MLIST OFF
IFNDEF Label
Label SET 0
ENDIF
\1 EQU Label
Label SET Label + 1
ENDM
If I compile gives this result:
MY_MACRO Value1 ;Value1 equal to 0
MY_MACRO Value2 ;Value2 equal to 1
lda #Value1 ACCA loaded with 0
sta xx ;somewhere in memory
lda #Value2 ACCA loaded with 1
Desire "Label" in the macro out public and to increase it from another .asm file by holding the carrying value at the time and not redefine it.
Is there any way?
Thanks to all.
Hi,
What chip and version of CW do you work with?
Have a great day,
Zhang Jun
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
I'm using HCS08 and CW 6.3, but I have too the CW 10.... I don't remember...
thanks, can you please upload your demo project to showcase the problem? thanks!
Have a great day,
Zhang Jun
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
there you have a working sample. I was not clear with the idea? My project is big for publication
under CW6.3 install folder, there is assembly demos:
{CW_MCU_6_3 install folder}\(CodeWarrior_Examples)\HCS08\Assembly Examples
can this help you?
Have a great day,
Zhang Jun
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------