Hello,
I have Problems with the following code:
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
Solved! Go to Solution.
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.
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.
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
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