Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import random
- #x = random.randint(0, 2 ** 100)
- #y = random.randint(0, 2 ** 100)
- x = 600000000000000000000000000000000
- y = 170000000000000000000000000000000
- z = x + y
- with open("C:\\emu8086\\FLOPPY_0", "wb") as fileFirst:
- x_bytes = ((x.bit_length() - 1) // 8 + 1)
- fileFirst.write(x.to_bytes(x_bytes, byteorder="little", signed=False))
- with open("C:\\emu8086\\FLOPPY_1", "wb") as fileSecond:
- y_bytes = ((y.bit_length() - 1) // 8 + 1)
- fileSecond.write(y.to_bytes(y_bytes, byteorder="little", signed=False))
- print("Wait emu")
- input()
- with open("C:\\emu8086\\FLOPPY_2", "rb") as fileRes:
- res = fileRes.read()
- res_int = int.from_bytes(res, byteorder="little", signed=False)
- print(z, " ",res_int )
- if res_int == z:
- print("Ok")
- else:
- print("Fail")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement