Page 268 - Introduction to Microcontrollers Architecture, Programming, and Interfacing of The Motorola 68HC12
P. 268
8,8 Summary 245
Classes can be used in a different way to simplify programming rather complex
6812 I/O systems. Some basic routines, available in a library of classes, will be needed
to initialize the device, to exchange data with the device, or to terminate a device's use.
These routines can be put into operating systems as device drivers. Alternatively, they
can be implemented as classes. Then as larger systems are implemented, such as PLUGS,
that use the device, new classes can be defined as derived classes of these existing classes,
to avoid rewriting the methods inherited from the classes in the library.
8.8 Summary
This chapter gives some background in C and C++, so that the next chapter can illustrate
how each C or C++ expression or mechanism can be assembled into 6812 assembly
language, which we dwell on in the next chapter. We will also include C or C++
programs to illustrate data structures, arithmetic operations, and I/O operations in the
remaining chapters. This chapter has served to give you enough background to be able to
fully appreciate the points to be made in the remaining chapters.
Do You Know These Terms?
See the end of chapter 1 for instructions.
compiler break statement macro superclass
high-level while statement Huffman code root class
language do while binary tree inheritance
optimizing statement data member overriding
compiler for statement function members factoring
interpreter define statement encapsulate polymorphism
tokens enum statement object virtual
procedure structure allocator viable
declaration of a struct constructor information
parameter or a linked list destructor hiding
variable structure deallocator public
cast array allocate protected
statement row major blessing private
relational table new template class
operators call by value derived class operator
logical operators return statement subclass overloading
case statement prototype base class