CHAPTER 4 BUS CONTROL FUNCTION
107
User’s Manual U14359EJ4V0UM
[Related global optimization part]
•
1-bit set using bit or
int i;
i ^=1;
•
1-bit clear using bit and
i &= ~1;
•
1-bit not using bit xor
i ^= 1;
•
1-bit test using bit and
if(i & 1);
[Related optimization depending on model part]
Accessing the same variable in a different size
•
Cast
•
Mask
•
Shift
Example
int i, *ip;
char c;
.
.
.
c=*((char*)ip);
.
.
.
c = 0xff & i;
.
.
.
i = (i<<24) >>24;
(b) Restrictions in assembly language
For variables located in the big endian space, a quasi directive that secures an area of other than byte
size (.hword, .word, .float, .shword) cannot be used.