← 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 9: Assembly Language Programming for the VCC Plus CoCo 3

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

Download PDF
Contents

Chapter 8 of 8

Deliver the receiver

Imagine handing your program to someone who has only a CoCo and Disk BASIC. They cannot open your source files and click Run. They can load a binary from a floppy. In this chapter you build a single executable from two source files, catch the call where they meet, and give your reader two ways to run the finished disk.

Open the whole project

Save the Dispatch project, expand the ZIP in a working folder, and open Develop → Assembly Development…. Choose File → Open Project Folder… inside that window and select the folder containing these four files. Start with the Disk BASIC profile at its prompt and an MC6809 assembler target. Use a personal copy of any mounted media.

File Its job
main.asm Supplies the entry point, packet, expected checksum, destination buffer and screen output.
receive.asm Copies bytes and computes their checksum. The caller supplies X, Y and B.
vccplus-assembly.json Identifies the entry source, additional module and linker script for VCC Plus.
layout.link Places the combined code at hexadecimal 3F00 and selects the symbol start as the entry.

The two assembly files each name a section called code. Read the first few lines of each. The display module imports receive, promising to find its definition in another object. The routine exports that name, allowing the linker to resolve it. The files can agree on an address and still disagree about what the routine expects. Find the instructions in the caller that satisfy all three inputs in the comment above receive.

Move the code and keep the source stop

Try this on a separate copy of the entire project. In layout.link change the first line from section code load 3f00 to section code load 4100. Leave the second line, entry start, alone. Save, then Assemble. Before looking at Symbols, predict the second module's new address from the length of the first module.

The source stops are still the CLRA in receive.asm and the comparison in main.asm. Set them if you opened a fresh copy. On Run, the same CLRA now stops at $4140. The stack contains 41 0D. Continue to $410D and check A before finishing. The linker changed the absolute target of JSR to $4140. The packet and its PC-relative load moved together, so their displacement stayed the same. Neither a source stop nor a symbolic operand required you to type an address into the instructions.

The two tested placements are for this short program in the lab's fresh Disk BASIC session. Choosing a new load address also means finding space the guest can spare. A writable address can still contain a BASIC program or another routine you need.

Hand someone a disk

Return to the unmodified $3F00 project. The Export menu offers the DECB binary by itself and a floppy image containing that binary. A loose binary is useful for emulator quickload. Make two new images now to test what someone can do at a guest prompt.

  1. Choose Export → Export Disk Image…. Enter DISPATCH as the Disk BASIC filename, leave Install DOS bootloader clear, choose Choose Location…, and save as Dispatch-plain.dsk. The eight-letter guest name and the Mac filename serve different purposes.
  2. Open the floppy controls. Preserve anything you need from the current FD0 disk and mount your new image in FD0. At the fresh Disk BASIC prompt, type DIR and press Return. Look for DISPATCH BIN. Enter LOADM"DISPATCH":EXEC. LOADM puts the records into their assigned addresses and records the entry point. EXEC transfers control there. The greeting for an intact packet is ORB.
  3. Export again with the same guest name. This time select Install DOS bootloader and save the new image as Dispatch-boot.dsk. Mount this image in FD0. Type DOS on its own. Watch the line underneath it as the loader supplies the full Disk BASIC command. You can still enter LOADM"DISPATCH":EXEC yourself on this disk.
Disk BASIC lists DISPATCH BIN. After DOS, the bootloader supplies LOADM"DISPATCH":EXEC; the receiver prints ORB and BASIC displays OK.

The drive starts the same machine-language program either way. The source stops from the Assembly workspace belong to its direct debugging session. For the disk test, judge success at the CoCo screen. After the final OK, enter PRINT 2+3. Seeing 5 proves that the program returned with BASIC able to accept and execute another command.

A handoff you can repeat

Give a developer the four project files together. Give someone who wants to run the program the DSK, the required Disk BASIC profile, FD0, the name DISPATCH, and the exact launch command. Identify whether that particular disk has the optional bootloader. Include the expected output and how control returns.

If the project assembles but does not stop where expected, compare its current Symbols map with the source file and instruction you selected. If DIR lists the wrong contents, check which image is in FD0 before changing any source. If the disk outputs CHECK, it has already loaded and started the receiver. Look at the packet and checksum of the project you exported. Those observations separate a build problem, a mounting problem and a working program reporting damaged input.

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