SW500010 Microchip Technology, SW500010 Datasheet - Page 75

HI-TECH C PRO FOR PIC10/12/16

SW500010

Manufacturer Part Number
SW500010
Description
HI-TECH C PRO FOR PIC10/12/16
Manufacturer
Microchip Technology
Type
Compilerr
Series
PIC10/12/16r
Datasheets

Specifications of SW500010

Supported Families
PIC10, PIC12, PIC16
Core Architecture
PIC
Software Edition
Professional
Kit Contents
Software And Docs
Mcu Supported Families
PIC10/12/16
Tool Type
Compiler
Lead Free Status / RoHS Status
Not applicable / Not applicable
For Use With/related Products
PIC10, PIC12, PIC14, PIC16, PIC16E
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
Other names
019P
778-1006
778-1006
C Language Features
assigned the pointer with the string "hello world".
3.3.2 Bit Data Types and Variables
HI-TECH C PRO for the PIC10/12/16 MCU Familysupports bit integral types which can hold the
values 0 or 1. Single bit variables may be declared using the keyword bit. bit objects declared
within a function, for example:
will be allocated in the bit-addressable psect rbit, and will be visible only in that function. When
the following declaration is used outside any function:
init_flag will be globally visible, but located within the same psect.
by using the bit keyword in the functions prototype in the usual way. The bit return value will be
returning in the carry flag in the status register.
only contain the values 0 and 1, and therefore provide a convenient and efficient method of storing
boolean flags without consuming large amounts of internal RAM. It is, however, not possible to
declared pointers to bit variables or statically initialise bit variables.
ever possible, thus the generated code to access bit objects is very efficient.
used. For example, if the bit variable bitvar was assigned as in the following:
it will be cleared by the assignment since the least significant bit of data is zero. If you want to set
a bit variable to be 0 or 1 depending on whether the larger integral type is zero (false) or non-zero
(true), use the form:
Bit variables cannot be auto or parameters to a function. A function may return a bit object
Bit variables behave in most respects like normal unsigned char variables, but they may
Operations on bit objects are performed using the single bit instructions (bsf and bcf) wher-
Note that when assigning a larger integral type to a bit variable, only the least-significant bit is
const char * cp = "hello " "world";
static bit init_flag;
bit init_flag;
int data = 0x54;
bit bitvar;
bitvar = data;
bitvar = data != 0;
Supported Data Types and Variables
75

Related parts for SW500010