Please take note of the following problem in using C compiler NC30WA V.3.00 Release 2 (with assembler and integrated tool manager TM) for the M16C/60 and M16C/20 series of microcomputers. On Transferring 4-Bit Data Words
Problem
Describing bit fields of 4 bits wide in a program results in generating incorrect codes.
Conditions
This problem occurs if the following three conditions are satisfied:
A bit field of 4 bits wide is assigned to a variable.
A transfer source is not a bit field of type far.
A transfer destination is a variable of 1 byte wide and not a register
Workaround
Temporarily transfer the bit field to a temporary register variable (compile the source program using the "-fER" option)
[Example]
-----------------------------------------------------------------
register char c;
char cc;
c=bit.b0 <-- Bit field of 4 bits wide
cc=c;
-----------------------------------------------------------------