
- •General
- •Introduction
- •Legal
- •Installation
- •Installing for DOS/Windows
- •Installing for AmigaOS
- •Tutorial
- •The Frontend
- •Usage
- •The Compiler
- •General Compiler Options
- •Errors and Warnings
- •Data Types
- •Optimizations
- •Register Allocation
- •Flow Optimizations
- •Common Subexpression Elimination
- •Copy Propagation
- •Constant Propagation
- •Dead Code Elimination
- •Loop-Invariant Code Motion
- •Strength Reduction
- •Induction Variable Elimination
- •Loop Unrolling
- •Function Inlining
- •Intrinsic Functions
- •Unused Object Elimination
- •Alias Analysis
- •Inter-Procedural Analysis
- •Cross-Module Optimizations
- •Instruction Scheduling
- •Debugging Optimized Code
- •Pragmas
- •Register Parameters
- •Inline-Assembly Functions
- •Variable Attributes
- •Type Attributes
- •__typeof
- •__offsetof
- •Known Problems
- •Credits
- •Additional options
- •Small data
- •Small code
- •FPUs
- •Math
- •Stack
- •Known problems
- •PowerPC Backend
- •Additional options for this version
- •Stack
- •Stdarg
- •Known problems
- •DEC Alpha Backend
- •Additional options for this version
- •Stdarg
- •i386 Backend
- •Additional options for this version
- •Stdarg
- •Known Problems
- •c16x Backend
- •Additional options for this version
- •Stdarg
- •Known Problems
- •Additional options for this version
- •Stack
- •Stdarg
- •Known Problems
- •Instruction Scheduler
- •Introduction
- •Usage
- •Known problems
- •C Library
- •Introduction
- •Legal
- •Embedded Systems
- •Startup
- •Heap
- •Input/Output
- •Floating Point
- •Useless Functions
- •Linking/Locating
- •Startup
- •Floating point
- •Stack
- •Small data model
- •Restrictions
- •Minimal startup
- •amiga.lib
- •auto.lib
- •extra.lib
- •ixemul
- •Introduction
- •Legal
- •Usage
- •Startup
- •Floating point
- •Stack
- •Small data model
- •Restrictions
- •libamiga.a
- •libauto.a
- •libextra.a
- •WarpOS/PPC
- •Startup
- •Floating point
- •Stack
- •Restrictions
- •amiga.lib
- •auto.lib
- •extra.lib
- •MorphOS/PPC
- •Floating point
- •Stack
- •Small data model
- •Restrictions
- •libamiga.a
- •libauto.a
- •libextra.a
- •List of Errors
- •Backend Interface
Chapter 9: 68hc12 Backend |
61 |
9 68hc12 Backend
This chapter documents the Backend for the 68hc12 microcontroller family.
Note that this backend is not done!
9.1 Additional options for this version
This backend provides the following additional options:
‘-merge-constants’
Place identical floating point constants at the same memory location. This can reduce program size and increase compilation time.
‘-const-in-data’
By default constant data will be placed in a read-only section. Using this option it will be placed in the data section.
‘-no-delayed-popping’
By default arguments of function calls are not always popped from the stack immediately after the call, so that the arguments of several calls may be popped at once. With this option vbcc can be forced to pop them after every function call. This may simplify debugging and very slightly reduce the stack size needed by the compiled program.
‘-no-peephole’
Do not perform peephole-optimizations.
‘-mem-cse’
Try to hold values loaded from memory in registers and reuse them. Due to the small register-set of the hc12 this is disabled by default as it increases registerpressure and tends to spill to the stack.
9.2 ABI
The current version generates assembly output for use with the GNU assembler using the non-banked model.
This backend supports the following registers:
−d for the accumulator (also used for byte, i.e. a)
−x for index register x
−y for index register y
−sp for the stack-pointer
All registers are scratch (i.e. caller-save).
The first function arguments which has integer or pointer types is passed in the accumulator d or the register pair d/x. The remaining arguments are passed on the stack.
Integers and pointers are returned in d or d/x. All other types are returned by passing the function the address of the result as a hidden argument - so when you call such a function without a proper declaration in scope you can expect a crash.
The elementary data types are represented like:
62 |
vbcc manual |
type |
size in bits |
alignment in bytes |
char |
8 |
1 |
short |
16 |
2 |
int |
16 |
2 |
long |
|
currently not supported |
near pointers |
16 |
2 |
far pointers |
|
currently not supported |
huge pointers |
|
currently not supported |
float |
|
currently not supported |
double |
|
currently not supported |
9.3 Target-specific variable-attributes
The hc12-backend o ers the following variable attributes:
__interrupt
Return with rfi rather than blr.
__section("name","attr")
Place this function/object in section "section" with attributes "attr".
9.4 Predefined Macros
This backend defines the following macros:
__HC12__
9.5 Stack
If the ‘-stack-check’ option is used, every function-prologue will call the function __stack_ check with the stacksize needed by this function in register y. This function has to consider its own stacksize and must restore all registers.
9.6 Stdarg
To be written...
9.7 Known Problems
− this backend is far from done...