Download C Compiler V3 user's Guide

Transcript
C Compiler V3 user's Guide
Table of Contents
Introduction........................................................................................................... 7
Version................................................................................................................... 7
Chapter 1 C language........................................................................................... 8
1.1 Data types, operators and expressions...................................................................................8
1.1.1 C Data types.....................................................................................................................8
1.1.2 Constant and Variable......................................................................................................9
1.1.3 C Language Operation Introduction................................................................................12
1.2 Functions...............................................................................................................................14
1.2.1 Function declaration and definition.................................................................................14
1.2.3 Function Call...................................................................................................................16
1.2.4 Main Function.................................................................................................................18
1.2.5 Standard Library.............................................................................................................18
1.3 Pointer and Array..................................................................................................................18
1.3.1 Array Definition, Initialization and Usage........................................................................18
1.3.2 Multidimensional Array....................................................................................................19
1.3.3 String and End Flag........................................................................................................19
1.3.4 Pointer............................................................................................................................19
1.3.5 Pointer Data Type...........................................................................................................19
1.3.6 Pointer Operation............................................................................................................19
1.3.7 Differences between array name and pointer.................................................................21
1.4 Structure, Union and Enumeration........................................................................................22
1.4.1 Using Structure, Union and Enumeration.......................................................................22
1.4.2 Differences between Structure and Union......................................................................23
1.5 Differences between Preprocessor, Macro definition and Inline function..............................23
1.6 Flow Control..........................................................................................................................25
1.6.1 Three Execution Flow.....................................................................................................25
1.6.2 Using of, if and switch.....................................................................................................25
1.6.3 Loop and nested-looping................................................................................................26
1.6.4 break and continue.........................................................................................................26
1.6.5 goto statement................................................................................................................27
1.7 Scope....................................................................................................................................28
Chapter 2 C compiler V3 Expansion and Limitation....................................... 29
2.1 Holtek C compiler V3 settings in the HT-IDE3000................................................................29
2.1.1 Operation environment...................................................................................................29
2.1.2 Building a new project use Holtek C V3 compiler...........................................................29
2.1.3 After opening the project, how to use the Holtek C V3 compiler ....................................30
2.1.4 Project Compiler Option settings....................................................................................30
2.1.5 Linker options.................................................................................................................32
2.2 C compiler V3 Extended syntax and function.......................................................................34
2.2.1 Interrupt Service Routines..............................................................................................34
2.2.2 Absolute variable............................................................................................................35
Rev. 1.00
3
December 26, 2014