I am suffering a similar level of pain right now. I wrote about ~18,000 lines of Z80 assembly language (w/ ~5000 lines of comments) in the past few months. I can feel the pace of development slowly grinding down, because each new feature or refactoring requires the manual testing of the previous features that have already been added to the app. In other words, my development process has become O(N^2).
I feel like I will be forced to create some sort of testing framework at some point, to have any hope of extending the app beyond a certain level of complexity. But I currently have no idea how that can be done in an assembly language project. So I am trying to delay the inevitable for as long as possible.
(The dev environment is the TI-83+ and TI-84+ series of calculators using the Z80 processor, if you are curious.)
To test. You just need some sort of means to set up the call to your subroutine, call your subroutine, and and then check the results of memory or registers after the return. The code sample posted by spec476 is good example. If your assembler doesn’t have such a feature, you either need a conditional assembly directive or a way to cut your routine out of your assembly file and blend it with your test with something like Python or a ruby
I had to read this a couple of times, but in the end it seems that unit testing wasn't in the cards and through some hard thinking he arrived at the bug fix he needed.
if your assembler has an include mechanism or at least conditional compilation I could see how you could do unit testing. Like we did in the good old days before we saw the pattern of JUnit and and frameworks
I feel like I will be forced to create some sort of testing framework at some point, to have any hope of extending the app beyond a certain level of complexity. But I currently have no idea how that can be done in an assembly language project. So I am trying to delay the inevitable for as long as possible.
(The dev environment is the TI-83+ and TI-84+ series of calculators using the Z80 processor, if you are curious.)
https://mos.datatra.sh/guide/unit-testing.html
[1] https://mos.datatra.sh/guide/unit-testing.html
[2] Some thoughts on the assembler running unit tests: https://boston.conman.org/2023/11/29.2