Ajout .bin comme param à simulateur_front

This commit is contained in:
BalkisJerad 2026-03-22 03:23:43 +01:00
parent 5359c5178d
commit d0038394da
2 changed files with 21 additions and 8 deletions

View File

@ -18,4 +18,5 @@ _loop:
JMP _loop
_end:
MOV R0 'A' ;11100000 01000001
RET

View File

@ -3,6 +3,7 @@ from tkinter import *
import tkinter as tk
import Epreuve3 as e3
import subprocess
import sys
root = tk.Tk()
# Widgets are added here
@ -149,12 +150,6 @@ label_sp.pack(pady=5)
#val = subprocess.run(["/usr/bin/python3", "/home/aurelien/Documents/24hducode2026/24H_du_code_2026/Epreuve3.py", "test_bin_epreuve3/call_label.bin"] # transforme bytes en str)
with open("test_bin_epreuve3/cmp_reg.bin", "rb") as f:
program = f.read()
sim = e3.Simulator(program)
sim_iter = sim.run()
previous_sp = None # Initialisation avant la première itération
def update_gui():
@ -200,5 +195,22 @@ def update_gui():
#Frame RAM
update_gui()
root.mainloop()
# ---------------------------------------------------------
# LECTURE D'UN FICHIER .bin ET LANCEMENT
# ---------------------------------------------------------
if __name__ == "__main__":
# Nom du fichier binaire à exécuter
path =""
args= sys.argv
if (len(args) > 1):
filename = args[1]
print("filename: " + filename)
with open(filename, "rb") as f:
program = f.read()
sim = e3.Simulator(program)
sim_iter = sim.run()
update_gui()
root.mainloop()
else:
print("Needs *.bin as parameter")