AT28C256-rpi-util/makerom.py
2023-10-26 19:01:14 +02:00

18 lines
496 B
Python

code = bytearray([0xa9, 0x69]) # lda 0x69
code += bytearray([0x8d, 0x00, 0x00]) # sta 0x0000
code += bytearray([0xa9, 0x42]) # lda 0x42
code += bytearray([0x8d, 0x00, 0x00]) # sta 0x0000
code += bytearray([0x4c, 0x00, 0x80]) # jmp 0x80000
rom = code + bytearray([0xea] *(32768 - len(code)))
rom[0x7ffc] = 0x00 # beim reset program counter auf 0x8000 (entspricht 0x00 auf dem EEPROM)
rom[0x7ffd] = 0x80
with open("rom.bin", "wb") as file:
file.write(rom)