The steps in simulating the task using the file on the PowerPC
simulator are essentially the
same as using the 68K simulator.
- Change the properties of the PowerPC tool to your working
directory before activating the tool.
- Use the FILE | Debug menu option to download the
code to simulate.
- Set a breakpoint at the CRASHPOINT
instruction.
- Examine the Register and Memory
windows as you Step-In (F8) through the code.
You will need to use the Step-in operation as
the start up procedure involves calling your code as a
subroutine (mycode) as was done with the 68K
code.
- Apparently the DIAB DATA assembler does not place enough
information in the object file to enable you to bring up
the source file into the Source window.
You
should also check the following WEB pages to better
understand what you see on the PowerPC simulator screen.
There are whole series of limitations to overcome with
the demo kit release as will be apparent as you look at
the Simulator screen.
- After the running the program, you can examine the
contents of memory address SUM (0x7200)
as you did using the
68K simulator.
Completing Laboratory 1 on the PowerPC simulator
You will have to solve the following problems to complete
Laboratory 1.
- There is an instruction missing.
Modify the code in ppcfinal.s so that your mycode
subroutine correctly returns to the start-up code.
- The final three lines of "ppcfinal.s" place the
value of SUM (0x7200) into register R4
using "C" language masking and downshifts.
Replace this code with the @l and @h
assembler directives. Set a break point at the
STH R3, 0(R4)
instruction and check that the correct value (0x7200)
is loaded into register R4. (Examine the simulator's Register
window.)
- Now set SUM to have the value 0x8200 and
simulate again. Important:- Read this link before simulating.
- You will find that R4 gets set to 0xFFFF8200
rather than 0x8200. (Examine the results of the
two instruction that set R4.
- Explain this problem in terms of the
characteristics of the PowerPC instructions
compared to the 68K instructions.
- How will you fix this problem?
- Use the WIDFI process
and examine how the variable __SP_INIT (stack
pointer init) is manipulated in the
source file "ppcfinal.s".s.
Before you proceed to Laboratory 2, but ONLY IF you have
completed the 3 tasks set out above, print out your "Official PowerPC
assembly language programmer's certificate".
If you try to simulate the code with SUM = 0x8200
you will find that the code will not simulate if you have already
set up your computer environment for Laboratory 2. In the file sstep.ini
you installed in the init directory there is a
line that sets the memory model specification to only use the 8K
bytes of memory from location 0x0000 to 0x7FFF.
Remove that line if you want to simulate Task 1 with SUM
= 0x8000. Replace the line later so that Laboratory 2
will run.
Last modified: July 22, 1996 10:01 PM by M. Smith.
Copyright -- M. R. Smith