From 87e878548d475c21999a2be1a0aaa89485d5ede2 Mon Sep 17 00:00:00 2001 From: uvok Date: Mon, 12 Jan 2026 19:49:04 +0100 Subject: py: Reformat files with black --- nandgame/assembler/createbin.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'nandgame/assembler/createbin.py') 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() - -- cgit v1.2.3