Problems getting SCI Module on a S08PT60 to work ASM

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

Problems getting SCI Module on a S08PT60 to work ASM

ソリューションへジャンプ
1,046件の閲覧回数
Ingo_Michael
Contributor II

Hello,

 

I have Problems with the following code:

 

128452_128452.pngpastedImage_0.png

I always get warnings like

 

"A13003 Value is truncated to one byte main.asm /TWR-S08PT60/Sources line 119 C/C++ Problem" and

"A1415 Cutting constant: Value 12428 ($308C) is not in range [0..255] main.asm /TWR-S08PT60/Sources line 119 C/C++ Problem

in my code. I can not understand why. I think that´s also the reason why I am not able to reset the "TDRE" Flag in the SCI1_S1 Register.

So my complete code is not working and I am not able to send some chars out to my terminal program on my PC.

 

Can anyone help?

 

 

BR

-Ingo

ラベル(1)
0 件の賞賛
返信
1 解決策
834件の閲覧回数
tonyp
Senior Contributor II

All bit instructions (BSET, BCLR, BRSET, BRCLR) expect a zero-page operand (i.e., a variable mapped somewhere in page 0, RAM address 0 through 255).

Apparently, in your case, SCI1_S1 is located outside this range.  So, you need to emulate the bit instructions.  Example:

BCLR 7,XXX

is (practically) equivalent to

LDA XXX

AND #$7F

STA XXX

while a BRCLR 7,XXX,Address can be emulated with

LDA XXX

BIT #$80

BEQ Address

(Similarly for the rest, except that you need ORA for BSET and inverted mask, and BNE for BRSET.)

Hope this helps.

元の投稿で解決策を見る

3 返答(返信)
835件の閲覧回数
tonyp
Senior Contributor II

All bit instructions (BSET, BCLR, BRSET, BRCLR) expect a zero-page operand (i.e., a variable mapped somewhere in page 0, RAM address 0 through 255).

Apparently, in your case, SCI1_S1 is located outside this range.  So, you need to emulate the bit instructions.  Example:

BCLR 7,XXX

is (practically) equivalent to

LDA XXX

AND #$7F

STA XXX

while a BRCLR 7,XXX,Address can be emulated with

LDA XXX

BIT #$80

BEQ Address

(Similarly for the rest, except that you need ORA for BSET and inverted mask, and BNE for BRSET.)

Hope this helps.

834件の閲覧回数
Ingo_Michael
Contributor II

Thank you, but in CW 6.3 it was possible. Now I use CW 10.6.4 and it does not. Is there another way?

BR

-Ingo

0 件の賞賛
返信
834件の閲覧回数
Encoder1
Contributor III

Dear Ingo,

CW10 is much more cumbersome than old good CW6.3 but in that case the result would be the same.

You simply cannot do bit instruction outside of page zero.

In the case of PT60 this include all SCI, SPI, FTM2 timer registry, Port i/o enable and pullup.

For these you are forced to translate bit instruction as Tony suggested: there are no short codes.

Regards,

Salvatore