-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJustfile
More file actions
51 lines (43 loc) · 1.98 KB
/
Copy pathJustfile
File metadata and controls
51 lines (43 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Build/test pipeline for an RK86 disassembly project.
#
# Workflow:
# 1. Drop the original tape file into tape/<NAME>.<EXT>.
# 2. `just initial` — extract <NAME>.bin from the tape envelope.
# 3. `just disasm` — produce <NAME>.asm via linear disassembler.
# 4. Edit <NAME>.asm by hand, splitting code/data and adding labels.
# 5. `just ci` — assemble and byte-diff against tape/<NAME>.<EXT>.
# Empty diff = green. Run after every edit.
#
# Customise NAME and EXT for your tape file. ORG is the load
# address printed by tobin.py during `just initial`. PAD is the
# off-by-N count for this tape (see playbook/common-pitfalls.md
# "End-address off-by-N in tape headers"). Compute it from
# tobin.py's output: `wrote N bytes` minus `declared payload M
# bytes`. N=2 is the most common; N=1 also occurs; N=0 (no
# padding) for clean tapes.
NAME := "SPACE"
EXT := "RK" # one of: rk, rkr, pki, gam
ORG := "0x0100" # update to match the file header
PAD := "2" # off-by-N padding (default 2; set 1 / 0 if needed)
ext := lowercase(EXT)
ci: build test
build:
bunx asm8080 --split -l --trailer-padding {{ PAD }} --format {{ ext }} {{ NAME }}.asm
test:
xxd tape/{{ NAME }}.{{ EXT }} >tape/{{ NAME }}.{{ EXT }}.hex
xxd {{ NAME }}.{{ ext }} >{{ NAME }}.{{ ext }}.hex
diff tape/{{ NAME }}.{{ EXT }}.hex {{ NAME }}.{{ ext }}.hex
# Convert the tape file (envelope + trailer) to a raw binary file.
# Run this once when starting a new disassembly.
initial:
uv run tobin.py tape/{{ NAME }}.{{ EXT }}
mv tape/{{ NAME }}.bin {{ NAME }}.bin
# Linear disassembly. Re-run if the .bin changes (rarely needed).
# Beware: re-running overwrites your annotated .asm — commit first.
disasm:
python3 disasm.py {{ NAME }}.bin {{ ORG }} >{{ NAME }}.asm
clean:
rm -f {{ NAME }}.bin {{ NAME }}.{{ ext }} {{ NAME }}.bin.hex
rm -f {{ NAME }}.{{ ext }}.hex {{ NAME }}.lst {{ NAME }}.sym
rm -f {{ NAME }}.map {{ NAME }}.json
rm -f tape/{{ NAME }}.{{ EXT }}.hex