]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/matita/contribs/ng_assembly/emulator/status/HC08_status.ma
(no commit message)
[helm.git] / helm / software / matita / contribs / ng_assembly / emulator / status / HC08_status.ma
diff --git a/helm/software/matita/contribs/ng_assembly/emulator/status/HC08_status.ma b/helm/software/matita/contribs/ng_assembly/emulator/status/HC08_status.ma
new file mode 100755 (executable)
index 0000000..8c6ab8f
--- /dev/null
@@ -0,0 +1,84 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||M||                                                             *)
+(*      ||A||       A project by Andrea Asperti                           *)
+(*      ||T||                                                             *)
+(*      ||I||       Developers:                                           *)
+(*      ||T||         The HELM team.                                      *)
+(*      ||A||         http://helm.cs.unibo.it                             *)
+(*      \   /                                                             *)
+(*       \ /        This file is distributed under the terms of the       *)
+(*        v         GNU General Public License Version 2                  *)
+(*                                                                        *)
+(**************************************************************************)
+
+(* ********************************************************************** *)
+(*                          Progetto FreeScale                            *)
+(*                                                                        *)
+(*   Sviluppato da: Ing. Cosimo Oliboni, oliboni@cs.unibo.it              *)
+(*   Sviluppo: 2008-2010                                                  *)
+(*                                                                        *)
+(* ********************************************************************** *)
+
+include "num/word16.ma".
+
+(* *********************************** *)
+(* STATUS INTERNO DEL PROCESSORE (ALU) *)
+(* *********************************** *)
+
+(* ALU dell'HC08/HCS08 *) 
+nrecord alu_HC08: Type ≝
+ {
+ (* A: registo accumulatore *)
+ acc_low_reg_HC08 : byte8;
+ (* X: registro indice parte bassa *)
+ indX_low_reg_HC08 : byte8;
+ (* H: registro indice parte alta *)
+ indX_high_reg_HC08 : byte8;
+ (* SP: registo stack pointer *)
+ sp_reg_HC08 : word16;
+ (* PC: registro program counter *)
+ pc_reg_HC08 : word16;
+ (* V: flag overflow *)
+ v_flag_HC08 : bool;
+ (* H: flag semi-carry (somma nibble basso) *)
+ h_flag_HC08 : bool;
+ (* I: flag mascheramento degli interrupt mascherabili: 1=mascherati *)
+ i_flag_HC08 : bool;
+ (* N: flag segno/negativita' *)
+ n_flag_HC08 : bool;
+ (* Z: flag zero *)
+ z_flag_HC08 : bool;
+ (* C: flag carry *)
+ c_flag_HC08 : bool;
+ (* IRQ: flag che simula il pin esterno IRQ *)
+ irq_flag_HC08 : bool
+ }.
+
+notation "{hvbox('A_Reg' ≝ acclow ; break 'X_Reg' ≝ indxlow ; break 'H_Reg' ≝ indxhigh ; break 'Sp_Reg' ≝ sp ; break 'Pc_Reg' ≝ pc ; break 'V_Flag' ≝ vfl ; break 'H_Flag' ≝ hfl ; break 'I_Flag' ≝ ifl ; break 'N_Flag' ≝ nfl ; break 'Z_Flag' ≝ zfl ; break 'C_Flag' ≝ cfl ; break 'IRQ_Flag' ≝ irqfl)}"
+ non associative with precedence 80 for
+ @{ 'mk_alu_HC08 $acclow $indxlow $indxhigh $sp $pc $vfl $hfl $ifl $nfl $zfl $cfl $irqfl }.
+interpretation "mk_alu_HC08" 'mk_alu_HC08 acclow indxlow indxhigh sp pc vfl hfl ifl nfl zfl cfl irqfl =
+ (mk_alu_HC08 acclow indxlow indxhigh sp pc vfl hfl ifl nfl zfl cfl irqfl).
+
+(* ***************** *)
+(* CONFRONTO FRA ALU *)
+(* ***************** *)
+
+(* confronto registro per registro dell'HC08 *)
+ndefinition eq_HC08_alu ≝
+λalu1,alu2:alu_HC08.
+ (eq_b8 (acc_low_reg_HC08 alu1) (acc_low_reg_HC08 alu2)) ⊗
+ (eq_b8 (indX_low_reg_HC08 alu1) (indX_low_reg_HC08 alu2)) ⊗
+ (eq_b8 (indX_high_reg_HC08 alu1) (indX_high_reg_HC08 alu2)) ⊗
+ (eq_w16 (sp_reg_HC08 alu1) (sp_reg_HC08 alu2)) ⊗
+ (eq_w16 (pc_reg_HC08 alu1) (pc_reg_HC08 alu2)) ⊗
+ (eq_bool (v_flag_HC08 alu1) (v_flag_HC08 alu2)) ⊗
+ (eq_bool (h_flag_HC08 alu1) (h_flag_HC08 alu2)) ⊗
+ (eq_bool (i_flag_HC08 alu1) (i_flag_HC08 alu2)) ⊗
+ (eq_bool (n_flag_HC08 alu1) (n_flag_HC08 alu2)) ⊗
+ (eq_bool (z_flag_HC08 alu1) (z_flag_HC08 alu2)) ⊗
+ (eq_bool (c_flag_HC08 alu1) (c_flag_HC08 alu2)) ⊗
+ (eq_bool (irq_flag_HC08 alu1) (irq_flag_HC08 alu2)).