
H-2
DINK32 PowerPC ISA Debugger User’s Manual
For More Information On This Product,
Go to: www.freescale.com
MOTOROLA
Explanation
The CC and two assembler commands for metaware are.
CC = /...path.../metaware/bin/hcppc -HL -Hnocopyr -c -Hsds
ASOPTL = -big_si -le
ASL = /...path.../metaware/bin/asppc -c $(ASOPTL)
ASOPTB = -big_si -be
ASB = /...path.../metaware/bin/asppc -c $(ASOPTB)
The order of compilation and linking is.
reset.o
except2l.o
reset1.o
except1.o
go_tr1.o
go_tr2.o
reg_swap.o
All the rest of the C files.
The makefile included in Section H.3.3, “DINKLE V7.0 10/8/97 makefile” is useful to
understand the linking order.
H.3
Explanation
It is critical to understand that the processors and peripheral logic all come out of reset in
Big Endian. Therefore, the first code that is run (this is the reset code located in reset.s and
reset1.s) will be compiled in big endian. The reason the reset vector is separated from the
other code and other exception handlers (found in except2l.s) is that we want to run the
other handlers in LE mode so we will assemble them with our little endian assembler. The
linker will then link the files in the following order: reset.s, except2l.s, reset1.s ....... which
are Big Endian, Little Endian, and Big Endian, respectively. All of the other files are
compiled as little endian.
H.3.1
Two Important Considerations
The first involves the copy algorithm and the second involves the little endian swap code.
H.3.2
Copy Algorithm
In DINK, we copy ROM contents to RAM before jumping to the RAM image. The
compiler has compiled the rest of DINK as "TRUE" little endian. Little endian on
processors that implement the PowerPC architecture is not a "TRUE" little endian but
rather a munged Little Endian scheme (see the
Programming Environments Manual
for
F
Freescale Semiconductor, Inc.
n
.