
No.M16C-55-0006
( 5 / 5 )
Function Mnemonic
BCLR, BNOT, BSET, BTSTC, BTSTS
Shift ROLC, RORC, ROT, SHA, SHL
Arithmetic ABS, ADC, ADCF, ADD, DEC, EXTS, INC, MUL, MULU, NEG,
SBB, SUB
Bit manipulation
Logical AND, NOT, OR, XOR
Jump ADJNZ, SBJNZ
#pragma ADDRESS UDF 0384h
char near UDF;
void func(void)
{
UDF = 0x01 ;
}
‘Image of extract’
MOV.B #01h, UDF
(1)
struct bit_def {
char b0:1;
char b1:1;
char b2:1;
char b3:1;
char b4:1;
char b5:1;
char b6:1;
char b7:1;
};
union byte_def{
struct bit_def bit;
char byte;
};
#pragma ADDRESS UDF 0384h
char near UDF;
#pragma BIT UDF_RAM
union byte_def UDF_RAM=0 ; /*Initial data*/
#define TA0UD_RAM UDF_RAM.bit.b0
#define TA1UD_RAM UDF_RAM.bit.b1
#define TA2UD_RAM UDF_RAM.bit.b2
#define TA3UD_RAM UDF_RAM.bit.b3
#define TA4UD_RAM UDF_RAM.bit.b4
#define TA2P_RAM UDF_RAM.bit.b5
#define TA3P_RAM UDF_RAM.bit.b6
#define TA4P_RAM UDF_RAM.bit.b7
void func(void);
void func(void)
{
TA0UD_RAM = 1 ;
UDF = UDF_RAM.byte ;
}
‘Image of extract’
BSET TA0UD_RAM
MOV.B UDF_RAM, UDF
(2)
Table 10. Instruction table for Read Modify Write
3. C language programming
Figure 3 shows an example using C programming
Figure 3. Example for C programming
Comentarios a estos manuales