This is a cache of https://vccplus.brianholman.com/manuals/inside-the-coco-3/trace/. It is a snapshot of the page as it appeared on 2026-11-21T00:01:35.640+0000.
Read the few instructions that mattered · Inside the CoCo 3 — Hardware and Debugging · VCC Plus
← Manual LibraryVCC Plus 3.7.1 · Reading on the web

Try the exercises in VCC Plus. Example links download files here; open them in the app to work beside the emulator.

The complete book · PDF editionBook 10: Inside the CoCo 3 — Hardware and Debugging

27 pages · VCC Plus 3.7.1 · Keep a copy to read or print.

Download PDF
Contents

Chapter 3 of 7

Read the few instructions that mattered

The two memory windows showed what changed during a store. How did $40 get into A in the first place? A trace keeps a record as the machine runs, so you can inspect a past instruction after BASIC has already returned. Give the recorder a start and an end. Otherwise this tiny program can disappear among thousands of instructions spent waiting for a key.

Arm a short capture

  1. In Assembly Development, use the supplied pixel-mask.asm. Remove the source stop from store, on line 8. Set it on shift, on line 7, and Run again. The only source stop for this pass should be shift.
  2. In the machine debugger verify Paused, PC $3F06, A $81. If your addresses differ after an edit, use those for shift and done in your current listing.
  3. Choose Trace. Enter 64 for Sample limit, 3F06 for Start at, and 3F09 for Stop before. Leave Screen events and Scheduler events off for this short run. Start New replaces the previous capture, so export an earlier trace first if you want to keep it.
  4. Choose Start New, then Continue. The program executes its shift, stores the byte and returns to BASIC. The trace status should say Stop address reached (before instruction). The emulator can now show Running and a PC somewhere in ROM. Click the CoCo display, type PRINT 27, and press Return. New BASIC input works while the recorded samples remain available.

Read an instruction from beginning to end

Select the LSRA sample at $3F06. Look in the detail area below the table. The two register lines belong to the selected instruction. An initial sample can also show $3F06 when resuming from a breakpoint. Pick the row where the before and after PC differ and the cycle count is two.

Selected instruction Before After Instruction cycles in this lab
LSRA PC $3F06, A $81 PC $3F07, A $40, carry set 2
STA ,X PC $3F07, A $40, X $3F0A PC $3F09, A $40, X $3F0A 4
The trace is complete and the emulator is running. The selected LSRA sample shows two instruction cycles, with PC changing from 3F06 to 3F07 and A from 81 to 40.

Double-check the instruction name as well as the address when locating STA ,X. The table can contain several kinds of events at one PC. The unchanged A and X on the store row are exactly what you saw in chapter 1. The trace gives you the instruction, its operands and its register states. The before-and-after memory check supplies a separate observation of the destination byte.

Account for the extra rows

In the pictured capture the CPU completed the shift, then received an IRQ before it executed the store. You can see IRQ requested, IRQ servicing and IRQ vector, followed by instructions at other addresses. The interrupt handler eventually gave the interrupted code its turn again. Find STA ,X by address and mnemonic lower in the list. Another run can have fewer rows, or service the interrupt at a different boundary. The order of the program’s shift and store stays the same.

The Master clock column places events on the emulated machine’s timeline. The detail beneath the selected instruction gives that instruction’s CPU-cycle count. Use the latter to compare the 2 and 4 above. The elapsed time on your Mac also includes the emulator, its windows and your time reading them. It cannot measure the cost of a CoCo instruction.

A sample limit reached before the desired stop, a previous capture still displayed, and a stray breakpoint can all produce a plausible-looking short list. Check the capture status, the start and stop addresses, and that you chose Start New before Continue. If needed, re-arm from the source stop and allow more samples. Once you have the two instruction rows, remove the source stop from shift. You can now use the machine for the BASIC graphics lab.

Original VCC Plus manuals © 2026 Brian K. Holman. Third-party references retain their authors’ copyrights and licenses. Artwork notices. Edition 3.7.1; source and export identity. Printable edition: PDF source and export identity.

A closer look

Open original