Skip to content
Chysn edited this page Jan 28, 2022 · 2 revisions

To execute a subroutine, first set your memory conditions with the Memory Editors, and your register conditions with the Register Tool, then execute the subroutine with the Go Tool:

.G [addr]

where addr is a valid 16-bit hexadecimal address. If addr is not provided, execution will begin from the current 6502 program counter.

Upon return from the subroutine with RTS, the register display will be shown.

If the code hits BRK instead of RTS, BRK will appear above the register display. In this case, you may continue code execution two bytes after the BRK with

.G

Note: Use caution when using Go when the subroutine returns with RTS. A proper return address may not be on the stack, and the result is undefined.

Differences Between Go and SYS

Go is designed to behave like you added a breakpoint to the RTS of a subroutine, without having to explicitly set the breakpoint. SYS behaves like SYS.

SYS allows a graceful exit, while Go shows the register display.

Go enables wAx's BRK trapping, while SYS has no impact on the state of the BRK trapping system.

If you're generating unit tests with wAx in BASIC, you'll want to use SYS. If you want to immediately see the register and memory results of a subroutine, you may want to use Go.