diff options
| author | uvok | 2026-01-14 17:57:37 +0100 |
|---|---|---|
| committer | uvok | 2026-01-14 17:57:37 +0100 |
| commit | b9923e600058348f1272bd99bc9b93350509c6aa (patch) | |
| tree | cf419ea04aee7a432b5352893b8e46755e70f9ba | |
| parent | a9c33e208773f14b70b1028bec8d54b3577a6277 (diff) | |
cb: lint1
| -rwxr-xr-x | nandgame/assembler/createbin.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/nandgame/assembler/createbin.py b/nandgame/assembler/createbin.py index 9f1105d..e2497cd 100755 --- a/nandgame/assembler/createbin.py +++ b/nandgame/assembler/createbin.py @@ -7,25 +7,25 @@ nandgame instructions, skip reserved bits. """ # ENDIANNESS = 'big' -ENDIANNESS = "little" +endianness = "little" def main(): with open("allins.bin", "wb") as f: ins = 0x0000 # ldi A, 0 - f.write(ins.to_bytes(2, byteorder=ENDIANNESS)) + _ = f.write(ins.to_bytes(2, byteorder=endianness)) 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): # 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 @@ -33,8 +33,8 @@ import sys if __name__ == "__main__": if len(sys.argv) == 2: if sys.argv[1] in ["little", "le"]: - ENDIANNESS = "little" + endianness = "little" elif sys.argv[1] in ["big", "be"]: - ENDIANNESS = "big" - print(f"Use Endianness: {ENDIANNESS}") + endianness = "big" + print(f"Use Endianness: {endianness}") main() |
