Abstract
Most projects use a high-level language to implement the software
As a foil to assembly-level programming, the C language is introduced as an alternative approach to designing and implementing software. The properties, advantages and disadvantages of both approaches are discussed; with examples using the CCS compiler to illustrate these concepts and techniques. MPLAB with its simulator is used to host this language tool.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
A popular definition of a computer scientist is one who, when presented with a problem to solve, invents a new language instead!
- 2.
In the author’s experience a code size increase factor of ×1.25⋅⋅⋅×2.5 is typical.
- 3.
Originally called UNICS, for UNIplexed operating and Computing System, based on MULTICS (Multiplexed operating and Computing System) an operating system developed in the early 1960s at MIT.
- 4.
The ++ operator has given the name C++ to the next development of the C language.
- 5.
Some of which can be functions hand-coded in native assembly-level language for efficiency, and from libraries supplied with the compiler or bought in.
- 6.
- 7.
MPLAB V. 8 comes with a free CCS compiler for the base-family range of devices.
- 8.
Decimal is the default base in C but beware, because a leading zero is interpreted as octal; e.g., 026 is octal 26 (which is decimal 2×8+6=22).
- 9.
Some compilers either use an unsigned short int or unsigned char to hold an 8-bit datum.
- 10.
Many compilers are unable to distinguish between single bits which use efficient ‘bit twiddling’ instructions and use the less efficient logic instructions; for instance, Version 2 of this compiler.
- 11.
A 2-valued object of this kind is sometimes called a Boolean. In the CCS compiler a short int is a Boolean, but this is unusual.
- 12.
The CCS compiler will usually implement a function called from one point only as in-line code. This is the reason why the function sqr_root() was called from two points from main() in Program 9.2. The directives #INLINE and #SEPARATE can be used to encourage the compiler to implement the following function either as in-line code or as a subroutine.
- 13.
Having a mantissa and exponent of the form m×10e. The CCS compiler uses a 32-bit representation (signed 24-bit mantissa with an offset 127 8-bit mantissa) giving a potential range of approximately −1.5×10−45 to +3.3×1038.
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
Copyright information
© 2010 Springer-Verlag London Limited
About this chapter
Cite this chapter
Katzen, S. (2010). High-Level Language. In: The Essential PIC18® Microcontroller. Computer Communications and Networks. Springer, London. https://doi.org/10.1007/978-1-84996-229-2_9
Download citation
DOI: https://doi.org/10.1007/978-1-84996-229-2_9
Publisher Name: Springer, London
Print ISBN: 978-1-84996-228-5
Online ISBN: 978-1-84996-229-2
eBook Packages: Computer ScienceComputer Science (R0)