Let's pretend we got a wAx cartridge from my Etsy shop. How about translating the well known "Coloured Birds" example of the VIC User's Manual (see p. 41) to machine language?
If this intro seems familiar, it's because I'm using Mike's VICMON sessions to compare the wAx workflow to the VICMON workflow. After all, I've used VICMON for my projects, and I had VICMON's weaknesses fully in my sights as I developed the wAx assembler. So I'm going to go through Mike's first two projects in the first two posts here, the "Birds" and "Bouncing Ball" BASIC examples.
Code: Select all
1 A$="{BLK,WHT,RED,CYN,PUR,GRN,BLU,YEL}"
2 N=INT(RND(1)*8)+1
3 B$=MID$(A$,N,1)
4 PRINTB$"{SHIFT-U,SHIFT-Q,SHIFT-I,SHIFT-J,SHIFT-Q,SHIFT-K}"
5 GOTO2
At first, we need to take care of the two strings in the program. Fortunately, wAx makes it really easy to enter strings as data. Simply include the strings in double quotes with the Assemble (@) tool.
Like Mike's example, the VIA #2 timer will be sufficient to generate a random number. We likewise get the low byte, then mask off the lowest three bits to get an index to the color characters. Then, we use that index (as X) to print the color with the CHAROUT KERNAL routine ($FFD2), then print the bird string the same way. Then we check for the STOP key and, if it's not pressed, we go back to the start.
Also shown is wAx's syntax to save the program. Note that the device is the last one used, so you can switch to tape with LOAD+STOP, or by setting the location $BA with
@00BA :01
Below, the run is shown. You may use the left arrow to start an ML program with a hex address, or you can use SYS. There are some key differences between the left arrow and SYS. In this case, we're using left arrow because it turns on BRK handling:
Note that you never leave the BASIC environment with wAx. In the next project, we'll use some slightly more advanced features.