Ajout .bin comme param à simulateur_front
This commit is contained in:
parent
5359c5178d
commit
d0038394da
@ -18,4 +18,5 @@ _loop:
|
||||
JMP _loop
|
||||
|
||||
_end:
|
||||
MOV R0 'A' ;11100000 01000001
|
||||
RET
|
||||
@ -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")
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user