From f28819d2889288f3a7090476df970c18321b203e Mon Sep 17 00:00:00 2001 From: BalkisJerad Date: Sat, 21 Mar 2026 20:54:39 +0100 Subject: [PATCH] Gestion DT --- Epreuve3.py | 18 ++++++------------ test_bin_epreuve3/call_label.bin | Bin 12 -> 8 bytes test_bin_epreuve3/cmp_val.bin | 2 +- test_bin_epreuve3/db1.bin | Bin 25 -> 26 bytes test_bin_epreuve3/db2.bin | 2 +- test_bin_epreuve3/db3.bin | 2 +- test_bin_epreuve3/db4.bin | 2 +- test_bin_epreuve3/jeq_label.bin | Bin 8 -> 9 bytes test_bin_epreuve3/jlt_label.bin | Bin 8 -> 9 bytes test_bin_epreuve3/jmp_label.bin | Bin 8 -> 10 bytes test_bin_epreuve3/ldr_label.bin | Bin 8 -> 9 bytes test_bin_epreuve3/mov_reg.bin | 2 +- test_bin_epreuve3/mov_val.bin | 2 +- test_bin_epreuve3/out.bin | 2 +- test_bin_epreuve3/pop.bin | 2 +- test_bin_epreuve3/str_label.bin | Bin 8 -> 9 bytes test_bin_epreuve3/sub_reg.bin | 2 +- test_bin_epreuve3/sub_val.bin | 2 +- test_bin_epreuve3/tim.bin | Bin 8 -> 9 bytes 19 files changed, 16 insertions(+), 22 deletions(-) diff --git a/Epreuve3.py b/Epreuve3.py index f6876d0..68ca609 100644 --- a/Epreuve3.py +++ b/Epreuve3.py @@ -70,12 +70,10 @@ class Simulator: extra_cycles = 0 # pour LDR/STR/TIM # --- instructions 2 octets à opcode fixe --- - #print(pc_before) - #print(self.program_size) - if c.after_ret: - instr = f"DB 0x{b:02X}" + #if c.after_ret: + # instr = f"DB 0x{b:02X}" - elif b == 0x00: # CALL _label + if b == 0x00: # CALL _label addr = self.fetch_byte() size = 2 instr = f"CALL {addr}" @@ -206,14 +204,10 @@ class Simulator: pause_ms = mult * (v + 1) c.cycles += pause_ms # modélisation de la pause - # if pc_before >= self.program_size: - # if 32 <= b <= 126: - # instr = f"DB 0x{b:02X} ('{chr(b)}')" - # else: - # instr = f"DB 0x{b:02X}" else: - instr = f"UNKNOWN 0x{b:02X}" - c.running = False + instr = f"DB 0x{b:02X}" + # instr = f"UNKNOWN 0x{b:02X}" + # c.running = False diff --git a/test_bin_epreuve3/call_label.bin b/test_bin_epreuve3/call_label.bin index a223f5021a35708fc118eda8f44bf079f0cea8da..5b92d77c2f19e43fce8a6399c477121174b2c99e 100644 GIT binary patch literal 8 PcmZQzWngb$U}^vW0@48w literal 12 TcmZQzYhd7PU|?=wU}yjU3#9@R diff --git a/test_bin_epreuve3/cmp_val.bin b/test_bin_epreuve3/cmp_val.bin index b183244..e1640aa 100644 --- a/test_bin_epreuve3/cmp_val.bin +++ b/test_bin_epreuve3/cmp_val.bin @@ -1 +1 @@ -azBX09 \ No newline at end of file +azBX09 \ No newline at end of file diff --git a/test_bin_epreuve3/db1.bin b/test_bin_epreuve3/db1.bin index 137b09d6bcccce70fa46311c7c2e35274bb27f0b..23c340b1dd618b1d86b91b170186f55c24f49d1e 100644 GIT binary patch delta 6 Ncmb1?njp#8000Cl0bT$A delta 4 Lcmb1=oFEAR0q_9b diff --git a/test_bin_epreuve3/db2.bin b/test_bin_epreuve3/db2.bin index e85d5b4..5f69d72 100644 --- a/test_bin_epreuve3/db2.bin +++ b/test_bin_epreuve3/db2.bin @@ -1 +1 @@ -abcdefghijklmnopqrstuvwxyz \ No newline at end of file +abcdefghijklmnopqrstuvwxyz \ No newline at end of file diff --git a/test_bin_epreuve3/db3.bin b/test_bin_epreuve3/db3.bin index a6860d9..4d5ee4e 100644 --- a/test_bin_epreuve3/db3.bin +++ b/test_bin_epreuve3/db3.bin @@ -1 +1 @@ -ABCDEFGHIJKLMNOPQRSTUVWXYZ \ No newline at end of file +ABCDEFGHIJKLMNOPQRSTUVWXYZ \ No newline at end of file diff --git a/test_bin_epreuve3/db4.bin b/test_bin_epreuve3/db4.bin index ad47100..309392f 100644 --- a/test_bin_epreuve3/db4.bin +++ b/test_bin_epreuve3/db4.bin @@ -1 +1 @@ -0123456789 \ No newline at end of file +0123456789 \ No newline at end of file diff --git a/test_bin_epreuve3/jeq_label.bin b/test_bin_epreuve3/jeq_label.bin index 2cbf7d2c559c5d3b7cee1151f6ca41b6643eef97..da7e1d96992c72f7a97f462f5031439b547c5e69 100644 GIT binary patch literal 9 QcmY#jQD9SGQebER00Y$l4FCWD literal 8 PcmY#jQD9SGQeXf80>}W3 diff --git a/test_bin_epreuve3/jlt_label.bin b/test_bin_epreuve3/jlt_label.bin index 63bbe01bd40046ab0188a3dce803edb6eb93d2fb..66c8c0d28ae2c70dcd41c84175de4f2aba54cfb6 100644 GIT binary patch literal 9 QcmX@Wa)9js(*cGC020*$jQ{`u literal 8 PcmX@Wa)9js(*Xtm4@d(I diff --git a/test_bin_epreuve3/jmp_label.bin b/test_bin_epreuve3/jmp_label.bin index d0ecd957100da084a86f8c0a24c1cfc217c2ecff..ebf59a1d98cdce6e23179b4b786026ceb784aaa8 100644 GIT binary patch literal 10 RcmZ=@abR;`a^P%e000R60u}%O literal 8 PcmZ=@abR;`a$o=e1xNu6 diff --git a/test_bin_epreuve3/ldr_label.bin b/test_bin_epreuve3/ldr_label.bin index dcbedf99b9b4ab433b6b04d3f72335d0df6c944e..ff695d728401fde6ee4bb43adf4bfb82895fcfc4 100644 GIT binary patch literal 9 QcmdnUvW;yw(;kKf01@K@YXATM literal 8 PcmdnUvW;yw(;fx@4tN6V diff --git a/test_bin_epreuve3/mov_reg.bin b/test_bin_epreuve3/mov_reg.bin index bc3d563..34ab926 100644 --- a/test_bin_epreuve3/mov_reg.bin +++ b/test_bin_epreuve3/mov_reg.bin @@ -1 +1 @@ -PQRSTUVWXYZ[\]^_ \ No newline at end of file +PQRSTUVWXYZ[\]^_ \ No newline at end of file diff --git a/test_bin_epreuve3/mov_val.bin b/test_bin_epreuve3/mov_val.bin index 1a8aede..26a05f6 100644 --- a/test_bin_epreuve3/mov_val.bin +++ b/test_bin_epreuve3/mov_val.bin @@ -1 +1 @@ -azBX09 \ No newline at end of file +azBX09 \ No newline at end of file diff --git a/test_bin_epreuve3/out.bin b/test_bin_epreuve3/out.bin index d96c762..4aaac42 100644 --- a/test_bin_epreuve3/out.bin +++ b/test_bin_epreuve3/out.bin @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/test_bin_epreuve3/pop.bin b/test_bin_epreuve3/pop.bin index ddadce8..22c982c 100644 --- a/test_bin_epreuve3/pop.bin +++ b/test_bin_epreuve3/pop.bin @@ -1 +1 @@ -`abc \ No newline at end of file +`abc \ No newline at end of file diff --git a/test_bin_epreuve3/str_label.bin b/test_bin_epreuve3/str_label.bin index 2e2e047a0ec6d200b31d7674ff0f7f11ba77e52b..86b480206f04cdf9e4c957cb3d945c32e2dac0e0 100644 GIT binary patch literal 9 QcmXS9DPyZC33vhP diff --git a/test_bin_epreuve3/sub_reg.bin b/test_bin_epreuve3/sub_reg.bin index f86b4cd..df06edf 100644 --- a/test_bin_epreuve3/sub_reg.bin +++ b/test_bin_epreuve3/sub_reg.bin @@ -1 +1 @@ - \ No newline at end of file +߀ \ No newline at end of file diff --git a/test_bin_epreuve3/sub_val.bin b/test_bin_epreuve3/sub_val.bin index 6e1a122..f915c71 100644 --- a/test_bin_epreuve3/sub_val.bin +++ b/test_bin_epreuve3/sub_val.bin @@ -1 +1 @@ -azBX09 \ No newline at end of file +azBX09 \ No newline at end of file diff --git a/test_bin_epreuve3/tim.bin b/test_bin_epreuve3/tim.bin index 3a5ceabafddcd3c35e560f9c44792f2f9592d941..557ec282c735c4cf64be46bc82622ed70768ecca 100644 GIT binary patch literal 9 Qcmeyt@PqM3!;k+B02|E(;Q#;t literal 8 Pcmeyt@PqM3!;k*}73>9J