The Command Pointer - Chysn/VIC20-wAx2 GitHub Wiki

wAx keeps track of the address after the last operation for assembly, lists, almost everything. This address, called the Command Pointer, can be inserted into your code with the asterisk (*). This is especially useful when using BASIC programs for assembly. So instead of writing this:

10 .A 1800 LDA #"J"
20 .A 1802 JSR $FFD2
30 .A 1805 BRK

you can write this:

10 .A 1800 LDA #"J"
20 .A *    JSR $FFD2
30 .A *    BRK

You may view the address of the Command Pointer with the Symbol tool with no address:

.@

You may set the address of the Command Pointer by using the * tool:

 5 *1800
10 .A * LDA #"J"
20 .A * JSR $FFD2
30 .A * BRK

An asterisk is replaced with the Command Pointer address in wAx commands, except within quoted strings. If, for some reason, you use it as an operand, remember to use $:

.A 1800 JSR $CB1E
.A 1803 JMP $*

The CP Variable

When the Command Pointer is changed during execution of a BASIC program, wAx sets the CP variable. For example

10 .M 1000 1200
20 PRINT "END:",CP-1

Note that CP is set to the next address that would have been used, so CP-1 will be the last address that wAx used.