13.07.2013 Views

EECE 259 - Lab 5 - Using The Assembler and Debug Monitor.pdf

EECE 259 - Lab 5 - Using The Assembler and Debug Monitor.pdf

EECE 259 - Lab 5 - Using The Assembler and Debug Monitor.pdf

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Using</strong> Break Points<br />

Breakpoints are another powerful debugging technique. A breakpoint can be set<br />

at an address in memory where a chosen instruction is stored. You can then run<br />

the program at full speed, but when that instruction (the one you have set a<br />

breakpoint at) is reached, the program will stop, display the 68000 registers <strong>and</strong><br />

enter single step mode so you can trace/single step the program from that point.<br />

Up to 8 separate breakpoints can be set at 8 different instructions (they are all<br />

cleared when you press reset or execute the breakpoint kill comm<strong>and</strong>)<br />

Let’s set a break point at the third instruction in our program, the JMP $00800000<br />

instruction that makes our programs loop. To do this, enter the debugger<br />

Breakpoint SET comm<strong>and</strong> ‘BS’ <strong>and</strong> enter the address 0080000C. You should see<br />

the following<br />

Now run the program by pressing ‘G’. When the program reaches the JMP<br />

instruction, it will print @BREAKPOINT <strong>and</strong> stop (see below).<br />

You can now single step the program from here by hitting the space bar

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!