wAxpander with wAx2
Moderator: Moderators
- chysn
- Vic 20 Scientist
- Posts: 1204
- Joined: Tue Oct 22, 2019 12:36 pm
- Website: http://www.beigemaze.com
- Location: Michigan, USA
- Occupation: Software Dev Manager
Re: wAxpander with wAx2
I haven't made changes to the codebase in a while, as it's been pretty reliable. But I did find a bug that could stop partial filename search from working in VICE. It affects VICE specifically because it involves a buffer overwrite caused by the long pathnames that VICE tends to have when virtual devices are used. In hardware, there's not much opportunity for this bug to manifest.
While I was fixing that issue, I made one usability change to the Register Editor that I've always wanted to do. I've never been at the point where I can mentally parse a processor status byte without looking up which bit belongs to which flag, then doing hex math in my head. I know my limitations. And so:
I don't know if this'll help others, but a proper processor flag display will help me a lot. I'm going to spend a few weeks proving the new updates out before committing the changes to cartridges.
(Don't let the set Decimal flag make you nervous. There are safeguards in place )
While I was fixing that issue, I made one usability change to the Register Editor that I've always wanted to do. I've never been at the point where I can mentally parse a processor status byte without looking up which bit belongs to which flag, then doing hex math in my head. I know my limitations. And so:
I don't know if this'll help others, but a proper processor flag display will help me a lot. I'm going to spend a few weeks proving the new updates out before committing the changes to cartridges.
(Don't let the set Decimal flag make you nervous. There are safeguards in place )
- chysn
- Vic 20 Scientist
- Posts: 1204
- Joined: Tue Oct 22, 2019 12:36 pm
- Website: http://www.beigemaze.com
- Location: Michigan, USA
- Occupation: Software Dev Manager
Re: wAxpander with wAx2
Updated wAx 2.1 info. Please see below...
Last edited by chysn on Sat Oct 28, 2023 6:57 pm, edited 1 time in total.
- chysn
- Vic 20 Scientist
- Posts: 1204
- Joined: Tue Oct 22, 2019 12:36 pm
- Website: http://www.beigemaze.com
- Location: Michigan, USA
- Occupation: Software Dev Manager
Re: wAxpander with wAx2
Quick note about some additional features that will be part of the wAx 2.1 release. I'll update the addendum documentation over the weekend, and update the printed manual over the coming weeks. The new things are:
(1) Arithmetic now allows one- or two-nybble hex addition or subtraction, so
(2) The File Tool (F) now allows disk commands to be executed, in addition to directory search. This is done by adding the disk command after F.
(3) The File Tool also allows the current device number to be set by placing the device number (as a hex digit) after F#, e.g., "F#8". This replaces the arcane ".A 00BA:08"
(3) The Character Helper plug-in has been replaced with a plug-in that counts cycles in a routine. The existing binary editor really made the Character Helper kind of redundant.
(1) Arithmetic now allows one- or two-nybble hex addition or subtraction, so
Code: Select all
LDA #"R"+80
STA $45
STA $45+1
(3) The File Tool also allows the current device number to be set by placing the device number (as a hex digit) after F#, e.g., "F#8". This replaces the arcane ".A 00BA:08"
(3) The Character Helper plug-in has been replaced with a plug-in that counts cycles in a routine. The existing binary editor really made the Character Helper kind of redundant.
- chysn
- Vic 20 Scientist
- Posts: 1204
- Joined: Tue Oct 22, 2019 12:36 pm
- Website: http://www.beigemaze.com
- Location: Michigan, USA
- Occupation: Software Dev Manager
Re: wAxpander with wAx2
I like this new feature. Just a few extra bytes, but it looks nice and is useful. Directory entries that are themselves directories will be shown in reverse text. Obviously, this only works for devices that support directories, so not VICE True Drive Emulation or a real 1541.
- chysn
- Vic 20 Scientist
- Posts: 1204
- Joined: Tue Oct 22, 2019 12:36 pm
- Website: http://www.beigemaze.com
- Location: Michigan, USA
- Occupation: Software Dev Manager
Re: wAxpander with wAx2
Note: ? just doesn't work as a wildcard. It shows up as PRINT in BASIC listings, which I knew would happen, but it's really distracting. So the equal sign is wildcard, in both cases where wildcard is relevant.
This is something that I have often wished for. Code search (H addr inst [operand]) could be useful for finding instructions that you know are there. But sometimes I didn't know. Was it an LDX or an LDY? A JMP or a JSR? Well, now code search has a wildcard! It's the question mark* which I'm also using as the "no change" indicator for the register editor.
Register editor syntax is now this, in which ?? means "leave this register as it was."
________________
* Previously tried exclamation point, which is reserved for potential future use; and equal sign, which isn't as good as ?. I just had a tiny detokenization-to-PRINT issue to get out of the way.
This is something that I have often wished for. Code search (H addr inst [operand]) could be useful for finding instructions that you know are there. But sometimes I didn't know. Was it an LDX or an LDY? A JMP or a JSR? Well, now code search has a wildcard! It's the question mark* which I'm also using as the "no change" indicator for the register editor.
Register editor syntax is now this, in which ?? means "leave this register as it was."
________________
* Previously tried exclamation point, which is reserved for potential future use; and equal sign, which isn't as good as ?. I just had a tiny detokenization-to-PRINT issue to get out of the way.
Last edited by chysn on Sat Oct 28, 2023 6:59 pm, edited 1 time in total.
- chysn
- Vic 20 Scientist
- Posts: 1204
- Joined: Tue Oct 22, 2019 12:36 pm
- Website: http://www.beigemaze.com
- Location: Michigan, USA
- Occupation: Software Dev Manager
Re: wAxpander with wAx2
Note: ? just doesn't work as a wildcard. It shows up as PRINT in BASIC listings, which I knew would happen, but it's really distracting. So the equal sign is wildcard, in both cases where wildcard is relevant.
Last edited by chysn on Sat Oct 28, 2023 6:59 pm, edited 1 time in total.
- mathom
- Vic 20 Dabbler
- Posts: 85
- Joined: Wed Aug 07, 2019 11:37 am
- Location: Centennial, CO USA
- Occupation: Software Engineer
Re: wAxpander with wAx2
That is wicked cool! I think it will be very useful for a little reverse engineering project I am working on.
...mathom...
- chysn
- Vic 20 Scientist
- Posts: 1204
- Joined: Tue Oct 22, 2019 12:36 pm
- Website: http://www.beigemaze.com
- Location: Michigan, USA
- Occupation: Software Dev Manager
Re: wAxpander with wAx2
wAx 2.1 is a new release of wAx that includes the following updates:
* Go (the G tool) improves stack integrity for post-BRK continuation.
* The Register Editor can now be used to change the PC, to aid the aforementioned post-BRK continuation.
* The Register Editor now provides syntax to keep any register as it was, without providing a value.
* The Register display now includes visual representation of processor flags, in addition to the processor flag byte value.
* Variable substitution for addresses now allows hexadecimal strings, and substitution in arithmetic.
* Two "illegal" instructions' mnemonics and byte sizes have been changed.
* A buffer overwrite bug, which could prevent partial filename search from working in emulated environments (e.g., VICE) has been remediated.
* Operand arithmetic (+/-) now allows 8-bit operands.
* The File tool has several enhancements.
* The Character Helper plug-in has been replaced with a Cycle Counter plug-in.
* The Code Search now allows wildcard matching.
* Two subroutines (SyntaxErr, SetUserVal) have been added to the API jump table.
Additional details are in the attached Addendum PDF.
If you are one of the 50 or so owners of a wAx cartridge (wAxpander, wAx Block 3 Edition, or wAx Block 5 Edition) and would like this update for hardware, please PM me. The basic idea here is that I'll send you the EPROM or EEPROM chip for $10 (USD) via Venmo, which I'll refund when you send back the old chip. For installation, you need a Phillips screwdriver (to open the case) and a flathead screwdriver (to pry out the current chip).
Or, if you are so equipped, you may burn the chip with the file here: https://github.com/Chysn/VIC20-wAx2/blo ... c/wax2.eep. There are some sample "burn" scripts for Minipro in the root directory. I usually just need to trial-and-error the device name until it works.
If you're not comfortable taking stuff apart, you can send me your cartridge. I'll update it, test it, and send it back at shipping cost. Again, please PM me here for this option.
Oh, and if you don't even have a wAxpander cartridge yet, you can order it from my Etsy store here: https://www.etsy.com/listing/1171784258 ... xe-edition. I'm pretty excited about this update!
* Go (the G tool) improves stack integrity for post-BRK continuation.
* The Register Editor can now be used to change the PC, to aid the aforementioned post-BRK continuation.
* The Register Editor now provides syntax to keep any register as it was, without providing a value.
* The Register display now includes visual representation of processor flags, in addition to the processor flag byte value.
* Variable substitution for addresses now allows hexadecimal strings, and substitution in arithmetic.
* Two "illegal" instructions' mnemonics and byte sizes have been changed.
* A buffer overwrite bug, which could prevent partial filename search from working in emulated environments (e.g., VICE) has been remediated.
* Operand arithmetic (+/-) now allows 8-bit operands.
* The File tool has several enhancements.
* The Character Helper plug-in has been replaced with a Cycle Counter plug-in.
* The Code Search now allows wildcard matching.
* Two subroutines (SyntaxErr, SetUserVal) have been added to the API jump table.
Additional details are in the attached Addendum PDF.
If you are one of the 50 or so owners of a wAx cartridge (wAxpander, wAx Block 3 Edition, or wAx Block 5 Edition) and would like this update for hardware, please PM me. The basic idea here is that I'll send you the EPROM or EEPROM chip for $10 (USD) via Venmo, which I'll refund when you send back the old chip. For installation, you need a Phillips screwdriver (to open the case) and a flathead screwdriver (to pry out the current chip).
Or, if you are so equipped, you may burn the chip with the file here: https://github.com/Chysn/VIC20-wAx2/blo ... c/wax2.eep. There are some sample "burn" scripts for Minipro in the root directory. I usually just need to trial-and-error the device name until it works.
If you're not comfortable taking stuff apart, you can send me your cartridge. I'll update it, test it, and send it back at shipping cost. Again, please PM me here for this option.
Oh, and if you don't even have a wAxpander cartridge yet, you can order it from my Etsy store here: https://www.etsy.com/listing/1171784258 ... xe-edition. I'm pretty excited about this update!
- Attachments
-
- wAx 2.1 Addendum.zip
- (126.46 KiB) Downloaded 180 times
- chysn
- Vic 20 Scientist
- Posts: 1204
- Joined: Tue Oct 22, 2019 12:36 pm
- Website: http://www.beigemaze.com
- Location: Michigan, USA
- Occupation: Software Dev Manager
Re: wAxpander with wAx2
I've been playing around with this idea lately. It's possible to generate relocatable code without using the symbolic features, if you want to avoid the symbol table's modest memory footprint, or put code in the little $2a2-$2ff nook.
One technique is to use offsets from * with arithmetic. Now that wAx 2.1 allows two-digit arithmetic, this idea becomes a lot more flexible. You have to count up the offset values yourself, but this routine is relocatable without using any symbol memory:
Another is to leverage BASIC variables. Here, you're using BASIC RAM instead of the symbol table, calculating high and low bytes of the pointer, and grabbing CP along the way for the install address:
Of course, I'd say it's better to bite the bullet and let wAx manage symbols for you, at the expense of the $02a2 area. But sometimes you just want to use it. If you don't define any symbols, wAx leaves that area entirely untouched.
One technique is to use offsets from * with arithmetic. Now that wAx 2.1 allows two-digit arithmetic, this idea becomes a lot more flexible. You have to count up the offset values yourself, but this routine is relocatable without using any symbol memory:
Another is to leverage BASIC variables. Here, you're using BASIC RAM instead of the symbol table, calculating high and low bytes of the pointer, and grabbing CP along the way for the install address:
Of course, I'd say it's better to bite the bullet and let wAx manage symbols for you, at the expense of the $02a2 area. But sometimes you just want to use it. If you don't define any symbols, wAx leaves that area entirely untouched.
- chysn
- Vic 20 Scientist
- Posts: 1204
- Joined: Tue Oct 22, 2019 12:36 pm
- Website: http://www.beigemaze.com
- Location: Michigan, USA
- Occupation: Software Dev Manager
Re: wAxpander with wAx2
In the interest of closing a QA blind spot, I built a test suite for testing wAx output. That is, when a disassembly or other memory display is requested, is the output accurate, and does it look like it's supposed to?
To build this, I wrote a wAx2 plug-in that temporarily re-routes the CHROUT vector and keeps track of a checksum*. Each test turns the plug-in on, runs a display operation against ROM, and then performs a unit test on the known checksum value. So if I accidentally make any changes to display-related code, such changes should be caught automatically. In addition to the assembly test suite, wAx 2 will need to pass these tests prior to git pushes.
A single test looks like this in BASIC:
If the checksum is wrong (meaning, the output is somehow wrong), I'll get a ?MISMATCH ERROR in line 440, and then I can take a deeper dive.
The = tool (assertion tester) is something I've always found valuable. It takes so little memory, but saves tons of time by automating testing with BASIC scripts, when manual testing could easily become tiresome and error-prone and lacking in coverage.
________________
* EOR each incoming byte with an incrementing value, then add that to a big-endian 16-bit sum. This should catch mistakes like the right characters being out of order. (https://github.com/Chysn/VIC20-wAx2/blo ... 2test2.bas)
To build this, I wrote a wAx2 plug-in that temporarily re-routes the CHROUT vector and keeps track of a checksum*. Each test turns the plug-in on, runs a display operation against ROM, and then performs a unit test on the known checksum value. So if I accidentally make any changes to display-related code, such changes should be caught automatically. In addition to the assembly test suite, wAx 2 will need to pass these tests prior to git pushes.
A single test looks like this in BASIC:
Code: Select all
390 rem **** d ****
400 print "d tool..";
410 .u on
420 .d eabf eb25
430 .u off
440 .=0000 c8ce12
450 print ". {blu}[pass]{blk}"
The = tool (assertion tester) is something I've always found valuable. It takes so little memory, but saves tons of time by automating testing with BASIC scripts, when manual testing could easily become tiresome and error-prone and lacking in coverage.
________________
* EOR each incoming byte with an incrementing value, then add that to a big-endian 16-bit sum. This should catch mistakes like the right characters being out of order. (https://github.com/Chysn/VIC20-wAx2/blo ... 2test2.bas)
- chysn
- Vic 20 Scientist
- Posts: 1204
- Joined: Tue Oct 22, 2019 12:36 pm
- Website: http://www.beigemaze.com
- Location: Michigan, USA
- Occupation: Software Dev Manager
Re: wAxpander with wAx2
Here's the PDF for the wAx 2.1 manual. I went through it all from cover-to-cover, cleaning up little things here and there. I changed the terminology from "wAx API" to "wAx SDK," to more accurately reflect the purpose of the jump table. Most 2.1 features could just be inlined with existing text, so the whole thing wound up only one page longer than its predecessor.
https://github.com/Chysn/VIC20-wAx2/blo ... Manual.pdf
Also available in dead-tree format from Lulu:
https://www.lulu.com/shop/jason-justian ... y7mdp.html
I haven't updated the wiki yet, but that's next.
https://github.com/Chysn/VIC20-wAx2/blo ... Manual.pdf
Also available in dead-tree format from Lulu:
https://www.lulu.com/shop/jason-justian ... y7mdp.html
I haven't updated the wiki yet, but that's next.
-
- Vic 20 Amateur
- Posts: 41
- Joined: Sat Mar 02, 2024 8:57 pm
- Location: Canada
Re: wAxpander with wAx2
This looks incredible, and is exactly the sort of thing I wish I'd had when I was young. I'm sure that's a common sentiment but I'm still going to express it.
I'd like to ask: is there a way I could purchase a copy to use with VICE? I don't have access to a physical VIC, sadly.
Thank you,
Meryt
I'd like to ask: is there a way I could purchase a copy to use with VICE? I don't have access to a physical VIC, sadly.
Thank you,
Meryt
Re: wAxpander with wAx2
What a wonderful set of tools.
Quick question. Have you thought about adding the ability to chain files from disk- to allow assembly of much larger programs?
Quick question. Have you thought about adding the ability to chain files from disk- to allow assembly of much larger programs?
- Mike
- Herr VC
- Posts: 4941
- Joined: Wed Dec 01, 2004 1:57 pm
- Location: Munich, Germany
- Occupation: electrical engineer
Re: wAxpander with wAx2
That should already be possible with one of the established methods to chain programs from CBM BASIC, as wAx2 'merely' operates as BASIC extension. Eventually you will need to propagate the current assembly address, and 'relative' branch targets spanning source files are not supposed to work this way anyway.maguman wrote:Have you thought about adding the ability to chain files from disk- to allow assembly of much larger programs?
Other than that, you would need to make a fork of wAx2 and add the requested feature on your own, because of this.
- Orangeman96
- Vic 20 Hobbyist
- Posts: 116
- Joined: Tue Jan 16, 2024 3:42 pm
- Location: U.S.A.
- Occupation: terran peacekeeper
Re: wAxpander with wAx2
I am not sure if this helps, but the wAx 2.1 Assembler manual discusses user-defined plugins and the wAx SDK from pages 64 through 79. -OGM