I've got a similar issue. I'm a newbie to CW and Freescale/Motorola micros in general, so maybe there's something simple I'm not doing. I'm using CW 5.7.0 with the MC9S08GB60.
I've got a byte defined in my zero page, as so:
; variable/data section
MY_ZEROPAGE: SECTION SHORT
;Transmit enabled flag. Controls transmission over RS-485
gbSGTE: DS.B 1
;...other variables not relevant to my post.
And in my code, which is later in the same file, I've got a branch using gbSGTE:
BRCLR 0, gbSGTE, \@FINISH ;Skip transmitting if not enabled.
This gives me A13003, Value truncated to one byte, even though the generated machine code is correct, at least in the debugger it looks correct. MY_ZEROPAGE is definitely in the zero page, as when I look at the assembly in the debugger, all the variables declared in MY_ZEROPAGE have addresses below $ff.
The problem is with gbSGTE, not \@FINISH, which is only +19 from the branch instruction. I can continue working for now, as it's 'only' a warning, and like I said the generated machine code turns out fine, so it's just annoying, but I would obviously like to get rid of it.
I understand that labels are 16-bit by default, but I would think that if you explicitly declare SECTION SHORT, that wouldn't be a problem. Is there a way I can force it to interpret gbSGTE as an 8-bit label?