|
@@ -0,0 +1,94 @@
|
|
1
|
+# disasm4000sx
|
|
2
|
+
|
|
3
|
+A disassembler for the stack based virtual machine running on a circa 1987 Trimble 4000SX GPS receiver.
|
|
4
|
+
|
|
5
|
+The VM seems to have a lot in common with the UCSD Pascal P-Code virtual machine, with similar classes of instructions, but not similar opcodes. It uses Pascal style strings, which leads me to believe this might have been a commercially sold Pascal implementation.
|
|
6
|
+
|
|
7
|
+I haven't figured out some opcodes yet, but I've figured out enough to determine how many extension bytes each opcode will have so that they don't mess up the disassembly.
|
|
8
|
+
|
|
9
|
+More information can be found here:
|
|
10
|
+
|
|
11
|
+http://beefchicken.com/gps/trimble/4000/sxdeepdive
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+# Building
|
|
15
|
+
|
|
16
|
+This project builds under Go 1.20. Install go, enter the directory of the project, then run `go install`
|
|
17
|
+
|
|
18
|
+# Usage
|
|
19
|
+
|
|
20
|
+The disassembler reads from binary ROM dumps. A ROM dump consists of a directory full of ROM files, and a `map.json` file that instructs the disassembler on how to reassembled the roms. For example:
|
|
21
|
+
|
|
22
|
+ {
|
|
23
|
+ "roms": [
|
|
24
|
+ {
|
|
25
|
+ "file": "U36.rom",
|
|
26
|
+ "start": "0x000000", "end": "0x003FFE",
|
|
27
|
+ "version": "3.30",
|
|
28
|
+ "device": "27C64",
|
|
29
|
+ "checksum": "0x52EA"
|
|
30
|
+ },
|
|
31
|
+ {
|
|
32
|
+ "file": "U44.rom",
|
|
33
|
+ "start": "0x000001", "end": "0x003FFF",
|
|
34
|
+ "version": "3.31",
|
|
35
|
+ "device": "27C64",
|
|
36
|
+ "checksum": "0xD16B"
|
|
37
|
+ },
|
|
38
|
+ {
|
|
39
|
+ "file": "U37.rom",
|
|
40
|
+ "start": "0x090000", "end": "0x09FFFE",
|
|
41
|
+ "version": "3.30",
|
|
42
|
+ "device": "AT27C256R",
|
|
43
|
+ "checksum": "0x2500"
|
|
44
|
+ },
|
|
45
|
+ {
|
|
46
|
+ "file": "U45.rom",
|
|
47
|
+ "start": "0x090001", "end": "0x09FFFF",
|
|
48
|
+ "version": "3.30",
|
|
49
|
+ "device": "AT27C256R",
|
|
50
|
+ "checksum": "0x8E92"
|
|
51
|
+ },
|
|
52
|
+ {
|
|
53
|
+ "file": "U38.rom",
|
|
54
|
+ "start": "0x0A0000", "end": "0x0AFFFE",
|
|
55
|
+ "version": "3.30",
|
|
56
|
+ "device": "AT27C256R",
|
|
57
|
+ "checksum": "0xE240"
|
|
58
|
+ },
|
|
59
|
+ {
|
|
60
|
+ "file": "U46.rom",
|
|
61
|
+ "start": "0x0A0001", "end": "0x0AFFFF",
|
|
62
|
+ "version": "3.30",
|
|
63
|
+ "device": "AT27C256R",
|
|
64
|
+ "checksum": "0x0717"
|
|
65
|
+ }
|
|
66
|
+ ],
|
|
67
|
+ "labels": [
|
|
68
|
+ {"address": "0x0034AA", "label": "CLEARSCREEN"},
|
|
69
|
+ {"address": "0x095BD8", "label": "SLEEP1SECOND"},
|
|
70
|
+ {"address": "0x0034C8", "label": "SETSEGMENTS"}
|
|
71
|
+ ]
|
|
72
|
+ }
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+The disassembler will automatically figure out which ROMs are pairs.
|
|
76
|
+
|
|
77
|
+To run the disassembler:
|
|
78
|
+
|
|
79
|
+`disasm4000sx <path to rom directory>`
|
|
80
|
+
|
|
81
|
+for example
|
|
82
|
+
|
|
83
|
+`disasm4000sx 331`
|
|
84
|
+
|
|
85
|
+# License
|
|
86
|
+
|
|
87
|
+Distributed under the MIT License. See LICENSE.txt for more information.
|
|
88
|
+
|
|
89
|
+# Contact
|
|
90
|
+
|
|
91
|
+Keelan Lightfoot - http://beefchicken.com/contact/
|
|
92
|
+
|
|
93
|
+Project Link: http://code.beefchicken.com/keelan/disasm4000sx
|
|
94
|
+
|