Problems getting SCI Module on a S08PT60 to work ASM

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Problems getting SCI Module on a S08PT60 to work ASM

Jump to solution
934 Views
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

Labels (1)
0 Kudos
1 Solution
722 Views
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.

View solution in original post

3 Replies
723 Views
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.

722 Views
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 Kudos
722 Views
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