Assembler Local Labels

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Assembler Local Labels

886件の閲覧回数
matthewolson
Contributor I

Does the assembler for the CS08 devices offer a local label feature?  for example, instead of having to track short loops with a loopx label, the user could assign a character to be the first one of the label and then that particular label would be unique between the non-local labels before and after the local label.  If not, how do others create labels for short loops or branches in subroutines?

 

Thanks...ptp

ラベル(1)
0 件の賞賛
返信
2 返答(返信)

815件の閲覧回数
Leojunin
Contributor IV

I do not know what you say. If your relocatable assembler programs, each tag is private within .asm file. If what you have is a repetitive loop routine, you can program it into a macro. When you call the macro each tag is configured not to be repeated using \ @. Example:

MyMacro     MACRO               ;clear registers

               lda   #\1

               ldhx  #\2

loop\@         clr   0, x

               aix   #1

               dbnza loop\@

            ENDM

;*************************************************

MyCode      SECTION

            nop

            nop

            MyMacro 4, RAMStart

            MyMacro 8, $230

            nop

;*************************************************

;Generated code: green = macro expansion

MyCode      SECTION

            nop

            nop

            MyMacro 4, RAMStart

            lda   #4

            ldhx  #$80

loop_00001     clr  ,x

            aix   #1

            dbnza loop_00001

            MyMacro 8, $230

            lda   #8

            ldhx  #$230

loop_00002     clr  ,x

            aix   #1

            dbnza loop_00002

            nop

0 件の賞賛
返信

815件の閲覧回数
ZhangJennie
NXP TechSupport
NXP TechSupport

Hello,

from my understanding, CW for HCS08 assembly doesn't have this feature.


Have a great day,
Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛
返信