AnsweredAssumed Answered

Problem with concatenating labels

Question asked by Wayne Pengelly on Mar 21, 2013

My main question is; Can parameters in a Macro be combined to form a label?

 

We are experiencing problems with assembling code that was assembled with the AVOCET AVMAC 68HC11 assembler. Semi-Avocet Compatibility is enabled. The central file that needs to be compiled is the AVMACS.INC file which is used on all of our modules.

 

The main problem seems to be with concatenating labels. In the following example “I” in the FOR statement is combined with xxSTK.  to create a parameter to the macro xxDEFL which is used to then define a Label. When xxSTACK is called I get an error in xxDEFL that states; A1602 Invalid character at end of label (xxSTK.&). The assembler obviously doesn’t understand the use of an ampersand “&”. Is there some other why of concatenating parameters to form labels?

 

 

xxPTR    TEQ 0

xxSTK    TEQ 0

xxTYP    TEQ 0

 

xxDEFL   MACRO     Label_A,Val_B

Label_A   TEQ Val_B

                  ENDM

 

xxSTACK  MACRO     TYPE,SYMBOL

          xxDEFL    xxTYP, TYPE

          xxDEFL    xxSTK, SYMBOL

          FOR I in (xxPTR)

                  xxDEFL    xxSTK.&I, SYMBOL

          ENDFOR

    ENDM

 

xxSTACK   3, 4

 

 

The  AVMAC manual has the following example:

 

                FOR        dig in 1,2,3,4

data&dig&nam ds           2

                ENDFOR

 

assembles as

 

data1nam            ds           2

data2nam            ds           2

data3nam            ds           2

data4nam            ds           2

 

Is there any way to convert this code to work on the S12(X) assembler?

 

Has anyone converted the AVMACS.INC file to work on the S12(X) assembler?

 

Message was edited by: Wayne Pengelly  MyMacro:     MACRO xx\1\2:          SET     \3           ENDMACRO  The following code assembles. MyLoc:          SET     5 xxAddr.5:     SET     8      MyMacro  Addr., MyLoc, 3  The result is: xxAddr.MyLoc:        SET     3

Outcomes