Post Reply 
HP-15C: Fixing the CHS and Stack Lift Bug
07-21-2022, 10:16 AM
Post: #26
RE: HP-15C: Fixing the CHS and Stack Lift Bug
Please find the source code to compile the romdump utility in the attached zip-file.

Contents

Code:
Archive:  romdump.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
       96  07-21-2022 10:44   Makefile
      962  10-31-2006 07:26   dis_nut.h
     6695  10-31-2006 07:26   dis_nut.c
     2482  07-21-2022 11:56   romdump.c
---------                     -------
    10235                     4 files

Instructions

I assume that you have make installed.
Otherwise just compile and link the files manually.

Code:
make
cc    -c -o dis_nut.o dis_nut.c
cc    -c -o romdump.o romdump.c
cc -o romdump dis_nut.o romdump.o

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.


Attached File(s)
.zip  romdump.zip (Size: 4.12 KB / Downloads: 24)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HP-15C: Fixing the CHS and Stack Lift Bug - Thomas Klemm - 07-21-2022 10:16 AM



User(s) browsing this thread: 7 Guest(s)