Code: Select all
for i in range(5):
rts_code_ptr(0x8e18+i, 0x8e1d+i)
Code: Select all
for i in range(5):
rts_code_ptr(0x8e18+i, 0x8e1d+i)
Code: Select all
from commands import *
from trace import *
import acorn
load(0x8000, "nfs-3.34.rom", "6502")
move(0x0400, 0x934c, 0x300)
set_output_filename("nfs334.6502")
comment(0x8000, "*****************************************************")
comment(0x8000, "If patching for Master 128, set the following:")
comment(0x8000, "econet_station_id = &2000 (or any address you choose)")
comment(0x8000, "econet_INTOFF = &fe38")
comment(0x8000, "econet_INTON = &fe3c")
comment(0x8000, "*****************************************************")
blank(0x8000)
acorn.bbc()
acorn.is_sideways_rom()
no_automatic_comment(0x81e9)
comment(0x81e9, "Comment removed")
no_automatic_comment(0x8208)
no_automatic_comment(0x820b)
no_automatic_comment(0x8215)
no_automatic_comment(0x8218)
Code: Select all
org &8000
; *****************************************************
; If patching for Master 128, set the following:
; econet_station_id = &2000 (or any address you choose)
; econet_INTOFF = &fe38
; econet_INTON = &fe3c
; Sideways ROM header
; &8000 referenced 2 times by &048b, &9bb8
<---SNIP--->
.c81e6
jsr print_message_and_fall_through ; 81e6: 20 3b 85 ;.
; Comment removed
; overlapping: eor l0063 ; 81e9: 45 63 Ec
equs "Econet Station " ; 81e9: 45 63 6f... Eco
lda l0d62 ; 81f8: ad 62 0d .b.
jsr sub_c85af ; 81fb: 20 af 85 ..
lda #&20 ; ' ' ; 81fe: a9 20 .
bit econet_adlc_address_1 ; 8200: 2c a1 fe ,..
beq c8212 ; 8203: f0 0d ..
jsr print_message_and_fall_through ; 8205: 20 3b 85 ;.
; overlapping: jsr l6f4e ; 8208: 20 4e 6f No
equs " No Clock" ; 8208: 20 4e 6f... No
; overlapping: jsr l6c43 ; 820b: 20 43 6c Cl
nop ; 8211: ea .
; &8212 referenced 1 time by &8203
.c8212
jsr print_message_and_fall_through ; 8212: 20 3b 85 ;.
; overlapping: ora la00d ; 8215: 0d 0d a0 ...
equb &0d, &0d ; 8215: 0d 0d ..
Code: Select all
# Avoid adding the same comment multiple times at the same address
for entry in annotations[binary_addr]:
if entry.as_string(binary_addr) == new_comment.as_string(binary_addr):
return
Code: Select all
hook_subroutine(0x853b,"print_message_and_fall_through", stringhiz_hook)
Code: Select all
label(0x853b, "print_message_and_fall_through")
Code: Select all
label(addr,"label")
expr(addr1, make_lo("label"))
expr(addr1+2, make_hi("label"))
Code: Select all
def mllh(addr, label, lo_ref, hi_ref=None): # mllh notionally stands for make_label_lo_hi
if hi_ref is None:
hi_ref = lo_ref + 2
label(addr, label)
expr(lo_ref, make_lo(label))
expr(hi_ref, make_hi(label))
mllh(0x9d94, "l9d94", 0x9d8e)
mllh(0x9db2, "l9db2", 0x9dac)
...
Code: Select all
from commands import *
from trace import *
import acorn
def mllh(addr, label, lo_ref, hi_ref=None): # mllh notionally stands for make_label_lo_hi
if hi_ref is None:
hi_ref = lo_ref + 2
label(addr, label)
expr(lo_ref, make_lo(label))
expr(hi_ref, make_hi(label))
load(0x8000, "NFS-3.34.rom", "6502")
move(0x0400, 0x934c, 0x300)
set_output_filename("nfs334.6502")
Code: Select all
py8dis>python nfs334.py > nfs334.asm
Traceback (most recent call last):
File "nfs334.py", line 60, in <module>
mllh(0x9d94, "l9d94", 0x9d8e)
File "nfs334.py", line 8, in mllh
label(addr, label)
TypeError: 'str' object is not callable
Code: Select all
def mllh(addr, label_name, lo_ref, hi_ref=None): # mllh notionally stands for make_label_lo_hi
if hi_ref is None:
hi_ref = lo_ref + 2
label(addr, label_name)
expr(lo_ref, make_lo(label_name))
expr(hi_ref, make_hi(label_name))