|Re: Input wanted|
Message #18 Posted by Neil Hamilton (Ottawa) on 23 June 2011, 1:37 p.m.,
in response to message #17 by Gene wright
You might want to give the WP-34s assembler/disassembler a try for this. There will be a bunch of examples go online tonight in the 'library' directory and I hope to see a manual by the weekend. The mnemonic syntax is the hardest thing but you can generate a reference table by using the following (undocumented) command:
$ ./trunk/tools/wp34s_asmp.pl -syntax syntax.lst
$ more syntax.lst
You might find the tool useful in 2 ways:
1) If you have already loaded the programs into the calculator, you can download the images from memory (emulator or actual calculator) and convert them to an ASCII source listing (which I am calling *.wp34s) for archive, distribution, or program merging:
$ ./trunk/tools/wp34s_asm.pl -dis wp34s-0.dat > myProgs.wp34s
These source listings should also be immune to "opcode creep" as I am starting to call it. :-) Once your programs are in this form, if the opcodes evolve, you just reassemble with the current assembler. The assembler will be continually updated as part of the development process to use the latest opcode map by default. The tool can also read in historical opcode maps to convert between opcode revisions by specifying an older map (which you must have on hand -- usually just a SVN effort). Thus you can bring an old flash image "forward" by disassembling it using the old opcode map it was written under (you need the calculator's current 'VERS' number for this) and then reassembling it using the new map.
2) You can also assemble one or more ASCII source files into a single concatenated flash image (subject to the flash 506 word limit, of course) which can then be uploaded to either the emulator or calculator. This will allow you to have a library of programs that you load on a case-by-case basis.
$ ./trunk/tools/wp34s_asm.pl myProg1.wp34s [myProg2.wp34s [myProg3.wp34s ...]] -o wp34s-1.dat
If you can't wait for the weekend to try it :-), let me know and I'll give you a boost.
The help screen combined with the stuff that will go up tonight in the 'library' directory should get you a fair distance down the road.
$ ./trunk/tools/wp34s_asm.pl -h
You do need Perl on your system to run it but that is not such a big stretch. Info will be forthcoming if that presents some problems.