-
Notifications
You must be signed in to change notification settings - Fork 2
To execute a subroutine, first set your memory conditions with the Memory Editor, and your register conditions with the Register Editor, then execute the subroutine with
.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 G when the subroutine returns with RTS. A proper return address may not be on the stack, and the result is undefined.
G 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 G shows the register display.
G 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 G.
SYS takes a decimal literal or variable address, while G takes a hexadecimal address literal.