This is a cache of https://vccplus.brianholman.com/manuals/your-first-6809-programs/letter/. It is a snapshot of the page as it appeared on 2026-11-21T00:00:59.295+0000.
Send a letter to the screen · Your First 6809 Programs · 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 7: Your First 6809 Programs

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

Download PDF
Contents

Chapter 2 of 5

Send a letter to the screen

A register can hold a letter, provided the program and the screen agree on a code for it. The CoCo already knows how to print a character. Give its output routine one byte and watch where the letter appears.

Change the message with one keystroke

  1. In the assembly window choose File → Save a Copy… and save my-letter.asm. Choose File → Open Source… and open that copy. Check the selected filename before you edit.
  2. In the first LDA, change just the A following the quote to uppercase Z. Leave the A in LDA alone. Choose File → Save Source, then Debug from Entry. At the first instruction click Step once.
  3. The footer should now show PC $3F02 and A $5A. Which part of the assembled instruction changed when you chose a new letter? Open Build details → Listing. The two bytes in the original were 86 41. The edited instruction uses 86 5A.
  4. Choose Continue. Look for Z on the CoCo. The same ROM routine just printed a different letter. If the output is still A, check which document is selected and compare its assembled bytes with the two above.
The CoCo screen shows Z on its own line, followed by the BASIC prompt, after running the edited character program.

Read the square brackets

CHROUT      equ     $a002       ; Address of the ROM character-output vector.
CR          equ     13          ; Carriage return starts a fresh line.

CHROUT names $A002. At that address the CoCo stores a two-byte address pointing to its character-output routine. An address used like this is called a vector. On JSR [CHROUT], the processor first finds the address stored at CHROUT and then calls the routine there. The brackets tell the processor to take that extra look. The character itself travels in A.

If you Step while JSR is highlighted, the PC follows that call into the ROM. The assembly window can say no verified source line because the instructions at the new address belong to the CoCo’s ROM. Choose Continue to finish. You’ll soon write a subroutine of your own, where both the call and the code it reaches appear in the same source file.

You’ve sent a character out of the CoCo. Next you’ll give a player a chance to send one back.

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