I've started my journey through the K&R2, into the wonderful world of C. My main interest with the language, at this time, is making tools for my game. I had an idea for a first project that I feel would be a great aid in coding, and wondered if others felt similarly, or if there is already available a tool for this purpose. This is my overview for the project:
6502 Assembly Formula Tester – My First C Programming Project
by darryl.revok
The goal of this project is to create a tool to aid in the writing of software programs utilizing the 6502 machine language.
In designing routines, I often spend a lot of time on paper with various examples of data, in order to test formulas. This is time-consuming and prone to errors on edge cases, because it only tests a small number of possibilities. I would like to design a piece of software which will take a series of instructions for 6502 assembly, and perform calculations in the same manner, returning all results with a variety of options. In order to support the type of instructions that would require testing in an actual workflow, the software will need to support all 6502 instructions. It must also allow for an arbitrary number of arguments.
The software should include support for testing various conditions and alerting the user upon errors. Given a piece of code wherein a programmer may want to test 256 input values for an arbitrary number of arguments, with various states of flags, against all other conditions, it would not be practical to read through the output to search for outlying results. In this case, a user should be able to create a test which would flag any inappropriate values. Tests such as {vScrollLo >= 240} would show if the equation produced a value which exceeded the vertical bounds of the screen. It should be possible to test {sameValue[carrySet] != sameValue[carryClear]} to ensure that the carry has been properly considered.
If the user desires to test the output of a function with only one argument, all 256 options could be displayed on the screen easily for more thorough assessment. Two arguments may be reasonable to view in an output file, but any more than that would most likely have little practical use for human examination.
At times, a formula may have a limited number of possible argument values. In an instance where the number input will only range from 0-15, or only multiples of 16, testing all 256 variations for that argument would improperly display error flags. The program needs to be able to specify a series of values for any arguments it will test. It should also be able to specify whether the carry status is clear, set, or unknown when entering the routine.
As my first project, this application will initially be a command-line tool. However, I feel the design of the program would be best suited in a GUI environment, where it could sit side-by-side with a code editor and allow for rapidly pasting code, setting conditions, and debugging routines. If the program gains much use, I would like to consider an extended project of making a simple cross-platform GUI environment for the tool.
The program will be developed as a free-software project for use by anyone for essentially any purpose. I feel that it will be a great tool in helping 6502 programmers write better code, debug faster, and ease the transition into binary math for new programmers. It will also make edge case errors much less likely when any possible data can be tested.