HP-15C: Fixing the CHS and Stack Lift Bug +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html) +--- Forum: General Forum (/forum-4.html) +--- Thread: HP-15C: Fixing the CHS and Stack Lift Bug (/thread-5321.html) |
HP-15C: Fixing the CHS and Stack Lift Bug - Thomas Klemm - 07-21-2022 05:16 AM Based on the source of Nonpareil I wrote a romdump program that reads a ROM and writes the corresponding assembler code. But it currently works only for the nut-processor familly. Please find the source code to compile the romdump utility in the attached zip-file. Contents Code: Archive: romdump.zip Instructions I assume that you have make installed. Otherwise just compile and link the files manually. Code: make Usage ./romdump 15c.obj Output 00000: 0000 nop 00000: 0717 ?c goto 00071 00001: 0116 c=0 w 00002: 1160 sel ram 00003: 1070 rdreg 8 00004: 1356 ? c<>0 w 00005: 0417 ?c goto 00046 00006: 0101 ?nc call 24020 00007: 0240 sel p 00010: 0441 ?nc call 01510 00011: 0014 ? s=0 3 00012: 0156 ab ex w 00013: 1404 s=0 1 00014: 0604 s=0 11 00015: 0645 ?nc goto 00151 00016: 0002 a=0 p 00017: 0000 nop … 33760: 1534 pt= 12 33761: 1042 c=c+1 p 33762: 1740 rtn 33763: 0000 nop 33764: 0000 nop 33765: 0000 nop 33766: 0000 nop 33767: 0000 nop 33770: 0000 nop 33771: 0000 nop 33772: 0000 nop 33773: 0000 nop 33774: 0000 nop 33775: 0000 nop 33776: 0000 nop Designation of Origin Both files dis_nut.h and dis_nut.c were copied as is from nonpareil-0.78. The function trim_trailing_whitespace was copied from util.c. Both functions parse_hex and nut_parse_object_line were copied from proc_nut.c. The typedef rom_word_t stems from proc.h. The function read_object_file is based on sim_read_object_file from proc.c. But instead of using sim_write_rom the function nut_disassemble_inst is used to print the line. Also I removed code that seemed not necessary for the task. Caveat I just quickly cobbled this together but hope it is still useful. Please ignore the first line of the output. Also the last line is missing. But I didn't bother to fix this. |