diff options
| author | uvok | 2026-01-12 19:49:04 +0100 |
|---|---|---|
| committer | uvok | 2026-01-12 19:52:26 +0100 |
| commit | 87e878548d475c21999a2be1a0aaa89485d5ede2 (patch) | |
| tree | b9be8a85777aadc1593bbc48472dd37e9680de57 /nandgame/assembler/createbin.py | |
| parent | 8912777281a8fee34254d2c070d922836660c208 (diff) | |
py: Reformat files with black
Diffstat (limited to 'nandgame/assembler/createbin.py')
| -rwxr-xr-x | nandgame/assembler/createbin.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/nandgame/assembler/createbin.py b/nandgame/assembler/createbin.py index c8559a5..9f1105d 100755 --- a/nandgame/assembler/createbin.py +++ b/nandgame/assembler/createbin.py @@ -6,25 +6,27 @@ or rather, 15-bit, to have valid nandgame instructions, skip reserved bits. """ -#ENDIANNESS = 'big' -ENDIANNESS = 'little' +# ENDIANNESS = 'big' +ENDIANNESS = "little" + def main(): with open("allins.bin", "wb") as f: - ins=0x0000 + ins = 0x0000 # ldi A, 0 - f.write(ins.to_bytes(2, byteorder = ENDIANNESS)) + f.write(ins.to_bytes(2, byteorder=ENDIANNESS)) - ins=0x00ff + ins = 0x00FF # ldi A, 255 - f.write(ins.to_bytes(2, byteorder = ENDIANNESS)) + f.write(ins.to_bytes(2, byteorder=ENDIANNESS)) - for ins in range(0x8000, 0xffff + 1): + for ins in range(0x8000, 0xFFFF + 1): # unused bytes, force 1 if (ins & 0x6800) != 0x6800: continue - f.write(ins.to_bytes(2, byteorder = ENDIANNESS)) + f.write(ins.to_bytes(2, byteorder=ENDIANNESS)) + import sys @@ -36,4 +38,3 @@ if __name__ == "__main__": ENDIANNESS = "big" print(f"Use Endianness: {ENDIANNESS}") main() - |
