High-Address into the accumulator in asm using only LDA

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

High-Address into the accumulator in asm using only LDA

ソリューションへジャンプ
908件の閲覧回数
Brax02
Contributor III

Hello,

 

I have declare a table like that.

 

ABC:                DC.W  $1234          

 

The address of ABC is in my example 0xF200

 

I want to load in the accumulator 0xF2 only using a LDA command.

 

LDA  #ABC==> A=0x0, 0x0 is the LSB of the address and not the MSB of the address 0xF2

 

How can i do that ?

 

for sure I can do something like but it's not the goal.

 

          LDHX #ABC  ; HX = F200

          PSHH         

          PULA          ;A=0xF2

ラベル(1)
1 解決策
761件の閲覧回数
implicit
Contributor II

I believe you want to use the HIGH operator in this case, at least for CodeWarrior's built-in HCS08 assembler.

E.g.

LDA #HIGH(ABC)

元の投稿で解決策を見る

3 返答(返信)
762件の閲覧回数
implicit
Contributor II

I believe you want to use the HIGH operator in this case, at least for CodeWarrior's built-in HCS08 assembler.

E.g.

LDA #HIGH(ABC)

761件の閲覧回数
Brax02
Contributor III

I was exactly looking for that ! Thanks a lot !!

0 件の賞賛
返信
761件の閲覧回数
bigmac
Specialist III

Hello,

The following alternatives should also work -

   lda #(ABC/256)

   lda #(ABC>>8)

The calculation is done during assembly.

Regards,

Mac

0 件の賞賛
返信