]> matita.cs.unibo.it Git - helm.git/commitdiff
freescale porting
authorCosimo Oliboni <??>
Fri, 22 Jan 2010 23:15:47 +0000 (23:15 +0000)
committerCosimo Oliboni <??>
Fri, 22 Jan 2010 23:15:47 +0000 (23:15 +0000)
29 files changed:
helm/software/matita/contribs/ng_assembly/depends
helm/software/matita/contribs/ng_assembly/freescale/opcode.ma [deleted file]
helm/software/matita/contribs/ng_assembly/freescale/opcode_base.ma [deleted file]
helm/software/matita/contribs/ng_assembly/freescale/opcode_base_lemmas.ma [deleted file]
helm/software/matita/contribs/ng_assembly/freescale/opcode_base_lemmas1.ma [deleted file]
helm/software/matita/contribs/ng_assembly/freescale/opcode_base_lemmas_instrmode.ma [deleted file]
helm/software/matita/contribs/ng_assembly/freescale/opcode_base_lemmas_opcode.ma [deleted file]
helm/software/matita/contribs/ng_assembly/freescale/table_HC05.ma [deleted file]
helm/software/matita/contribs/ng_assembly/freescale/table_HC05_tests.ma [deleted file]
helm/software/matita/contribs/ng_assembly/freescale/table_HC08.ma [deleted file]
helm/software/matita/contribs/ng_assembly/freescale/table_HC08_tests.ma [deleted file]
helm/software/matita/contribs/ng_assembly/freescale/table_HCS08.ma [deleted file]
helm/software/matita/contribs/ng_assembly/freescale/table_HCS08_tests.ma [deleted file]
helm/software/matita/contribs/ng_assembly/freescale/table_RS08.ma [deleted file]
helm/software/matita/contribs/ng_assembly/freescale/table_RS08_tests.ma [deleted file]
helm/software/matita/contribs/ng_assembly/opcodes/HC05_opcode_base.ma [new file with mode: 0755]
helm/software/matita/contribs/ng_assembly/opcodes/HC05_table.ma [new file with mode: 0755]
helm/software/matita/contribs/ng_assembly/opcodes/HC05_table_tests.ma [new file with mode: 0755]
helm/software/matita/contribs/ng_assembly/opcodes/HC08_opcode_base.ma [new file with mode: 0755]
helm/software/matita/contribs/ng_assembly/opcodes/HC08_table.ma [new file with mode: 0755]
helm/software/matita/contribs/ng_assembly/opcodes/HC08_table_tests.ma [new file with mode: 0755]
helm/software/matita/contribs/ng_assembly/opcodes/HCS08_opcode_base.ma [new file with mode: 0755]
helm/software/matita/contribs/ng_assembly/opcodes/HCS08_table.ma [new file with mode: 0755]
helm/software/matita/contribs/ng_assembly/opcodes/HCS08_table_tests.ma [new file with mode: 0755]
helm/software/matita/contribs/ng_assembly/opcodes/RS08_opcode_base.ma [new file with mode: 0755]
helm/software/matita/contribs/ng_assembly/opcodes/RS08_table.ma [new file with mode: 0755]
helm/software/matita/contribs/ng_assembly/opcodes/RS08_table_tests.ma [new file with mode: 0755]
helm/software/matita/contribs/ng_assembly/opcodes/byte_or_word.ma [new file with mode: 0755]
helm/software/matita/contribs/ng_assembly/opcodes/opcode.ma [new file with mode: 0755]

index fcdbc839b11076e9620bc2ce553f9c6cb7567695..760ac25aa738acc0374c18c4017569009f1c6ff0 100644 (file)
@@ -1,14 +1,16 @@
 freescale/multivm_lemmas.ma common/nat_lemmas.ma freescale/multivm.ma
 freescale/status.ma freescale/opcode_base.ma memory/memory_abs.ma
 common/prod_lemmas.ma common/prod.ma num/bool_lemmas.ma
+opcodes/RS08_table.ma common/list.ma opcodes/RS08_opcode_base.ma opcodes/byte_or_word.ma
 num/bool.ma common/theory.ma
 freescale_tests/micro_tests10.ma freescale/multivm.ma freescale/status_lemmas.ma freescale_tests/micro_tests_tools.ma
 freescale/table_HCS08_tests.ma freescale/opcode.ma freescale/table_HCS08.ma
 compiler/preast_tree.ma common/string.ma compiler/ast_type.ma num/word32.ma
+opcodes/HCS08_opcode_base.ma num/word16.ma
 freescale/multivm.ma freescale/load_write.ma
-common/nat_to_num.ma common/nat.ma num/word32.ma
-freescale/opcode_base_lemmas.ma freescale/opcode_base.ma num/bool_lemmas.ma
 freescale_tests/medium_tests_tools.ma freescale/multivm.ma
+freescale/opcode_base_lemmas.ma freescale/opcode_base.ma num/bool_lemmas.ma
+common/nat_to_num.ma common/nat.ma num/word32.ma
 common/string_lemmas.ma common/ascii_lemmas.ma common/list_utility_lemmas.ma common/string.ma
 common/nat.ma num/bool.ma
 compiler/ast_type_lemmas.ma common/list_utility_lemmas.ma compiler/ast_type.ma
@@ -17,26 +19,33 @@ memory/memory_bits.ma memory/memory_trees.ma
 num/quatern.ma num/bool.ma
 num/exadecim.ma common/nat.ma common/prod.ma num/bool.ma num/oct.ma num/quatern.ma
 freescale/table_HC05_tests.ma freescale/opcode.ma freescale/table_HC05.ma
+opcodes/opcode.ma common/list.ma opcodes/HC05_opcode_base.ma opcodes/HC08_opcode_base.ma opcodes/HCS08_opcode_base.ma opcodes/RS08_opcode_base.ma opcodes/byte_or_word.ma
 num/bitrigesim_lemmas.ma num/bitrigesim.ma num/bool_lemmas.ma
 num/byte8.ma num/bitrigesim.ma num/exadecim.ma
-freescale/load_write.ma freescale/model.ma freescale/translation.ma
+opcodes/HC08_opcode_base.ma num/word16.ma
 freescale_tests/micro_tests4bis.ma freescale/multivm.ma freescale/status_lemmas.ma freescale_tests/micro_tests_tools.ma
+freescale/load_write.ma freescale/model.ma freescale/translation.ma
 freescale/table_RS08.ma common/list.ma freescale/opcode_base.ma
 common/nat_lemmas.ma common/nat.ma num/bool_lemmas.ma
 freescale_tests/micro_tests6.ma freescale/multivm.ma freescale/status_lemmas.ma freescale_tests/micro_tests_tools.ma
 common/list_utility_lemmas.ma common/list_lemmas.ma common/list_utility.ma
+opcodes/RS08_opcode_base.ma num/word16.ma
+opcodes/HC05_opcode_base.ma num/word16.ma
 freescale/table_RS08_tests.ma freescale/opcode.ma freescale/table_RS08.ma
 freescale/translation.ma common/option.ma freescale/table_HC05.ma freescale/table_HC08.ma freescale/table_HCS08.ma freescale/table_RS08.ma
 freescale/translation_lemmas.ma freescale/translation.ma num/byte8_lemmas.ma
 memory/memory_func.ma common/list.ma common/option.ma memory/memory_struct.ma num/word32.ma
 num/word32_lemmas.ma num/word16_lemmas.ma num/word32.ma
 freescale_tests/micro_tests9.ma common/nat_to_num.ma freescale/multivm.ma freescale/status_lemmas.ma freescale_tests/micro_tests_tools.ma
+opcodes/HCS08_table_tests.ma freescale/opcode.ma
 test_errori.ma 
 freescale_tests/micro_tests2.ma freescale/multivm.ma freescale/status_lemmas.ma freescale_tests/micro_tests_tools.ma
 compiler/environment.ma common/string.ma compiler/ast_type.ma
 common/ascii_lemmas.ma common/ascii.ma num/bool_lemmas.ma
 freescale/model.ma freescale/status.ma
 freescale/table_HC05.ma common/list.ma freescale/opcode_base.ma
+opcodes/HC08_table.ma common/list.ma opcodes/HC08_opcode_base.ma opcodes/byte_or_word.ma
+opcodes/HC08_table_tests.ma opcodes/opcode.ma
 common/string.ma common/ascii.ma common/list_utility.ma
 common/theory.ma 
 compiler/ast_type.ma common/list_utility.ma
@@ -45,11 +54,12 @@ freescale_tests/micro_tests5.ma freescale/multivm.ma freescale/status_lemmas.ma
 common/prod.ma num/bool.ma
 num/exadecim_lemmas.ma num/bool_lemmas.ma num/exadecim.ma
 num/word16_lemmas.ma num/byte8_lemmas.ma num/word16.ma
-memory/memory_trees.ma common/list.ma common/option.ma memory/memory_struct.ma num/word32.ma
 freescale_tests/medium_tests.ma common/list_utility.ma common/nat_to_num.ma freescale_tests/medium_tests_tools.ma
+memory/memory_trees.ma common/list.ma common/option.ma memory/memory_struct.ma num/word32.ma
 num/bool_lemmas.ma num/bool.ma
 freescale/opcode_base_lemmas1.ma freescale/opcode_base_lemmas_instrmode.ma freescale/opcode_base_lemmas_opcode.ma num/word16_lemmas.ma
 freescale/table_HC08.ma common/list.ma freescale/opcode_base.ma
+opcodes/HC05_table_tests.ma opcodes/opcode.ma
 memory/memory_struct.ma num/byte8.ma num/oct.ma
 num/oct_lemmas.ma num/bool_lemmas.ma num/oct.ma
 freescale/table_HCS08.ma common/list.ma freescale/opcode_base.ma
@@ -62,6 +72,7 @@ freescale/status_lemmas.ma common/option_lemmas.ma common/prod_lemmas.ma freesca
 freescale_tests/micro_tests_tools.ma common/list.ma num/word16.ma
 num/quatern_lemmas.ma num/bool_lemmas.ma num/quatern.ma
 freescale_tests/micro_tests1.ma freescale/multivm.ma freescale/status_lemmas.ma freescale_tests/micro_tests_tools.ma
+opcodes/HCS08_table.ma common/list.ma opcodes/HCS08_opcode_base.ma opcodes/byte_or_word.ma
 freescale/table_HC08_tests.ma freescale/opcode.ma freescale/table_HC08.ma
 common/option.ma num/bool.ma
 common/option_lemmas.ma common/option.ma num/bool_lemmas.ma
@@ -72,9 +83,12 @@ common/sigma.ma common/theory.ma
 common/list_lemmas.ma common/list.ma
 universe/universe.ma common/list.ma common/nat_lemmas.ma common/prod.ma
 num/bitrigesim.ma num/bool.ma
-common/list_utility.ma common/list.ma common/nat_lemmas.ma common/option.ma
+opcodes/byte_or_word.ma num/word16.ma
+opcodes/HC05_table.ma common/list.ma opcodes/HC05_opcode_base.ma opcodes/byte_or_word.ma
 freescale/opcode_base_lemmas_instrmode.ma freescale/opcode_base.ma num/bitrigesim_lemmas.ma num/exadecim_lemmas.ma num/oct_lemmas.ma
+common/list_utility.ma common/list.ma common/nat_lemmas.ma common/option.ma
 num/oct.ma num/bool.ma
 common/list.ma common/theory.ma
 freescale/opcode.ma common/list.ma freescale/opcode_base.ma
 freescale_tests/micro_tests7.ma freescale/multivm.ma freescale/status_lemmas.ma freescale_tests/micro_tests_tools.ma
+opcodes/RS08_table_tests.ma freescale/opcode.ma
diff --git a/helm/software/matita/contribs/ng_assembly/freescale/opcode.ma b/helm/software/matita/contribs/ng_assembly/freescale/opcode.ma
deleted file mode 100755 (executable)
index aeaaa8a..0000000
+++ /dev/null
@@ -1,180 +0,0 @@
-(**************************************************************************)
-(*       ___                                                              *)
-(*      ||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              *)
-(*   Ultima modifica: 05/08/2009                                          *)
-(*                                                                        *)
-(* ********************************************************************** *)
-
-include "freescale/opcode_base.ma".
-include "common/list.ma".
-
-(* ********************************************* *)
-(* STRUMENTI PER LE DIMOSTRAZIONI DI CORRETTEZZA *)
-(* ********************************************* *)
-
-(* su tutta la lista quante volte compare il byte *)
-nlet rec get_byte_count (m:mcu_type) (b:byte8) (c:word16)
- (l:list (Prod4T (any_opcode m) instr_mode byte8_or_word16 byte8)) on l ≝
- match l with
-  [ nil ⇒ c
-  | cons hd tl ⇒ match thd4T … hd with
-   [ Byte b' ⇒ match eq_b8 b b' with
-    [ true ⇒ get_byte_count m b (succ_w16 c) tl
-    | false ⇒ get_byte_count m b c tl
-    ]
-   | Word _ ⇒ get_byte_count m b c tl
-   ]
-  ].
-
-(* su tutta la lista quante volte compare la word (0x9E+byte) *)
-nlet rec get_word_count (m:mcu_type) (b:byte8) (c:word16)
- (l:list (Prod4T (any_opcode m) instr_mode byte8_or_word16 byte8)) on l ≝
- match l with
-  [ nil ⇒ c
-  | cons hd tl ⇒ match thd4T … hd with
-   [ Byte _ ⇒ get_word_count m b c tl
-   | Word w ⇒ match eq_w16 〈〈x9,xE〉:b〉 w with
-    [ true ⇒ get_word_count m b (succ_w16 c) tl
-    | false ⇒ get_word_count m b c tl
-    ]
-   ]
-  ].
-
-(* su tutta la lista quante volte compare lo pseudocodice *)
-nlet rec get_pseudo_count (m:mcu_type) (o:opcode) (c:word16)
- (l:list (Prod4T (any_opcode m) instr_mode byte8_or_word16 byte8)) on l ≝
- match l with
-  [ nil ⇒ c
-  | cons hd tl ⇒ match fst4T … hd with
-   [ anyOP o' ⇒ match eq_op o o' with
-    [ true ⇒ get_pseudo_count m o (succ_w16 c) tl
-    | false ⇒ get_pseudo_count m o c tl
-    ]
-   ]
-  ].
-
-(* su tutta la lista quante volte compare la modalita' *)
-nlet rec get_mode_count (m:mcu_type) (i:instr_mode) (c:word16)
- (l:list (Prod4T (any_opcode m) instr_mode byte8_or_word16 byte8)) on l ≝
- match l with
-  [ nil ⇒ c
-  | cons hd tl ⇒ match eq_im (snd4T … hd) i with
-   [ true ⇒ get_mode_count m i (succ_w16 c) tl
-   | false ⇒ get_mode_count m i c tl
-   ]
-  ].
-
-(* b e' non implementato? *)
-nlet rec test_not_impl_byte (b:byte8) (l:list byte8) on l ≝
- match l with
-  [ nil ⇒ false
-  | cons hd tl ⇒ match eq_b8 b hd with
-   [ true ⇒ true
-   | false ⇒ test_not_impl_byte b tl
-   ]
-  ].
-
-(* o e' non implementato? *)
-nlet rec test_not_impl_pseudo (o:opcode) (l:list opcode) on l ≝
- match l with
-  [ nil ⇒ false
-  | cons hd tl ⇒ match eq_op o hd with
-   [ true ⇒ true
-   | false ⇒ test_not_impl_pseudo o tl
-   ]
-  ].
-
-(* i e' non implementato? *)
-nlet rec test_not_impl_mode (i:instr_mode) (l:list instr_mode) on l ≝
- match l with
-  [ nil ⇒ false
-  | cons hd tl ⇒ match eq_im i hd with
-   [ true ⇒ true
-   | false ⇒ test_not_impl_mode i tl
-   ]
-  ].
-
-(* su tutta la lista quante volte compare la coppia opcode,instr_mode *)
-nlet rec get_OpIm_count (m:mcu_type) (o:any_opcode m) (i:instr_mode) (c:word16)
- (l:list (Prod4T (any_opcode m) instr_mode byte8_or_word16 byte8)) on l ≝
- match l with
-  [ nil ⇒ c
-  | cons hd tl ⇒
-   match (eq_anyop m o (fst4T … hd)) ⊗
-         (eq_im i (snd4T … hd)) with
-    [ true ⇒ get_OpIm_count m o i (succ_w16 c) tl
-    | false ⇒ get_OpIm_count m o i c tl
-    ] 
-  ].
-
-(* iteratore sugli opcode *)
-ndefinition forall_op ≝ λP.
- P ADC    ⊗ P ADD    ⊗ P AIS    ⊗ P AIX    ⊗ P AND    ⊗ P ASL    ⊗ P ASR    ⊗ P BCC    ⊗
- P BCLRn  ⊗ P BCS    ⊗ P BEQ    ⊗ P BGE    ⊗ P BGND   ⊗ P BGT    ⊗ P BHCC   ⊗ P BHCS   ⊗
- P BHI    ⊗ P BIH    ⊗ P BIL    ⊗ P BIT    ⊗ P BLE    ⊗ P BLS    ⊗ P BLT    ⊗ P BMC    ⊗
- P BMI    ⊗ P BMS    ⊗ P BNE    ⊗ P BPL    ⊗ P BRA    ⊗ P BRCLRn ⊗ P BRN    ⊗ P BRSETn ⊗
- P BSETn  ⊗ P BSR    ⊗ P CBEQA  ⊗ P CBEQX  ⊗ P CLC    ⊗ P CLI    ⊗ P CLR    ⊗ P CMP    ⊗
- P COM    ⊗ P CPHX   ⊗ P CPX    ⊗ P DAA    ⊗ P DBNZ   ⊗ P DEC    ⊗ P DIV    ⊗ P EOR    ⊗
- P INC    ⊗ P JMP    ⊗ P JSR    ⊗ P LDA    ⊗ P LDHX   ⊗ P LDX    ⊗ P LSR    ⊗ P MOV    ⊗
- P MUL    ⊗ P NEG    ⊗ P NOP    ⊗ P NSA    ⊗ P ORA    ⊗ P PSHA   ⊗ P PSHH   ⊗ P PSHX   ⊗
- P PULA   ⊗ P PULH   ⊗ P PULX   ⊗ P ROL    ⊗ P ROR    ⊗ P RSP    ⊗ P RTI    ⊗ P RTS    ⊗
- P SBC    ⊗ P SEC    ⊗ P SEI    ⊗ P SHA    ⊗ P SLA    ⊗ P STA    ⊗ P STHX   ⊗ P STOP   ⊗
- P STX    ⊗ P SUB    ⊗ P SWI    ⊗ P TAP    ⊗ P TAX    ⊗ P TPA    ⊗ P TST    ⊗ P TSX    ⊗
- P TXA    ⊗ P TXS    ⊗ P WAIT.
-
-(* iteratore sulle modalita' *)
-ndefinition forall_im ≝ λP.
-  P MODE_INH
-⊗ P MODE_INHA
-⊗ P MODE_INHX
-⊗ P MODE_INHH
-
-⊗ P MODE_INHX0ADD
-⊗ P MODE_INHX1ADD
-⊗ P MODE_INHX2ADD
-
-⊗ P MODE_IMM1
-⊗ P MODE_IMM1EXT
-⊗ P MODE_IMM2
-⊗ P MODE_DIR1
-⊗ P MODE_DIR2
-⊗ P MODE_IX0
-⊗ P MODE_IX1
-⊗ P MODE_IX2
-⊗ P MODE_SP1
-⊗ P MODE_SP2
-
-⊗ P MODE_DIR1_to_DIR1
-⊗ P MODE_IMM1_to_DIR1
-⊗ P MODE_IX0p_to_DIR1
-⊗ P MODE_DIR1_to_IX0p
-
-⊗ P MODE_INHA_and_IMM1
-⊗ P MODE_INHX_and_IMM1
-⊗ P MODE_IMM1_and_IMM1
-⊗ P MODE_DIR1_and_IMM1
-⊗ P MODE_IX0_and_IMM1
-⊗ P MODE_IX0p_and_IMM1
-⊗ P MODE_IX1_and_IMM1
-⊗ P MODE_IX1p_and_IMM1
-⊗ P MODE_SP1_and_IMM1
-
-⊗ forall_oct (λo. P (MODE_DIRn o))
-⊗ forall_oct (λo. P (MODE_DIRn_and_IMM1 o))
-⊗ forall_ex (λe. P (MODE_TNY e))
-⊗ forall_bit (λt. P (MODE_SRT t)).
diff --git a/helm/software/matita/contribs/ng_assembly/freescale/opcode_base.ma b/helm/software/matita/contribs/ng_assembly/freescale/opcode_base.ma
deleted file mode 100755 (executable)
index f1bb166..0000000
+++ /dev/null
@@ -1,330 +0,0 @@
-(**************************************************************************)
-(*       ___                                                              *)
-(*      ||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              *)
-(*   Ultima modifica: 05/08/2009                                          *)
-(*                                                                        *)
-(* ********************************************************************** *)
-
-include "num/word16.ma".
-
-(* ********************************************** *)
-(* MATTONI BASE PER DEFINIRE LE TABELLE DELLE MCU *)
-(* ********************************************** *)
-
-(* enumerazione delle ALU *)
-ninductive mcu_type: Type ≝
-  HC05  : mcu_type
-| HC08  : mcu_type
-| HCS08 : mcu_type
-| RS08  : mcu_type.
-
-ndefinition eq_mcutype ≝
-λm1,m2:mcu_type.
- match m1 with
-  [ HC05 ⇒ match m2 with [ HC05 ⇒ true | _ ⇒ false ]
-  | HC08 ⇒ match m2 with [ HC08 ⇒ true | _ ⇒ false ]
-  | HCS08 ⇒ match m2 with [ HCS08 ⇒ true | _ ⇒ false ]
-  | RS08 ⇒ match m2 with [ RS08 ⇒ true | _ ⇒ false ]
-  ].
-
-(* enumerazione delle modalita' di indirizzamento = caricamento degli operandi *)
-ninductive instr_mode: Type ≝
-  (* INHERENT = nessun operando *)
-  MODE_INH  : instr_mode
-  (* INHERENT = nessun operando (A implicito) *)
-| MODE_INHA : instr_mode
-  (* INHERENT = nessun operando (X implicito) *)
-| MODE_INHX : instr_mode
-  (* INHERENT = nessun operando (H implicito) *)
-| MODE_INHH : instr_mode
-
-  (* INHERENT_ADDRESS = nessun operando (HX implicito) *)
-| MODE_INHX0ADD : instr_mode
-  (* INHERENT_ADDRESS = nessun operando (HX implicito+0x00bb) *)
-| MODE_INHX1ADD : instr_mode
-  (* INHERENT_ADDRESS = nessun operando (HX implicito+0xwwww) *)
-| MODE_INHX2ADD : instr_mode
-
-  (* IMMEDIATE = operando valore immediato byte = 0xbb *)
-| MODE_IMM1 : instr_mode
-  (* IMMEDIATE_EXT = operando valore immediato byte = 0xbb -> esteso a word *)
-| MODE_IMM1EXT : instr_mode
-  (* IMMEDIATE = operando valore immediato word = 0xwwww *)
-| MODE_IMM2 : instr_mode
-  (* DIRECT = operando offset byte = [0x00bb] *)
-| MODE_DIR1 : instr_mode
-  (* DIRECT = operando offset word = [0xwwww] *)
-| MODE_DIR2 : instr_mode
-  (* INDEXED = nessun operando (implicito [X] *)
-| MODE_IX0  : instr_mode
-  (* INDEXED = operando offset relativo byte = [X+0x00bb] *)
-| MODE_IX1  : instr_mode
-  (* INDEXED = operando offset relativo word = [X+0xwwww] *)
-| MODE_IX2  : instr_mode
-  (* INDEXED = operando offset relativo byte = [SP+0x00bb] *)
-| MODE_SP1  : instr_mode
-  (* INDEXED = operando offset relativo word = [SP+0xwwww] *)
-| MODE_SP2  : instr_mode
-
-  (* DIRECT → DIRECT = carica da diretto/scrive su diretto *)
-| MODE_DIR1_to_DIR1 : instr_mode
-  (* IMMEDIATE → DIRECT = carica da immediato/scrive su diretto *)
-| MODE_IMM1_to_DIR1 : instr_mode
-  (* INDEXED++ → DIRECT = carica da [X]/scrive su diretto/H:X++ *)
-| MODE_IX0p_to_DIR1 : instr_mode
-  (* DIRECT → INDEXED++ = carica da diretto/scrive su [X]/H:X++ *)
-| MODE_DIR1_to_IX0p : instr_mode
-
-  (* INHERENT(A) + IMMEDIATE *)
-| MODE_INHA_and_IMM1 : instr_mode
-  (* INHERENT(X) + IMMEDIATE *)
-| MODE_INHX_and_IMM1 : instr_mode
-  (* IMMEDIATE + IMMEDIATE *)
-| MODE_IMM1_and_IMM1 : instr_mode
-  (* DIRECT + IMMEDIATE *)
-| MODE_DIR1_and_IMM1 : instr_mode
-  (* INDEXED + IMMEDIATE *)
-| MODE_IX0_and_IMM1  : instr_mode
-  (* INDEXED++ + IMMEDIATE *)
-| MODE_IX0p_and_IMM1 : instr_mode
-  (* INDEXED + IMMEDIATE *)
-| MODE_IX1_and_IMM1  : instr_mode
-  (* INDEXED++ + IMMEDIATE *)
-| MODE_IX1p_and_IMM1 : instr_mode
-  (* INDEXED + IMMEDIATE *)
-| MODE_SP1_and_IMM1  : instr_mode
-
-  (* DIRECT(mTNY) = operando offset byte(maschera scrittura implicita 3 bit) *)
-  (* ex: DIR3 e' carica b, scrivi b con n-simo bit modificato *)
-| MODE_DIRn          : oct → instr_mode
-  (* DIRECT(mTNY) + IMMEDIATE = operando offset byte(maschera lettura implicita 3 bit) *)
-  (*                            + operando valore immediato byte  *)
-  (* ex: DIR2_and_IMM1 e' carica b, carica imm, restituisci n-simo bit di b + imm *)
-| MODE_DIRn_and_IMM1 : oct → instr_mode
-  (* TINY = nessun operando (diretto implicito 4bit = [0x00000000:0000iiii]) *)
-| MODE_TNY           : exadecim → instr_mode
-  (* SHORT = nessun operando (diretto implicito 5bit = [0x00000000:000iiiii]) *)
-| MODE_SRT           : bitrigesim → instr_mode
-.
-
-ndefinition eq_im ≝
-λi1,i2:instr_mode.
- match i1 with
-  [ MODE_INH ⇒ match i2 with [ MODE_INH ⇒ true | _ ⇒ false ]
-  | MODE_INHA ⇒ match i2 with [ MODE_INHA ⇒ true | _ ⇒ false ]
-  | MODE_INHX ⇒ match i2 with [ MODE_INHX ⇒ true | _ ⇒ false ]
-  | MODE_INHH ⇒ match i2 with [ MODE_INHH ⇒ true | _ ⇒ false ]
-  | MODE_INHX0ADD ⇒ match i2 with [ MODE_INHX0ADD ⇒ true | _ ⇒ false ]
-  | MODE_INHX1ADD ⇒ match i2 with [ MODE_INHX1ADD ⇒ true | _ ⇒ false ]
-  | MODE_INHX2ADD ⇒ match i2 with [ MODE_INHX2ADD ⇒ true | _ ⇒ false ]
-  | MODE_IMM1 ⇒ match i2 with [ MODE_IMM1 ⇒ true | _ ⇒ false ]
-  | MODE_IMM1EXT ⇒ match i2 with [ MODE_IMM1EXT ⇒ true | _ ⇒ false ]
-  | MODE_IMM2 ⇒ match i2 with [ MODE_IMM2 ⇒ true | _ ⇒ false ]
-  | MODE_DIR1 ⇒ match i2 with [ MODE_DIR1 ⇒ true | _ ⇒ false ]
-  | MODE_DIR2 ⇒ match i2 with [ MODE_DIR2 ⇒ true | _ ⇒ false ]
-  | MODE_IX0 ⇒ match i2 with [ MODE_IX0 ⇒ true | _ ⇒ false ]
-  | MODE_IX1 ⇒ match i2 with [ MODE_IX1 ⇒ true | _ ⇒ false ]
-  | MODE_IX2 ⇒ match i2 with [ MODE_IX2 ⇒ true | _ ⇒ false ]
-  | MODE_SP1 ⇒ match i2 with [ MODE_SP1 ⇒ true | _ ⇒ false ]
-  | MODE_SP2 ⇒ match i2 with [ MODE_SP2 ⇒ true | _ ⇒ false ]  
-  | MODE_DIR1_to_DIR1 ⇒ match i2 with [ MODE_DIR1_to_DIR1 ⇒ true | _ ⇒ false ]
-  | MODE_IMM1_to_DIR1 ⇒ match i2 with [ MODE_IMM1_to_DIR1 ⇒ true | _ ⇒ false ]
-  | MODE_IX0p_to_DIR1 ⇒ match i2 with [ MODE_IX0p_to_DIR1 ⇒ true | _ ⇒ false ]
-  | MODE_DIR1_to_IX0p ⇒ match i2 with [ MODE_DIR1_to_IX0p ⇒ true | _ ⇒ false ]
-  | MODE_INHA_and_IMM1 ⇒ match i2 with [ MODE_INHA_and_IMM1 ⇒ true | _ ⇒ false ]
-  | MODE_INHX_and_IMM1 ⇒ match i2 with [ MODE_INHX_and_IMM1 ⇒ true | _ ⇒ false ]
-  | MODE_IMM1_and_IMM1 ⇒ match i2 with [ MODE_IMM1_and_IMM1 ⇒ true | _ ⇒ false ]  
-  | MODE_DIR1_and_IMM1 ⇒ match i2 with [ MODE_DIR1_and_IMM1 ⇒ true | _ ⇒ false ]  
-  | MODE_IX0_and_IMM1 ⇒ match i2 with [ MODE_IX0_and_IMM1 ⇒ true | _ ⇒ false ]  
-  | MODE_IX0p_and_IMM1 ⇒ match i2 with [ MODE_IX0p_and_IMM1 ⇒ true | _ ⇒ false ]  
-  | MODE_IX1_and_IMM1 ⇒ match i2 with [ MODE_IX1_and_IMM1 ⇒ true | _ ⇒ false ]  
-  | MODE_IX1p_and_IMM1 ⇒ match i2 with [ MODE_IX1p_and_IMM1 ⇒ true | _ ⇒ false ]
-  | MODE_SP1_and_IMM1 ⇒ match i2 with [ MODE_SP1_and_IMM1 ⇒ true | _ ⇒ false ]
-  | MODE_DIRn n1 ⇒ match i2 with [ MODE_DIRn n2 ⇒ eq_oct n1 n2 | _ ⇒ false ]  
-  | MODE_DIRn_and_IMM1 n1 ⇒ match i2 with [ MODE_DIRn_and_IMM1 n2  ⇒ eq_oct n1 n2 | _ ⇒ false ]
-  | MODE_TNY e1 ⇒ match i2 with [ MODE_TNY e2 ⇒ eq_ex e1 e2 | _ ⇒ false ]  
-  | MODE_SRT t1 ⇒ match i2 with [ MODE_SRT t2 ⇒ eq_bit t1 t2 | _ ⇒ false ]  
-  ].        
-
-(* enumerazione delle istruzioni di tutte le ALU *)
-ninductive opcode: Type ≝
-  ADC    : opcode (* add with carry *)
-| ADD    : opcode (* add *)
-| AIS    : opcode (* add immediate to SP *)
-| AIX    : opcode (* add immediate to X *)
-| AND    : opcode (* and *)
-| ASL    : opcode (* aritmetic shift left *)
-| ASR    : opcode (* aritmetic shift right *)
-| BCC    : opcode (* branch if C=0 *)
-| BCLRn  : opcode (* clear bit n *)
-| BCS    : opcode (* branch if C=1 *)
-| BEQ    : opcode (* branch if Z=1 *)
-| BGE    : opcode (* branch if N⊙V=0 (great or equal) *)
-| BGND   : opcode (* !!background mode!! *)
-| BGT    : opcode (* branch if Z|N⊙V=0 clear (great) *)
-| BHCC   : opcode (* branch if H=0 *)
-| BHCS   : opcode (* branch if H=1 *)
-| BHI    : opcode (* branch if C|Z=0, (higher) *)
-| BIH    : opcode (* branch if nIRQ=1 *)
-| BIL    : opcode (* branch if nIRQ=0 *)
-| BIT    : opcode (* flag = and (bit test) *)
-| BLE    : opcode (* branch if Z|N⊙V=1 (less or equal) *)
-| BLS    : opcode (* branch if C|Z=1 (lower or same) *)
-| BLT    : opcode (* branch if N⊙1=1 (less) *)
-| BMC    : opcode (* branch if I=0 (interrupt mask clear) *)
-| BMI    : opcode (* branch if N=1 (minus) *)
-| BMS    : opcode (* branch if I=1 (interrupt mask set) *)
-| BNE    : opcode (* branch if Z=0 *)
-| BPL    : opcode (* branch if N=0 (plus) *)
-| BRA    : opcode (* branch always *)
-| BRCLRn : opcode (* branch if bit n clear *)
-| BRN    : opcode (* branch never (nop) *)
-| BRSETn : opcode (* branch if bit n set *)
-| BSETn  : opcode (* set bit n *)
-| BSR    : opcode (* branch to subroutine *)
-| CBEQA  : opcode (* compare (A) and BEQ *)
-| CBEQX  : opcode (* compare (X) and BEQ *)
-| CLC    : opcode (* C=0 *)
-| CLI    : opcode (* I=0 *)
-| CLR    : opcode (* operand=0 *)
-| CMP    : opcode (* flag = sub (compare A) *)
-| COM    : opcode (* not (1 complement) *)
-| CPHX   : opcode (* flag = sub (compare H:X) *)
-| CPX    : opcode (* flag = sub (compare X) *)
-| DAA    : opcode (* decimal adjust A *)
-| DBNZ   : opcode (* dec and BNE *)
-| DEC    : opcode (* operand=operand-1 (decrement) *)
-| DIV    : opcode (* div *)
-| EOR    : opcode (* xor *)
-| INC    : opcode (* operand=operand+1 (increment) *)
-| JMP    : opcode (* jmp word [operand] *)
-| JSR    : opcode (* jmp to subroutine *)
-| LDA    : opcode (* load in A *)
-| LDHX   : opcode (* load in H:X *)
-| LDX    : opcode (* load in X *)
-| LSR    : opcode (* logical shift right *)
-| MOV    : opcode (* move *)
-| MUL    : opcode (* mul *)
-| NEG    : opcode (* neg (2 complement) *)
-| NOP    : opcode (* nop *)
-| NSA    : opcode (* nibble swap A (al:ah <- ah:al) *)
-| ORA    : opcode (* or *)
-| PSHA   : opcode (* push A *)
-| PSHH   : opcode (* push H *)
-| PSHX   : opcode (* push X *)
-| PULA   : opcode (* pop A *)
-| PULH   : opcode (* pop H *)
-| PULX   : opcode (* pop X *)
-| ROL    : opcode (* rotate left *)
-| ROR    : opcode (* rotate right *)
-| RSP    : opcode (* reset SP (0x00FF) *)
-| RTI    : opcode (* return from interrupt *)
-| RTS    : opcode (* return from subroutine *)
-| SBC    : opcode (* sub with carry*)
-| SEC    : opcode (* C=1 *)
-| SEI    : opcode (* I=1 *)
-| SHA    : opcode (* swap spc_high,A *)
-| SLA    : opcode (* swap spc_low,A *)
-| STA    : opcode (* store from A *)
-| STHX   : opcode (* store from H:X *)
-| STOP   : opcode (* !!stop mode!! *)
-| STX    : opcode (* store from X *)
-| SUB    : opcode (* sub *)
-| SWI    : opcode (* software interrupt *)
-| TAP    : opcode (* flag=A (transfer A to process status byte *)
-| TAX    : opcode (* X=A (transfer A to X) *)
-| TPA    : opcode (* A=flag (transfer process status byte to A) *)
-| TST    : opcode (* flag = sub (test) *)
-| TSX    : opcode (* X:H=SP (transfer SP to H:X) *)
-| TXA    : opcode (* A=X (transfer X to A) *)
-| TXS    : opcode (* SP=X:H (transfer H:X to SP) *)
-| WAIT   : opcode (* !!wait mode!! *)
-.
-
-ndefinition eq_op ≝
-λop1,op2:opcode.
- match op1 with
-  [ ADC ⇒ match op2 with [ ADC ⇒ true | _ ⇒ false ] | ADD ⇒ match op2 with [ ADD ⇒ true | _ ⇒ false ]
-  | AIS ⇒ match op2 with [ AIS ⇒ true | _ ⇒ false ] | AIX ⇒ match op2 with [ AIX ⇒ true | _ ⇒ false ]
-  | AND ⇒ match op2 with [ AND ⇒ true | _ ⇒ false ] | ASL ⇒ match op2 with [ ASL ⇒ true | _ ⇒ false ]
-  | ASR ⇒ match op2 with [ ASR ⇒ true | _ ⇒ false ] | BCC ⇒ match op2 with [ BCC ⇒ true | _ ⇒ false ]
-  | BCLRn ⇒ match op2 with [ BCLRn ⇒ true | _ ⇒ false ] | BCS ⇒ match op2 with [ BCS ⇒ true | _ ⇒ false ]
-  | BEQ ⇒ match op2 with [ BEQ ⇒ true | _ ⇒ false ] | BGE ⇒ match op2 with [ BGE ⇒ true | _ ⇒ false ]
-  | BGND ⇒ match op2 with [ BGND ⇒ true | _ ⇒ false ] | BGT ⇒ match op2 with [ BGT ⇒ true | _ ⇒ false ]
-  | BHCC ⇒ match op2 with [ BHCC ⇒ true | _ ⇒ false ] | BHCS ⇒ match op2 with [ BHCS ⇒ true | _ ⇒ false ]
-  | BHI ⇒ match op2 with [ BHI ⇒ true | _ ⇒ false ] | BIH ⇒ match op2 with [ BIH ⇒ true | _ ⇒ false ]
-  | BIL ⇒ match op2 with [ BIL ⇒ true | _ ⇒ false ] | BIT ⇒ match op2 with [ BIT ⇒ true | _ ⇒ false ]
-  | BLE ⇒ match op2 with [ BLE ⇒ true | _ ⇒ false ] | BLS ⇒ match op2 with [ BLS ⇒ true | _ ⇒ false ]
-  | BLT ⇒ match op2 with [ BLT ⇒ true | _ ⇒ false ] | BMC ⇒ match op2 with [ BMC ⇒ true | _ ⇒ false ]
-  | BMI ⇒ match op2 with [ BMI ⇒ true | _ ⇒ false ] | BMS ⇒ match op2 with [ BMS ⇒ true | _ ⇒ false ]
-  | BNE ⇒ match op2 with [ BNE ⇒ true | _ ⇒ false ] | BPL ⇒ match op2 with [ BPL ⇒ true | _ ⇒ false ]
-  | BRA ⇒ match op2 with [ BRA ⇒ true | _ ⇒ false ] | BRCLRn ⇒ match op2 with [ BRCLRn ⇒ true | _ ⇒ false ]
-  | BRN ⇒ match op2 with [ BRN ⇒ true | _ ⇒ false ] | BRSETn ⇒ match op2 with [ BRSETn ⇒ true | _ ⇒ false ]
-  | BSETn ⇒ match op2 with [ BSETn ⇒ true | _ ⇒ false ] | BSR ⇒ match op2 with [ BSR ⇒ true | _ ⇒ false ]
-  | CBEQA ⇒ match op2 with [ CBEQA ⇒ true | _ ⇒ false ] | CBEQX ⇒ match op2 with [ CBEQX ⇒ true | _ ⇒ false ]
-  | CLC ⇒ match op2 with [ CLC ⇒ true | _ ⇒ false ] | CLI ⇒ match op2 with [ CLI ⇒ true | _ ⇒ false ]
-  | CLR ⇒ match op2 with [ CLR ⇒ true | _ ⇒ false ] | CMP ⇒ match op2 with [ CMP ⇒ true | _ ⇒ false ]
-  | COM ⇒ match op2 with [ COM ⇒ true | _ ⇒ false ] | CPHX ⇒ match op2 with [ CPHX ⇒ true | _ ⇒ false ]
-  | CPX ⇒ match op2 with [ CPX ⇒ true | _ ⇒ false ] | DAA ⇒ match op2 with [ DAA ⇒ true | _ ⇒ false ]
-  | DBNZ ⇒ match op2 with [ DBNZ ⇒ true | _ ⇒ false ] | DEC ⇒ match op2 with [ DEC ⇒ true | _ ⇒ false ]
-  | DIV ⇒ match op2 with [ DIV ⇒ true | _ ⇒ false ] | EOR ⇒ match op2 with [ EOR ⇒ true | _ ⇒ false ]
-  | INC ⇒ match op2 with [ INC ⇒ true | _ ⇒ false ] | JMP ⇒ match op2 with [ JMP ⇒ true | _ ⇒ false ]
-  | JSR ⇒ match op2 with [ JSR ⇒ true | _ ⇒ false ] | LDA ⇒ match op2 with [ LDA ⇒ true | _ ⇒ false ]
-  | LDHX ⇒ match op2 with [ LDHX ⇒ true | _ ⇒ false ] | LDX ⇒ match op2 with [ LDX ⇒ true | _ ⇒ false ]
-  | LSR ⇒ match op2 with [ LSR ⇒ true | _ ⇒ false ] | MOV ⇒ match op2 with [ MOV ⇒ true | _ ⇒ false ]
-  | MUL ⇒ match op2 with [ MUL ⇒ true | _ ⇒ false ] | NEG ⇒ match op2 with [ NEG ⇒ true | _ ⇒ false ]
-  | NOP ⇒ match op2 with [ NOP ⇒ true | _ ⇒ false ] | NSA ⇒ match op2 with [ NSA ⇒ true | _ ⇒ false ]
-  | ORA ⇒ match op2 with [ ORA ⇒ true | _ ⇒ false ] | PSHA ⇒ match op2 with [ PSHA ⇒ true | _ ⇒ false ]
-  | PSHH ⇒ match op2 with [ PSHH ⇒ true | _ ⇒ false ] | PSHX ⇒ match op2 with [ PSHX ⇒ true | _ ⇒ false ]
-  | PULA ⇒ match op2 with [ PULA ⇒ true | _ ⇒ false ] | PULH ⇒ match op2 with [ PULH ⇒ true | _ ⇒ false ]
-  | PULX ⇒ match op2 with [ PULX ⇒ true | _ ⇒ false ] | ROL ⇒ match op2 with [ ROL ⇒ true | _ ⇒ false ]
-  | ROR ⇒ match op2 with [ ROR ⇒ true | _ ⇒ false ] | RSP ⇒ match op2 with [ RSP ⇒ true | _ ⇒ false ]
-  | RTI ⇒ match op2 with [ RTI ⇒ true | _ ⇒ false ] | RTS ⇒ match op2 with [ RTS ⇒ true | _ ⇒ false ]
-  | SBC ⇒ match op2 with [ SBC ⇒ true | _ ⇒ false ] | SEC ⇒ match op2 with [ SEC ⇒ true | _ ⇒ false ]
-  | SEI ⇒ match op2 with [ SEI ⇒ true | _ ⇒ false ] | SHA ⇒ match op2 with [ SHA ⇒ true | _ ⇒ false ]
-  | SLA ⇒ match op2 with [ SLA ⇒ true | _ ⇒ false ] | STA ⇒ match op2 with [ STA ⇒ true | _ ⇒ false ]
-  | STHX ⇒ match op2 with [ STHX ⇒ true | _ ⇒ false ] | STOP ⇒ match op2 with [ STOP ⇒ true | _ ⇒ false ]
-  | STX ⇒ match op2 with [ STX ⇒ true | _ ⇒ false ] | SUB ⇒ match op2 with [ SUB ⇒ true | _ ⇒ false ]
-  | SWI ⇒ match op2 with [ SWI ⇒ true | _ ⇒ false ] | TAP ⇒ match op2 with [ TAP ⇒ true | _ ⇒ false ]
-  | TAX ⇒ match op2 with [ TAX ⇒ true | _ ⇒ false ] | TPA ⇒ match op2 with [ TPA ⇒ true | _ ⇒ false ]
-  | TST ⇒ match op2 with [ TST ⇒ true | _ ⇒ false ] | TSX ⇒ match op2 with [ TSX ⇒ true | _ ⇒ false ]
-  | TXA ⇒ match op2 with [ TXA ⇒ true | _ ⇒ false ] | TXS ⇒ match op2 with [ TXS ⇒ true | _ ⇒ false ]
-  | WAIT ⇒ match op2 with [ WAIT ⇒ true | _ ⇒ false ]
-  ].
-
-(* introduzione di un tipo opcode dipendente dall'mcu_type (phantom type) *)
-ninductive any_opcode (m:mcu_type) : Type ≝
- anyOP : opcode → any_opcode m.
-
-ndefinition eq_anyop ≝
-λm:mcu_type.λop1,op2:any_opcode m.
- match op1 with [ anyOP op1' ⇒
-  match op2 with [ anyOP op2' ⇒
-   eq_op op1' op2' ]].
-
-(* raggruppamento di byte e word in un tipo unico *)
-ninductive byte8_or_word16 : Type ≝
-  Byte: byte8  → byte8_or_word16
-| Word: word16 → byte8_or_word16.
-
-ndefinition eq_b8w16 ≝
-λbw1,bw2:byte8_or_word16.
- match bw1 with
-  [ Byte b1 ⇒ match bw2 with [ Byte b2 ⇒ eq_b8 b1 b2 | Word _ ⇒ false ]
-  | Word w1 ⇒ match bw2 with [ Byte _ ⇒ false | Word w2 ⇒ eq_w16 w1 w2 ]
-  ].
diff --git a/helm/software/matita/contribs/ng_assembly/freescale/opcode_base_lemmas.ma b/helm/software/matita/contribs/ng_assembly/freescale/opcode_base_lemmas.ma
deleted file mode 100755 (executable)
index ebaf9ae..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-(**************************************************************************)
-(*       ___                                                              *)
-(*      ||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              *)
-(*   Ultima modifica: 05/08/2009                                          *)
-(*                                                                        *)
-(* ********************************************************************** *)
-
-include "num/bool_lemmas.ma".
-include "freescale/opcode_base.ma".
-
-(* ********************************************** *)
-(* MATTONI BASE PER DEFINIRE LE TABELLE DELLE MCU *)
-(* ********************************************** *)
-
-ndefinition mcu_type_destruct_aux ≝
-Πm1,m2:mcu_type.ΠP:Prop.m1 = m2 →
- match eq_mcutype m1 m2 with [ true ⇒ P → P | false ⇒ P ].
-
-ndefinition mcutype_destruct : mcu_type_destruct_aux.
- #m1; #m2; #P; #H;
- nrewrite < H;
- nelim m1;
- nnormalize;
- napply (λx.x).
-nqed.
-
-nlemma symmetric_eqmcutype : symmetricT mcu_type bool eq_mcutype.
- #m1; #m2;
- nelim m1;
- nelim m2;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma eqmcutype_to_eq : ∀m1,m2:mcu_type.(eq_mcutype m1 m2 = true) → (m1 = m2).
- #m1; #m2;
- ncases m1;
- ncases m2;
- nnormalize;
- ##[ ##1,6,11,16: #H; napply refl_eq
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eq_to_eqmcutype : ∀m1,m2.m1 = m2 → eq_mcutype m1 m2 = true.
- #m1; #m2;
- ncases m1;
- ncases m2;
- nnormalize;
- ##[ ##1,6,11,16: #H; napply refl_eq
- ##| ##*: #H; napply (mcutype_destruct … H)
- ##]
-nqed.
-
-nlemma decidable_mcutype : ∀x,y:mcu_type.decidable (x = y).
- #x; #y;
- nnormalize;
- nelim x;
- nelim y;
- ##[ ##1,6,11,16: napply (or2_intro1 (? = ?) (? ≠ ?) …); napply refl_eq
- ##| ##*: napply (or2_intro2 (? = ?) (? ≠ ?) …);
-          nnormalize; #H;
-          napply False_ind;
-          napply (mcutype_destruct … H)
- ##]
-nqed.
-
-nlemma neqmcutype_to_neq : ∀m1,m2:mcu_type.(eq_mcutype m1 m2 = false) → (m1 ≠ m2).
- #m1; #m2;
- ncases m1;
- ncases m2;
- nnormalize;
- ##[ ##1,6,11,16: #H; napply (bool_destruct … H)
- ##| ##*: #H; #H1; napply (mcutype_destruct … H1)
- ##]
-nqed.
-
-nlemma neq_to_neqmcutype : ∀m1,m2.m1 ≠ m2 → eq_mcutype m1 m2 = false.
- #m1; #m2;
- ncases m1;
- ncases m2;
- nnormalize;
- ##[ ##1,6,11,16: #H; nelim (H (refl_eq …))
- ##| ##*: #H; napply refl_eq
- ##]
-nqed.
diff --git a/helm/software/matita/contribs/ng_assembly/freescale/opcode_base_lemmas1.ma b/helm/software/matita/contribs/ng_assembly/freescale/opcode_base_lemmas1.ma
deleted file mode 100755 (executable)
index 78a284c..0000000
+++ /dev/null
@@ -1,208 +0,0 @@
-(**************************************************************************)
-(*       ___                                                              *)
-(*      ||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              *)
-(*   Ultima modifica: 05/08/2009                                          *)
-(*                                                                        *)
-(* ********************************************************************** *)
-
-include "freescale/opcode_base_lemmas_opcode.ma".
-include "freescale/opcode_base_lemmas_instrmode.ma".
-include "num/word16_lemmas.ma".
-
-(* ********************************************** *)
-(* MATTONI BASE PER DEFINIRE LE TABELLE DELLE MCU *)
-(* ********************************************** *)
-
-nlemma anyop_destruct : ∀m.∀x1,x2:opcode.anyOP m x1 = anyOP m x2 → x1 = x2.
- #m; #x1; #x2; #H;
- nchange with (match anyOP m x2 with [ anyOP a ⇒ x1 = a ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma symmetric_eqanyop : ∀m.∀op1,op2:any_opcode m.eq_anyop m op1 op2 = eq_anyop m op2 op1.
- #m;
- ncases m;
- #op1; #op2;
- ncases op1;
- #x1;
- ncases op2;
- #x2;
- nchange with (eq_op x1 x2 = eq_op x2 x1);
- nrewrite > (symmetric_eqop x1 x2);
- napply refl_eq.
-nqed.
-
-nlemma eqanyop_to_eq : ∀m.∀op1,op2:any_opcode m.eq_anyop m op1 op2 = true → op1 = op2.
- #m;
- ncases m;
- #op1; #op2;
- ncases op1;
- #x1;
- ncases op2;
- #x2;
- nchange with ((eq_op x1 x2 = true) → ?);
- #H;
- nrewrite > (eqop_to_eq … H);
- napply refl_eq.
-nqed.
-
-nlemma eq_to_eqanyop : ∀m.∀op1,op2:any_opcode m.op1 = op2 → eq_anyop m op1 op2 = true.
- #m;
- ncases m;
- #op1; #op2;
- ncases op1;
- #p1;
- ncases op2;
- #p2; #H;
- nrewrite > (anyop_destruct … H);
- nchange with (eq_op p2 p2 = true);
- nrewrite > (eq_to_eqop p2 p2 (refl_eq opcode p2));
- napply refl_eq.
-nqed.
-
-nlemma decidable_anyop : ∀m.∀x,y:any_opcode m.decidable (x = y).
- #m; #x; nelim x; #e1; #y; nelim y; #e2;
- nnormalize;
- napply (or2_elim (? = ?) (? ≠ ?) ? (decidable_op e1 e2) …);
- ##[ ##2: #H; napply (or2_intro2 (? = ?) (? ≠ ?) … ); nnormalize; #H1; napply (H (anyop_destruct m … H1))
- ##| ##1: #H; nrewrite > H; napply (or2_intro1 (? = ?) (? ≠ ?) (refl_eq …))
- ##]
-nqed.
-
-nlemma neqanyop_to_neq : ∀m.∀op1,op2:any_opcode m.(eq_anyop m op1 op2 = false) → (op1 ≠ op2).
- #m; #op1; nelim op1; #e1; #op2; nelim op2; #e2;
- nchange with (((eq_op e1 e2) = false) → ?);
- #H;
- nnormalize;
- #H1;
- napply (neqop_to_neq … H);
- napply (anyop_destruct m … H1).
-nqed.
-
-nlemma neq_to_neqanyop : ∀m.∀op1,op2:any_opcode m.op1 ≠ op2 → eq_anyop m op1 op2 = false.
- #m; #op1; nelim op1; #e1; #op2; nelim op2; #e2;
- #H; nchange with ((eq_op e1 e2) = false);
- napply (neq_to_neqop e1 e2 ?);
- nnormalize;
- #H1;
- nrewrite > H1 in H:(%); #H;
- napply (H (refl_eq …)).
-nqed.
-
-nlemma b8w16_destruct_b8_b8 : ∀x1,x2.Byte x1 = Byte x2 → x1 = x2.
- #x1; #x2; #H;
- nchange with (match Byte x2 with [ Byte a ⇒ x1 = a | Word _ ⇒ False ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma b8w16_destruct_w16_w16 : ∀x1,x2.Word x1 = Word x2 → x1 = x2.
- #x1; #x2; #H;
- nchange with (match Word x2 with [ Word a ⇒ x1 = a | Byte _ ⇒ False ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma b8w16_destruct_b8_w16 : ∀x1,x2.Byte x1 = Word x2 → False.
- #x1; #x2; #H;
- nchange with (match Byte x1 with [ Word _ ⇒ True | Byte a ⇒ False ]);
- nrewrite > H;
- nnormalize;
- napply I.
-nqed.
-
-nlemma b8w16_destruct_w16_b8 : ∀x1,x2.Word x1 = Byte x2 → False.
- #x1; #x2; #H;
- nchange with (match Word x1 with [ Word a ⇒ False | Byte _ ⇒ True ]);
- nrewrite > H;
- nnormalize;
- napply I.
-nqed.
-
-nlemma symmetric_eqb8w16 : ∀bw1,bw2.eq_b8w16 bw1 bw2 = eq_b8w16 bw2 bw1.
- #bw1; #bw2;
- ncases bw1;
- #x1;
- ncases bw2;
- #x2;
- ##[ ##1: nchange with (eq_b8 x1 x2 = eq_b8 x2 x1);
-          nrewrite > (symmetric_eqb8 x1 x2);
-          napply refl_eq
- ##| ##2,3: nnormalize; napply refl_eq
- ##| ##4: nchange with (eq_w16 x1 x2 = eq_w16 x2 x1);
-          nrewrite > (symmetric_eqw16 x1 x2);
-          napply refl_eq
- ##]
-nqed.
-
-nlemma eqb8w16_to_eq : ∀bw1,bw2.eq_b8w16 bw1 bw2 = true → bw1 = bw2.
- #bw1; #bw2;
- ncases bw1; #e1; ncases bw2; #e2;
- ##[ ##1: nchange with ((eq_b8 e1 e2 = true) → ?); #H; nrewrite > (eqb8_to_eq … H); napply refl_eq
- ##| ##2,3: nnormalize; #H; napply (bool_destruct … H)
- ##| ##4: nchange with ((eq_w16 e1 e2 = true) → ?); #H; nrewrite > (eqw16_to_eq … H); napply refl_eq
- ##]
-nqed.
-
-nlemma eq_to_eqb8w16 : ∀bw1,bw2.bw1 = bw2 → eq_b8w16 bw1 bw2 = true.
- #bw1; #bw2;
- ncases bw1; #e1; ncases bw2; #e2;
- ##[ ##1: #H; nrewrite > (b8w16_destruct_b8_b8 … H);
-          nchange with (eq_b8 e2 e2 = true);
-          nrewrite > (eq_to_eqb8 e2 e2 (refl_eq …));
-          napply refl_eq
- ##| ##2: #H; nelim (b8w16_destruct_b8_w16 … H)
- ##| ##3: #H; nelim (b8w16_destruct_w16_b8 … H);
- ##| ##4: #H; nrewrite > (b8w16_destruct_w16_w16 … H);
-          nchange with (eq_w16 e2 e2 = true);
-          nrewrite > (eq_to_eqw16 e2 e2 (refl_eq …));
-          napply refl_eq
- ##]
-nqed.
-
-nlemma decidable_b8w16 : ∀x,y:byte8_or_word16.decidable (x = y).
- #x; nelim x; #e1; #y; nelim y; #e2;
- nnormalize;
- ##[ ##1: napply (or2_elim (? = ?) (? ≠ ?) ? (decidable_b8 e1 e2) …);
-          ##[ ##2: #H; napply (or2_intro2 (? = ?) (? ≠ ?) … ); nnormalize; #H1; napply (H (b8w16_destruct_b8_b8 … H1))
-          ##| ##1: #H; nrewrite > H; napply (or2_intro1 (? = ?) (? ≠ ?) (refl_eq …))
-          ##]
- ##| ##2: napply (or2_intro2 (? = ?) (? ≠ ?) …); nnormalize; #H; napply (b8w16_destruct_b8_w16 … H)
- ##| ##3: napply (or2_intro2 (? = ?) (? ≠ ?) …); nnormalize; #H; napply (b8w16_destruct_w16_b8 … H)
- ##| ##4: napply (or2_elim (? = ?) (? ≠ ?) ? (decidable_w16 e1 e2) …);
-          ##[ ##2: #H; napply (or2_intro2 (? = ?) (? ≠ ?) … ); nnormalize; #H1; napply (H (b8w16_destruct_w16_w16 … H1))
-          ##| ##1: #H; nrewrite > H; napply (or2_intro1 (? = ?) (? ≠ ?) (refl_eq …))
-          ##]
- ##]
-nqed.
-
-nlemma neqb8w16_to_neq : ∀bw1,bw2.eq_b8w16 bw1 bw2 = false → bw1 ≠ bw2.
- #bw1; #bw2;
- ncases bw1; #e1; ncases bw2; #e2;
- ##[ ##1: nchange with ((eq_b8 e1 e2 = false) → ?); #H;
-          nnormalize; #H1; napply (neqb8_to_neq … H); napply (b8w16_destruct_b8_b8 … H1)
- ##| ##2: nnormalize; #H; #H1; napply (b8w16_destruct_b8_w16 … H1)
- ##| ##3: nnormalize; #H; #H1; napply (b8w16_destruct_w16_b8 … H1)
- ##| ##4: nchange with ((eq_w16 e1 e2 = false) → ?); #H;
-          nnormalize; #H1; napply (neqw16_to_neq … H); napply (b8w16_destruct_w16_w16 … H1)
- ##]
-nqed.
diff --git a/helm/software/matita/contribs/ng_assembly/freescale/opcode_base_lemmas_instrmode.ma b/helm/software/matita/contribs/ng_assembly/freescale/opcode_base_lemmas_instrmode.ma
deleted file mode 100755 (executable)
index 26d0bb7..0000000
+++ /dev/null
@@ -1,425 +0,0 @@
-(**************************************************************************)
-(*       ___                                                              *)
-(*      ||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              *)
-(*   Ultima modifica: 05/08/2009                                          *)
-(*                                                                        *)
-(* ********************************************************************** *)
-
-include "num/oct_lemmas.ma".
-include "num/bitrigesim_lemmas.ma".
-include "num/exadecim_lemmas.ma".
-include "freescale/opcode_base.ma".
-
-(* ********************************************** *)
-(* MATTONI BASE PER DEFINIRE LE TABELLE DELLE MCU *)
-(* ********************************************** *)
-
-nlemma instrmode_destruct_MODE_DIRn : ∀n1,n2.MODE_DIRn n1 = MODE_DIRn n2 → n1 = n2.
- #n1; #n2; #H;
- nchange with (match MODE_DIRn n2 with [ MODE_DIRn a ⇒ n1 = a | _ ⇒ False ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma instrmode_destruct_MODE_DIRn_and_IMM1 : ∀n1,n2.MODE_DIRn_and_IMM1 n1 = MODE_DIRn_and_IMM1 n2 → n1 = n2.
- #n1; #n2; #H;
- nchange with (match MODE_DIRn_and_IMM1 n2 with [ MODE_DIRn_and_IMM1 a ⇒ n1 = a | _ ⇒ False ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma instrmode_destruct_MODE_TNY : ∀e1,e2.MODE_TNY e1 = MODE_TNY e2 → e1 = e2.
- #e1; #e2; #H;
- nchange with (match MODE_TNY e2 with [ MODE_TNY a ⇒ e1 = a | _ ⇒ False ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma instrmode_destruct_MODE_SRT : ∀t1,t2.MODE_SRT t1 = MODE_SRT t2 → t1 = t2.
- #t1; #t2; #H;
- nchange with (match MODE_SRT t2 with [ MODE_SRT a ⇒ t1 = a | _ ⇒ False ]);
- nrewrite < H;
- nnormalize;
- napply refl_eq.
-nqed.
-
-ndefinition instrmode_destruct_aux ≝
-Πi1,i2.ΠP:Prop.i1 = i2 →
- match eq_im i1 i2 with [ true ⇒ P → P | false ⇒ P ].
-
-ndefinition instrmode_destruct : instrmode_destruct_aux.
- #t1; #t2; #P; #H;
- nrewrite < H;
- nelim t1;
- nnormalize;
- ##[ ##31,32,33,34: #sub; nelim sub; nnormalize ##]
- napply (λx.x).
-nqed.
-
-nlemma eq_to_eqim : ∀n1,n2.n1 = n2 → eq_im n1 n2 = true.
- #n1; #n2; #H;
- nrewrite > H;
- nelim n2;
- ##[ ##31,32: #n; nchange with (eq_oct n n = true); napply (eq_to_eqoct n n (refl_eq …))
- ##| ##33: #n; nchange with (eq_ex n n = true); napply (eq_to_eqex n n (refl_eq …))
- ##| ##34: #n; nchange with (eq_bit n n = true); napply (eq_to_eqbit n n (refl_eq …))
- ##| ##*: nnormalize; napply refl_eq
- ##]
-nqed.
-
-nlemma neqim_to_neq : ∀n1,n2.eq_im n1 n2 = false → n1 ≠ n2.
- #n1; #n2; #H;
- napply (not_to_not (n1 = n2) (eq_im n1 n2 = true) …);
- ##[ ##1: napply (eq_to_eqim n1 n2)
- ##| ##2: napply (eqfalse_to_neqtrue … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq1 : ∀i2.eq_im MODE_INH i2 = true → MODE_INH = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##1: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq2 : ∀i2.eq_im MODE_INHA i2 = true → MODE_INHA = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##2: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq3 : ∀i2.eq_im MODE_INHX i2 = true → MODE_INHX = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##3: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq4 : ∀i2.eq_im MODE_INHH i2 = true → MODE_INHH = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##4: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq5 : ∀i2.eq_im MODE_INHX0ADD i2 = true → MODE_INHX0ADD = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##5: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq6 : ∀i2.eq_im MODE_INHX1ADD i2 = true → MODE_INHX1ADD = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##6: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq7 : ∀i2.eq_im MODE_INHX2ADD i2 = true → MODE_INHX2ADD = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##7: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq8 : ∀i2.eq_im MODE_IMM1 i2 = true → MODE_IMM1 = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##8: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq9 : ∀i2.eq_im MODE_IMM1EXT i2 = true → MODE_IMM1EXT = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##9: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq10 : ∀i2.eq_im MODE_IMM2 i2 = true → MODE_IMM2 = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##10: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq11 : ∀i2.eq_im MODE_DIR1 i2 = true → MODE_DIR1 = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##11: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq12 : ∀i2.eq_im MODE_DIR2 i2 = true → MODE_DIR2 = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##12: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq13 : ∀i2.eq_im MODE_IX0 i2 = true → MODE_IX0 = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##13: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq14 : ∀i2.eq_im MODE_IX1 i2 = true → MODE_IX1 = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##14: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq15 : ∀i2.eq_im MODE_IX2 i2 = true → MODE_IX2 = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##15: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq16 : ∀i2.eq_im MODE_SP1 i2 = true → MODE_SP1 = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##16: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq17 : ∀i2.eq_im MODE_SP2 i2 = true → MODE_SP2 = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##17: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq18 : ∀i2.eq_im MODE_DIR1_to_DIR1 i2 = true → MODE_DIR1_to_DIR1 = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##18: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq19 : ∀i2.eq_im MODE_IMM1_to_DIR1 i2 = true → MODE_IMM1_to_DIR1 = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##19: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq20 : ∀i2.eq_im MODE_IX0p_to_DIR1 i2 = true → MODE_IX0p_to_DIR1 = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##20: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq21 : ∀i2.eq_im MODE_DIR1_to_IX0p i2 = true → MODE_DIR1_to_IX0p = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##21: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq22 : ∀i2.eq_im MODE_INHA_and_IMM1 i2 = true → MODE_INHA_and_IMM1 = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##22: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq23 : ∀i2.eq_im MODE_INHX_and_IMM1 i2 = true → MODE_INHX_and_IMM1 = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##23: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq24 : ∀i2.eq_im MODE_IMM1_and_IMM1 i2 = true → MODE_IMM1_and_IMM1 = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##24: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq25 : ∀i2.eq_im MODE_DIR1_and_IMM1 i2 = true → MODE_DIR1_and_IMM1 = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##25: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq26 : ∀i2.eq_im MODE_IX0_and_IMM1 i2 = true → MODE_IX0_and_IMM1 = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##26: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq27 : ∀i2.eq_im MODE_IX0p_and_IMM1 i2 = true → MODE_IX0p_and_IMM1 = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##27: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq28 : ∀i2.eq_im MODE_IX1_and_IMM1 i2 = true → MODE_IX1_and_IMM1 = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##28: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq29 : ∀i2.eq_im MODE_IX1p_and_IMM1 i2 = true → MODE_IX1p_and_IMM1 = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##29: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq30 : ∀i2.eq_im MODE_SP1_and_IMM1 i2 = true → MODE_SP1_and_IMM1 = i2.
- #i2; ncases i2; nnormalize;
- ##[ ##30: #H; napply refl_eq
- ##| ##31,32,33,34: #n; #H; napply (bool_destruct … H)
- ##| ##*: #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq31 : ∀n1,i2.eq_im (MODE_DIRn n1) i2 = true → MODE_DIRn n1 = i2.
- #n1; #i2; ncases i2;
- ##[ ##31: #n2; #H;
-     nchange in H:(%) with (eq_oct n1 n2 = true);
-     nrewrite > (eqoct_to_eq … H);
-     napply refl_eq
- ##| ##32,33,34: nnormalize; #n2; #H; napply (bool_destruct … H)
- ##| ##*: nnormalize; #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq32 : ∀n1,i2.eq_im (MODE_DIRn_and_IMM1 n1) i2 = true → MODE_DIRn_and_IMM1 n1 = i2.
- #n1; #i2; ncases i2;
- ##[ ##32: #n2; #H;
-     nchange in H:(%) with (eq_oct n1 n2 = true);
-     nrewrite > (eqoct_to_eq … H);
-     napply refl_eq
- ##| ##31,33,34: nnormalize; #n2; #H; napply (bool_destruct … H)
- ##| ##*: nnormalize; #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq33 : ∀n1,i2.eq_im (MODE_TNY n1) i2 = true → MODE_TNY n1 = i2.
- #n1; #i2; ncases i2;
- ##[ ##33: #n2; #H;
-     nchange in H:(%) with (eq_ex n1 n2 = true);
-     nrewrite > (eqex_to_eq … H);
-     napply refl_eq
- ##| ##31,32,34: nnormalize; #n2; #H; napply (bool_destruct … H)
- ##| ##*: nnormalize; #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq34 : ∀n1,i2.eq_im (MODE_SRT n1) i2 = true → MODE_SRT n1 = i2.
- #n1; #i2; ncases i2;
- ##[ ##34: #n2; #H;
-     nchange in H:(%) with (eq_bit n1 n2 = true);
-     nrewrite > (eqbit_to_eq … H);
-     napply refl_eq
- ##| ##31,32,33: nnormalize; #n2; #H; napply (bool_destruct … H)
- ##| ##*: nnormalize; #H; napply (bool_destruct … H)
- ##]
-nqed.
-
-nlemma eqim_to_eq : ∀i1,i2.eq_im i1 i2 = true → i1 = i2.
- #i1; ncases i1;
- ##[ ##1: napply eqim_to_eq1 ##| ##2: napply eqim_to_eq2
- ##| ##3: napply eqim_to_eq3 ##| ##4: napply eqim_to_eq4
- ##| ##5: napply eqim_to_eq5 ##| ##6: napply eqim_to_eq6
- ##| ##7: napply eqim_to_eq7 ##| ##8: napply eqim_to_eq8
- ##| ##9: napply eqim_to_eq9 ##| ##10: napply eqim_to_eq10
- ##| ##11: napply eqim_to_eq11 ##| ##12: napply eqim_to_eq12
- ##| ##13: napply eqim_to_eq13 ##| ##14: napply eqim_to_eq14
- ##| ##15: napply eqim_to_eq15 ##| ##16: napply eqim_to_eq16
- ##| ##17: napply eqim_to_eq17 ##| ##18: napply eqim_to_eq18
- ##| ##19: napply eqim_to_eq19 ##| ##20: napply eqim_to_eq20
- ##| ##21: napply eqim_to_eq21 ##| ##22: napply eqim_to_eq22
- ##| ##23: napply eqim_to_eq23 ##| ##24: napply eqim_to_eq24
- ##| ##25: napply eqim_to_eq25 ##| ##26: napply eqim_to_eq26
- ##| ##27: napply eqim_to_eq27 ##| ##28: napply eqim_to_eq28
- ##| ##29: napply eqim_to_eq29 ##| ##30: napply eqim_to_eq30
- ##| ##31: napply eqim_to_eq31 ##| ##32: napply eqim_to_eq32
- ##| ##33: napply eqim_to_eq33 ##| ##34: napply eqim_to_eq34
- ##]
-nqed.
-
-nlemma neq_to_neqim : ∀n1,n2.n1 ≠ n2 → eq_im n1 n2 = false.
- #n1; #n2; #H;
- napply (neqtrue_to_eqfalse (eq_im n1 n2));
- napply (not_to_not (eq_im n1 n2 = true) (n1 = n2) ? H);
- napply (eqim_to_eq n1 n2).
-nqed.
-
-nlemma decidable_im : ∀x,y:instr_mode.decidable (x = y).
- #x; #y; nnormalize;
- napply (or2_elim (eq_im x y = true) (eq_im x y = false) ? (decidable_bexpr ?));
- ##[ ##1: #H; napply (or2_intro1 (x = y) (x ≠ y) (eqim_to_eq … H))
- ##| ##2: #H; napply (or2_intro2 (x = y) (x ≠ y) (neqim_to_neq … H))
- ##]
-nqed.
-
-nlemma symmetric_eqim : symmetricT instr_mode bool eq_im.
- #n1; #n2;
- napply (or2_elim (n1 = n2) (n1 ≠ n2) ? (decidable_im n1 n2));
- ##[ ##1: #H; nrewrite > H; napply refl_eq
- ##| ##2: #H; nrewrite > (neq_to_neqim n1 n2 H);
-          napply (symmetric_eq ? (eq_im n2 n1) false);
-          napply (neq_to_neqim n2 n1 (symmetric_neq ? n1 n2 H))
- ##]
-nqed.
diff --git a/helm/software/matita/contribs/ng_assembly/freescale/opcode_base_lemmas_opcode.ma b/helm/software/matita/contribs/ng_assembly/freescale/opcode_base_lemmas_opcode.ma
deleted file mode 100755 (executable)
index d91fa05..0000000
+++ /dev/null
@@ -1,200 +0,0 @@
-(**************************************************************************)
-(*       ___                                                              *)
-(*      ||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              *)
-(*   Ultima modifica: 05/08/2009                                          *)
-(*                                                                        *)
-(* ********************************************************************** *)
-
-include "num/bool_lemmas.ma".
-include "freescale/opcode_base.ma".
-
-(* ********************************************** *)
-(* MATTONI BASE PER DEFINIRE LE TABELLE DELLE MCU *)
-(* ********************************************** *)
-
-ndefinition opcode_destruct_aux ≝
-Πop1,op2.ΠP:Prop.op1 = op2 →
- match eq_op op1 op2 with [ true ⇒ P → P | false ⇒ P ].
-
-ndefinition opcode_destruct : opcode_destruct_aux.
- #op1; #op2; #P; #H;
- nrewrite < H;
- nelim op1;
- nnormalize;
- napply (λx.x).
-nqed.
-
-nlemma eq_to_eqop : ∀n1,n2.n1 = n2 → eq_op n1 n2 = true.
- #n1; #n2; #H;
- nrewrite > H;
- nelim n2;
- nnormalize;
- napply refl_eq.
-nqed.
-
-nlemma neqop_to_neq : ∀n1,n2.eq_op n1 n2 = false → n1 ≠ n2.
- #n1; #n2; #H;
- napply (not_to_not (n1 = n2) (eq_op n1 n2 = true) …);
- ##[ ##1: napply (eq_to_eqop n1 n2)
- ##| ##2: napply (eqfalse_to_neqtrue … H)
- ##]
-nqed.
-
-nlemma eqop_to_eq1 : ∀op2.eq_op ADC op2 = true → ADC = op2. #op2; ncases op2; nnormalize; #H; ##[ ##1: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq2 : ∀op2.eq_op ADD op2 = true → ADD = op2. #op2; ncases op2; nnormalize; #H; ##[ ##2: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq3 : ∀op2.eq_op AIS op2 = true → AIS = op2. #op2; ncases op2; nnormalize; #H; ##[ ##3: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq4 : ∀op2.eq_op AIX op2 = true → AIX = op2. #op2; ncases op2; nnormalize; #H; ##[ ##4: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq5 : ∀op2.eq_op AND op2 = true → AND = op2. #op2; ncases op2; nnormalize; #H; ##[ ##5: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq6 : ∀op2.eq_op ASL op2 = true → ASL = op2. #op2; ncases op2; nnormalize; #H; ##[ ##6: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq7 : ∀op2.eq_op ASR op2 = true → ASR = op2. #op2; ncases op2; nnormalize; #H; ##[ ##7: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq8 : ∀op2.eq_op BCC op2 = true → BCC = op2. #op2; ncases op2; nnormalize; #H; ##[ ##8: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq9 : ∀op2.eq_op BCLRn op2 = true → BCLRn = op2. #op2; ncases op2; nnormalize; #H; ##[ ##9: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq10 : ∀op2.eq_op BCS op2 = true → BCS = op2. #op2; ncases op2; nnormalize; #H; ##[ ##10: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq11 : ∀op2.eq_op BEQ op2 = true → BEQ = op2. #op2; ncases op2; nnormalize; #H; ##[ ##11: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq12 : ∀op2.eq_op BGE op2 = true → BGE = op2. #op2; ncases op2; nnormalize; #H; ##[ ##12: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq13 : ∀op2.eq_op BGND op2 = true → BGND = op2. #op2; ncases op2; nnormalize; #H; ##[ ##13: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq14 : ∀op2.eq_op BGT op2 = true → BGT = op2. #op2; ncases op2; nnormalize; #H; ##[ ##14: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq15 : ∀op2.eq_op BHCC op2 = true → BHCC = op2. #op2; ncases op2; nnormalize; #H; ##[ ##15: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq16 : ∀op2.eq_op BHCS op2 = true → BHCS = op2. #op2; ncases op2; nnormalize; #H; ##[ ##16: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq17 : ∀op2.eq_op BHI op2 = true → BHI = op2. #op2; ncases op2; nnormalize; #H; ##[ ##17: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq18 : ∀op2.eq_op BIH op2 = true → BIH = op2. #op2; ncases op2; nnormalize; #H; ##[ ##18: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq19 : ∀op2.eq_op BIL op2 = true → BIL = op2. #op2; ncases op2; nnormalize; #H; ##[ ##19: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq20 : ∀op2.eq_op BIT op2 = true → BIT = op2. #op2; ncases op2; nnormalize; #H; ##[ ##20: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq21 : ∀op2.eq_op BLE op2 = true → BLE = op2. #op2; ncases op2; nnormalize; #H; ##[ ##21: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq22 : ∀op2.eq_op BLS op2 = true → BLS = op2. #op2; ncases op2; nnormalize; #H; ##[ ##22: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq23 : ∀op2.eq_op BLT op2 = true → BLT = op2. #op2; ncases op2; nnormalize; #H; ##[ ##23: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq24 : ∀op2.eq_op BMC op2 = true → BMC = op2. #op2; ncases op2; nnormalize; #H; ##[ ##24: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq25 : ∀op2.eq_op BMI op2 = true → BMI = op2. #op2; ncases op2; nnormalize; #H; ##[ ##25: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq26 : ∀op2.eq_op BMS op2 = true → BMS = op2. #op2; ncases op2; nnormalize; #H; ##[ ##26: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq27 : ∀op2.eq_op BNE op2 = true → BNE = op2. #op2; ncases op2; nnormalize; #H; ##[ ##27: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq28 : ∀op2.eq_op BPL op2 = true → BPL = op2. #op2; ncases op2; nnormalize; #H; ##[ ##28: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq29 : ∀op2.eq_op BRA op2 = true → BRA = op2. #op2; ncases op2; nnormalize; #H; ##[ ##29: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq30 : ∀op2.eq_op BRCLRn op2 = true → BRCLRn = op2. #op2; ncases op2; nnormalize; #H; ##[ ##30: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq31 : ∀op2.eq_op BRN op2 = true → BRN = op2. #op2; ncases op2; nnormalize; #H; ##[ ##31: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq32 : ∀op2.eq_op BRSETn op2 = true → BRSETn = op2. #op2; ncases op2; nnormalize; #H; ##[ ##32: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq33 : ∀op2.eq_op BSETn op2 = true → BSETn = op2. #op2; ncases op2; nnormalize; #H; ##[ ##33: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq34 : ∀op2.eq_op BSR op2 = true → BSR = op2. #op2; ncases op2; nnormalize; #H; ##[ ##34: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq35 : ∀op2.eq_op CBEQA op2 = true → CBEQA = op2. #op2; ncases op2; nnormalize; #H; ##[ ##35: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq36 : ∀op2.eq_op CBEQX op2 = true → CBEQX = op2. #op2; ncases op2; nnormalize; #H; ##[ ##36: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq37 : ∀op2.eq_op CLC op2 = true → CLC = op2. #op2; ncases op2; nnormalize; #H; ##[ ##37: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq38 : ∀op2.eq_op CLI op2 = true → CLI = op2. #op2; ncases op2; nnormalize; #H; ##[ ##38: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq39 : ∀op2.eq_op CLR op2 = true → CLR = op2. #op2; ncases op2; nnormalize; #H; ##[ ##39: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq40 : ∀op2.eq_op CMP op2 = true → CMP = op2. #op2; ncases op2; nnormalize; #H; ##[ ##40: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq41 : ∀op2.eq_op COM op2 = true → COM = op2. #op2; ncases op2; nnormalize; #H; ##[ ##41: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq42 : ∀op2.eq_op CPHX op2 = true → CPHX = op2. #op2; ncases op2; nnormalize; #H; ##[ ##42: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq43 : ∀op2.eq_op CPX op2 = true → CPX = op2. #op2; ncases op2; nnormalize; #H; ##[ ##43: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq44 : ∀op2.eq_op DAA op2 = true → DAA = op2. #op2; ncases op2; nnormalize; #H; ##[ ##44: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq45 : ∀op2.eq_op DBNZ op2 = true → DBNZ = op2. #op2; ncases op2; nnormalize; #H; ##[ ##45: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq46 : ∀op2.eq_op DEC op2 = true → DEC = op2. #op2; ncases op2; nnormalize; #H; ##[ ##46: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq47 : ∀op2.eq_op DIV op2 = true → DIV = op2. #op2; ncases op2; nnormalize; #H; ##[ ##47: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq48 : ∀op2.eq_op EOR op2 = true → EOR = op2. #op2; ncases op2; nnormalize; #H; ##[ ##48: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq49 : ∀op2.eq_op INC op2 = true → INC = op2. #op2; ncases op2; nnormalize; #H; ##[ ##49: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq50 : ∀op2.eq_op JMP op2 = true → JMP = op2. #op2; ncases op2; nnormalize; #H; ##[ ##50: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq51 : ∀op2.eq_op JSR op2 = true → JSR = op2. #op2; ncases op2; nnormalize; #H; ##[ ##51: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq52 : ∀op2.eq_op LDA op2 = true → LDA = op2. #op2; ncases op2; nnormalize; #H; ##[ ##52: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq53 : ∀op2.eq_op LDHX op2 = true → LDHX = op2. #op2; ncases op2; nnormalize; #H; ##[ ##53: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq54 : ∀op2.eq_op LDX op2 = true → LDX = op2. #op2; ncases op2; nnormalize; #H; ##[ ##54: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq55 : ∀op2.eq_op LSR op2 = true → LSR = op2. #op2; ncases op2; nnormalize; #H; ##[ ##55: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq56 : ∀op2.eq_op MOV op2 = true → MOV = op2. #op2; ncases op2; nnormalize; #H; ##[ ##56: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq57 : ∀op2.eq_op MUL op2 = true → MUL = op2. #op2; ncases op2; nnormalize; #H; ##[ ##57: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq58 : ∀op2.eq_op NEG op2 = true → NEG = op2. #op2; ncases op2; nnormalize; #H; ##[ ##58: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq59 : ∀op2.eq_op NOP op2 = true → NOP = op2. #op2; ncases op2; nnormalize; #H; ##[ ##59: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq60 : ∀op2.eq_op NSA op2 = true → NSA = op2. #op2; ncases op2; nnormalize; #H; ##[ ##60: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq61 : ∀op2.eq_op ORA op2 = true → ORA = op2. #op2; ncases op2; nnormalize; #H; ##[ ##61: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq62 : ∀op2.eq_op PSHA op2 = true → PSHA = op2. #op2; ncases op2; nnormalize; #H; ##[ ##62: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq63 : ∀op2.eq_op PSHH op2 = true → PSHH = op2. #op2; ncases op2; nnormalize; #H; ##[ ##63: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq64 : ∀op2.eq_op PSHX op2 = true → PSHX = op2. #op2; ncases op2; nnormalize; #H; ##[ ##64: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq65 : ∀op2.eq_op PULA op2 = true → PULA = op2. #op2; ncases op2; nnormalize; #H; ##[ ##65: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq66 : ∀op2.eq_op PULH op2 = true → PULH = op2. #op2; ncases op2; nnormalize; #H; ##[ ##66: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq67 : ∀op2.eq_op PULX op2 = true → PULX = op2. #op2; ncases op2; nnormalize; #H; ##[ ##67: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq68 : ∀op2.eq_op ROL op2 = true → ROL = op2. #op2; ncases op2; nnormalize; #H; ##[ ##68: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq69 : ∀op2.eq_op ROR op2 = true → ROR = op2. #op2; ncases op2; nnormalize; #H; ##[ ##69: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq70 : ∀op2.eq_op RSP op2 = true → RSP = op2. #op2; ncases op2; nnormalize; #H; ##[ ##70: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq71 : ∀op2.eq_op RTI op2 = true → RTI = op2. #op2; ncases op2; nnormalize; #H; ##[ ##71: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq72 : ∀op2.eq_op RTS op2 = true → RTS = op2. #op2; ncases op2; nnormalize; #H; ##[ ##72: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq73 : ∀op2.eq_op SBC op2 = true → SBC = op2. #op2; ncases op2; nnormalize; #H; ##[ ##73: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq74 : ∀op2.eq_op SEC op2 = true → SEC = op2. #op2; ncases op2; nnormalize; #H; ##[ ##74: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq75 : ∀op2.eq_op SEI op2 = true → SEI = op2. #op2; ncases op2; nnormalize; #H; ##[ ##75: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq76 : ∀op2.eq_op SHA op2 = true → SHA = op2. #op2; ncases op2; nnormalize; #H; ##[ ##76: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq77 : ∀op2.eq_op SLA op2 = true → SLA = op2. #op2; ncases op2; nnormalize; #H; ##[ ##77: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq78 : ∀op2.eq_op STA op2 = true → STA = op2. #op2; ncases op2; nnormalize; #H; ##[ ##78: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq79 : ∀op2.eq_op STHX op2 = true → STHX = op2. #op2; ncases op2; nnormalize; #H; ##[ ##79: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq80 : ∀op2.eq_op STOP op2 = true → STOP = op2. #op2; ncases op2; nnormalize; #H; ##[ ##80: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq81 : ∀op2.eq_op STX op2 = true → STX = op2. #op2; ncases op2; nnormalize; #H; ##[ ##81: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq82 : ∀op2.eq_op SUB op2 = true → SUB = op2. #op2; ncases op2; nnormalize; #H; ##[ ##82: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq83 : ∀op2.eq_op SWI op2 = true → SWI = op2. #op2; ncases op2; nnormalize; #H; ##[ ##83: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq84 : ∀op2.eq_op TAP op2 = true → TAP = op2. #op2; ncases op2; nnormalize; #H; ##[ ##84: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq85 : ∀op2.eq_op TAX op2 = true → TAX = op2. #op2; ncases op2; nnormalize; #H; ##[ ##85: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq86 : ∀op2.eq_op TPA op2 = true → TPA = op2. #op2; ncases op2; nnormalize; #H; ##[ ##86: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq87 : ∀op2.eq_op TST op2 = true → TST = op2. #op2; ncases op2; nnormalize; #H; ##[ ##87: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq88 : ∀op2.eq_op TSX op2 = true → TSX = op2. #op2; ncases op2; nnormalize; #H; ##[ ##88: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq89 : ∀op2.eq_op TXA op2 = true → TXA = op2. #op2; ncases op2; nnormalize; #H; ##[ ##89: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq90 : ∀op2.eq_op TXS op2 = true → TXS = op2. #op2; ncases op2; nnormalize; #H; ##[ ##90: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-nlemma eqop_to_eq91 : ∀op2.eq_op WAIT op2 = true → WAIT = op2. #op2; ncases op2; nnormalize; #H; ##[ ##91: napply refl_eq ##| ##*: napply (bool_destruct … H) ##]nqed.
-
-nlemma eqop_to_eq : ∀op1,op2.eq_op op1 op2 = true → op1 = op2.
- #op1; ncases op1;
- ##[ ##1: napply eqop_to_eq1 ##| ##2: napply eqop_to_eq2 ##| ##3: napply eqop_to_eq3 ##| ##4: napply eqop_to_eq4
- ##| ##5: napply eqop_to_eq5 ##| ##6: napply eqop_to_eq6 ##| ##7: napply eqop_to_eq7 ##| ##8: napply eqop_to_eq8
- ##| ##9: napply eqop_to_eq9 ##| ##10: napply eqop_to_eq10 ##| ##11: napply eqop_to_eq11 ##| ##12: napply eqop_to_eq12
- ##| ##13: napply eqop_to_eq13 ##| ##14: napply eqop_to_eq14 ##| ##15: napply eqop_to_eq15 ##| ##16: napply eqop_to_eq16
- ##| ##17: napply eqop_to_eq17 ##| ##18: napply eqop_to_eq18 ##| ##19: napply eqop_to_eq19 ##| ##20: napply eqop_to_eq20
- ##| ##21: napply eqop_to_eq21 ##| ##22: napply eqop_to_eq22 ##| ##23: napply eqop_to_eq23 ##| ##24: napply eqop_to_eq24
- ##| ##25: napply eqop_to_eq25 ##| ##26: napply eqop_to_eq26 ##| ##27: napply eqop_to_eq27 ##| ##28: napply eqop_to_eq28
- ##| ##29: napply eqop_to_eq29 ##| ##30: napply eqop_to_eq30 ##| ##31: napply eqop_to_eq31 ##| ##32: napply eqop_to_eq32
- ##| ##33: napply eqop_to_eq33 ##| ##34: napply eqop_to_eq34 ##| ##35: napply eqop_to_eq35 ##| ##36: napply eqop_to_eq36
- ##| ##37: napply eqop_to_eq37 ##| ##38: napply eqop_to_eq38 ##| ##39: napply eqop_to_eq39 ##| ##40: napply eqop_to_eq40
- ##| ##41: napply eqop_to_eq41 ##| ##42: napply eqop_to_eq42 ##| ##43: napply eqop_to_eq43 ##| ##44: napply eqop_to_eq44
- ##| ##45: napply eqop_to_eq45 ##| ##46: napply eqop_to_eq46 ##| ##47: napply eqop_to_eq47 ##| ##48: napply eqop_to_eq48
- ##| ##49: napply eqop_to_eq49 ##| ##50: napply eqop_to_eq50 ##| ##51: napply eqop_to_eq51 ##| ##52: napply eqop_to_eq52
- ##| ##53: napply eqop_to_eq53 ##| ##54: napply eqop_to_eq54 ##| ##55: napply eqop_to_eq55 ##| ##56: napply eqop_to_eq56
- ##| ##57: napply eqop_to_eq57 ##| ##58: napply eqop_to_eq58 ##| ##59: napply eqop_to_eq59 ##| ##60: napply eqop_to_eq60
- ##| ##61: napply eqop_to_eq61 ##| ##62: napply eqop_to_eq62 ##| ##63: napply eqop_to_eq63 ##| ##64: napply eqop_to_eq64
- ##| ##65: napply eqop_to_eq65 ##| ##66: napply eqop_to_eq66 ##| ##67: napply eqop_to_eq67 ##| ##68: napply eqop_to_eq68
- ##| ##69: napply eqop_to_eq69 ##| ##70: napply eqop_to_eq70 ##| ##71: napply eqop_to_eq71 ##| ##72: napply eqop_to_eq72
- ##| ##73: napply eqop_to_eq73 ##| ##74: napply eqop_to_eq74 ##| ##75: napply eqop_to_eq75 ##| ##76: napply eqop_to_eq76
- ##| ##77: napply eqop_to_eq77 ##| ##78: napply eqop_to_eq78 ##| ##79: napply eqop_to_eq79 ##| ##80: napply eqop_to_eq80
- ##| ##81: napply eqop_to_eq81 ##| ##82: napply eqop_to_eq82 ##| ##83: napply eqop_to_eq83 ##| ##84: napply eqop_to_eq84
- ##| ##85: napply eqop_to_eq85 ##| ##86: napply eqop_to_eq86 ##| ##87: napply eqop_to_eq87 ##| ##88: napply eqop_to_eq88
- ##| ##89: napply eqop_to_eq89 ##| ##90: napply eqop_to_eq90 ##| ##91: napply eqop_to_eq91 ##]
-nqed.
-
-nlemma neq_to_neqop : ∀n1,n2.n1 ≠ n2 → eq_op n1 n2 = false.
- #n1; #n2; #H;
- napply (neqtrue_to_eqfalse (eq_op n1 n2));
- napply (not_to_not (eq_op n1 n2 = true) (n1 = n2) ? H);
- napply (eqop_to_eq n1 n2).
-nqed.
-
-nlemma decidable_op : ∀x,y:opcode.decidable (x = y).
- #x; #y; nnormalize;
- napply (or2_elim (eq_op x y = true) (eq_op x y = false) ? (decidable_bexpr ?));
- ##[ ##1: #H; napply (or2_intro1 (x = y) (x ≠ y) (eqop_to_eq … H))
- ##| ##2: #H; napply (or2_intro2 (x = y) (x ≠ y) (neqop_to_neq … H))
- ##]
-nqed.
-
-nlemma symmetric_eqop : symmetricT opcode bool eq_op.
- #n1; #n2;
- napply (or2_elim (n1 = n2) (n1 ≠ n2) ? (decidable_op n1 n2));
- ##[ ##1: #H; nrewrite > H; napply refl_eq
- ##| ##2: #H; nrewrite > (neq_to_neqop n1 n2 H);
-          napply (symmetric_eq ? (eq_op n2 n1) false);
-          napply (neq_to_neqop n2 n1 (symmetric_neq ? n1 n2 H))
- ##]
-nqed.
diff --git a/helm/software/matita/contribs/ng_assembly/freescale/table_HC05.ma b/helm/software/matita/contribs/ng_assembly/freescale/table_HC05.ma
deleted file mode 100755 (executable)
index d02f4f3..0000000
+++ /dev/null
@@ -1,377 +0,0 @@
-(**************************************************************************)
-(*       ___                                                              *)
-(*      ||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              *)
-(*   Ultima modifica: 05/08/2009                                          *)
-(*                                                                        *)
-(* ********************************************************************** *)
-
-include "freescale/opcode_base.ma".
-include "common/list.ma".
-
-(* ***************** *)
-(* TABELLA DELL'HC05 *)
-(* ***************** *)
-
-(* definizione come concatenazione finale di liste per velocizzare il parsing *)
-(* ogni riga e' (any_opcode m) (instr_mode) (opcode esadecimale) (#cicli esecuzione) *)
-(* NB: l'uso di any_opcode m + concatenazione finale tutte liste
-       impedisce di introdurre opcode disomogenei (per mcu) *)
-
-ndefinition opcode_table_HC05_1 ≝
-[
-  quadruple … (anyOP HC05 ADC) MODE_IMM1 (Byte 〈xA,x9〉) 〈x0,x2〉
-; quadruple … (anyOP HC05 ADC) MODE_DIR1 (Byte 〈xB,x9〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 ADC) MODE_DIR2 (Byte 〈xC,x9〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 ADC) MODE_IX2  (Byte 〈xD,x9〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 ADC) MODE_IX1  (Byte 〈xE,x9〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 ADC) MODE_IX0  (Byte 〈xF,x9〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HC05_2 ≝
-[
-  quadruple … (anyOP HC05 ADD) MODE_IMM1 (Byte 〈xA,xB〉) 〈x0,x2〉
-; quadruple … (anyOP HC05 ADD) MODE_DIR1 (Byte 〈xB,xB〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 ADD) MODE_DIR2 (Byte 〈xC,xB〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 ADD) MODE_IX2  (Byte 〈xD,xB〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 ADD) MODE_IX1  (Byte 〈xE,xB〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 ADD) MODE_IX0  (Byte 〈xF,xB〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_HC05_3 ≝
-[
-  quadruple … (anyOP HC05 AND) MODE_IMM1 (Byte 〈xA,x4〉) 〈x0,x2〉
-; quadruple … (anyOP HC05 AND) MODE_DIR1 (Byte 〈xB,x4〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 AND) MODE_DIR2 (Byte 〈xC,x4〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 AND) MODE_IX2  (Byte 〈xD,x4〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 AND) MODE_IX1  (Byte 〈xE,x4〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 AND) MODE_IX0  (Byte 〈xF,x4〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_HC05_4 ≝
-[
-  quadruple … (anyOP HC05 ASL) MODE_DIR1 (Byte 〈x3,x8〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 ASL) MODE_INHA (Byte 〈x4,x8〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 ASL) MODE_INHX (Byte 〈x5,x8〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 ASL) MODE_IX1  (Byte 〈x6,x8〉) 〈x0,x6〉
-; quadruple … (anyOP HC05 ASL) MODE_IX0  (Byte 〈x7,x8〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HC05_5 ≝
-[
-  quadruple … (anyOP HC05 ASR) MODE_DIR1 (Byte 〈x3,x7〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 ASR) MODE_INHA (Byte 〈x4,x7〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 ASR) MODE_INHX (Byte 〈x5,x7〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 ASR) MODE_IX1  (Byte 〈x6,x7〉) 〈x0,x6〉
-; quadruple … (anyOP HC05 ASR) MODE_IX0  (Byte 〈x7,x7〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HC05_6 ≝
-[
-  quadruple … (anyOP HC05 BRA ) MODE_IMM1 (Byte 〈x2,x0〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 BRN ) MODE_IMM1 (Byte 〈x2,x1〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 BHI ) MODE_IMM1 (Byte 〈x2,x2〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 BLS ) MODE_IMM1 (Byte 〈x2,x3〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 BCC ) MODE_IMM1 (Byte 〈x2,x4〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 BCS ) MODE_IMM1 (Byte 〈x2,x5〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 BNE ) MODE_IMM1 (Byte 〈x2,x6〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 BEQ ) MODE_IMM1 (Byte 〈x2,x7〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 BHCC) MODE_IMM1 (Byte 〈x2,x8〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 BHCS) MODE_IMM1 (Byte 〈x2,x9〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 BPL ) MODE_IMM1 (Byte 〈x2,xA〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 BMI ) MODE_IMM1 (Byte 〈x2,xB〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 BMC ) MODE_IMM1 (Byte 〈x2,xC〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 BMS ) MODE_IMM1 (Byte 〈x2,xD〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 BIL ) MODE_IMM1 (Byte 〈x2,xE〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 BIH ) MODE_IMM1 (Byte 〈x2,xF〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_HC05_7 ≝
-[
-  quadruple … (anyOP HC05 BSETn) (MODE_DIRn o0) (Byte 〈x1,x0〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BCLRn) (MODE_DIRn o0) (Byte 〈x1,x1〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BSETn) (MODE_DIRn o1) (Byte 〈x1,x2〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BCLRn) (MODE_DIRn o1) (Byte 〈x1,x3〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BSETn) (MODE_DIRn o2) (Byte 〈x1,x4〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BCLRn) (MODE_DIRn o2) (Byte 〈x1,x5〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BSETn) (MODE_DIRn o3) (Byte 〈x1,x6〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BCLRn) (MODE_DIRn o3) (Byte 〈x1,x7〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BSETn) (MODE_DIRn o4) (Byte 〈x1,x8〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BCLRn) (MODE_DIRn o4) (Byte 〈x1,x9〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BSETn) (MODE_DIRn o5) (Byte 〈x1,xA〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BCLRn) (MODE_DIRn o5) (Byte 〈x1,xB〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BSETn) (MODE_DIRn o6) (Byte 〈x1,xC〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BCLRn) (MODE_DIRn o6) (Byte 〈x1,xD〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BSETn) (MODE_DIRn o7) (Byte 〈x1,xE〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BCLRn) (MODE_DIRn o7) (Byte 〈x1,xF〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HC05_8 ≝
-[
-  quadruple … (anyOP HC05 BRSETn) (MODE_DIRn_and_IMM1 o0) (Byte 〈x0,x0〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BRCLRn) (MODE_DIRn_and_IMM1 o0) (Byte 〈x0,x1〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BRSETn) (MODE_DIRn_and_IMM1 o1) (Byte 〈x0,x2〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BRCLRn) (MODE_DIRn_and_IMM1 o1) (Byte 〈x0,x3〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BRSETn) (MODE_DIRn_and_IMM1 o2) (Byte 〈x0,x4〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BRCLRn) (MODE_DIRn_and_IMM1 o2) (Byte 〈x0,x5〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BRSETn) (MODE_DIRn_and_IMM1 o3) (Byte 〈x0,x6〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BRCLRn) (MODE_DIRn_and_IMM1 o3) (Byte 〈x0,x7〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BRSETn) (MODE_DIRn_and_IMM1 o4) (Byte 〈x0,x8〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BRCLRn) (MODE_DIRn_and_IMM1 o4) (Byte 〈x0,x9〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BRSETn) (MODE_DIRn_and_IMM1 o5) (Byte 〈x0,xA〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BRCLRn) (MODE_DIRn_and_IMM1 o5) (Byte 〈x0,xB〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BRSETn) (MODE_DIRn_and_IMM1 o6) (Byte 〈x0,xC〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BRCLRn) (MODE_DIRn_and_IMM1 o6) (Byte 〈x0,xD〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BRSETn) (MODE_DIRn_and_IMM1 o7) (Byte 〈x0,xE〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BRCLRn) (MODE_DIRn_and_IMM1 o7) (Byte 〈x0,xF〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HC05_9 ≝
-[
-  quadruple … (anyOP HC05 BIT) MODE_IMM1 (Byte 〈xA,x5〉) 〈x0,x2〉
-; quadruple … (anyOP HC05 BIT) MODE_DIR1 (Byte 〈xB,x5〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 BIT) MODE_DIR2 (Byte 〈xC,x5〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 BIT) MODE_IX2  (Byte 〈xD,x5〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 BIT) MODE_IX1  (Byte 〈xE,x5〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 BIT) MODE_IX0  (Byte 〈xF,x5〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_HC05_10 ≝
-[
-  quadruple … (anyOP HC05 MUL ) MODE_INH (Byte 〈x4,x2〉) 〈x0,xB〉
-; quadruple … (anyOP HC05 RTI ) MODE_INH (Byte 〈x8,x0〉) 〈x0,x9〉
-; quadruple … (anyOP HC05 RTS ) MODE_INH (Byte 〈x8,x1〉) 〈x0,x6〉
-; quadruple … (anyOP HC05 SWI ) MODE_INH (Byte 〈x8,x3〉) 〈x0,xA〉
-; quadruple … (anyOP HC05 STOP) MODE_INH (Byte 〈x8,xE〉) 〈x0,x2〉
-; quadruple … (anyOP HC05 WAIT) MODE_INH (Byte 〈x8,xF〉) 〈x0,x2〉
-; quadruple … (anyOP HC05 TAX ) MODE_INH (Byte 〈x9,x7〉) 〈x0,x2〉
-; quadruple … (anyOP HC05 CLC ) MODE_INH (Byte 〈x9,x8〉) 〈x0,x2〉
-; quadruple … (anyOP HC05 SEC ) MODE_INH (Byte 〈x9,x9〉) 〈x0,x2〉
-; quadruple … (anyOP HC05 CLI ) MODE_INH (Byte 〈x9,xA〉) 〈x0,x2〉
-; quadruple … (anyOP HC05 SEI ) MODE_INH (Byte 〈x9,xB〉) 〈x0,x2〉
-; quadruple … (anyOP HC05 RSP ) MODE_INH (Byte 〈x9,xC〉) 〈x0,x2〉
-; quadruple … (anyOP HC05 NOP ) MODE_INH (Byte 〈x9,xD〉) 〈x0,x2〉
-; quadruple … (anyOP HC05 TXA ) MODE_INH (Byte 〈x9,xF〉) 〈x0,x2〉
-].
-
-ndefinition opcode_table_HC05_11 ≝
-[
-  quadruple … (anyOP HC05 CLR) MODE_DIR1 (Byte 〈x3,xF〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 CLR) MODE_INHA (Byte 〈x4,xF〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 CLR) MODE_INHX (Byte 〈x5,xF〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 CLR) MODE_IX1  (Byte 〈x6,xF〉) 〈x0,x6〉
-; quadruple … (anyOP HC05 CLR) MODE_IX0  (Byte 〈x7,xF〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HC05_12 ≝
-[
-  quadruple … (anyOP HC05 CMP) MODE_IMM1 (Byte 〈xA,x1〉) 〈x0,x2〉
-; quadruple … (anyOP HC05 CMP) MODE_DIR1 (Byte 〈xB,x1〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 CMP) MODE_DIR2 (Byte 〈xC,x1〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 CMP) MODE_IX2  (Byte 〈xD,x1〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 CMP) MODE_IX1  (Byte 〈xE,x1〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 CMP) MODE_IX0  (Byte 〈xF,x1〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_HC05_13 ≝
-[
-  quadruple … (anyOP HC05 COM) MODE_DIR1 (Byte 〈x3,x3〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 COM) MODE_INHA (Byte 〈x4,x3〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 COM) MODE_INHX (Byte 〈x5,x3〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 COM) MODE_IX1  (Byte 〈x6,x3〉) 〈x0,x6〉
-; quadruple … (anyOP HC05 COM) MODE_IX0  (Byte 〈x7,x3〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HC05_14 ≝
-[
-  quadruple … (anyOP HC05 CPX) MODE_IMM1 (Byte 〈xA,x3〉) 〈x0,x2〉
-; quadruple … (anyOP HC05 CPX) MODE_DIR1 (Byte 〈xB,x3〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 CPX) MODE_DIR2 (Byte 〈xC,x3〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 CPX) MODE_IX2  (Byte 〈xD,x3〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 CPX) MODE_IX1  (Byte 〈xE,x3〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 CPX) MODE_IX0  (Byte 〈xF,x3〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_HC05_15 ≝
-[
-  quadruple … (anyOP HC05 DEC) MODE_DIR1 (Byte 〈x3,xA〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 DEC) MODE_INHA (Byte 〈x4,xA〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 DEC) MODE_INHX (Byte 〈x5,xA〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 DEC) MODE_IX1  (Byte 〈x6,xA〉) 〈x0,x6〉
-; quadruple … (anyOP HC05 DEC) MODE_IX0  (Byte 〈x7,xA〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HC05_16 ≝
-[
-  quadruple … (anyOP HC05 EOR) MODE_IMM1 (Byte 〈xA,x8〉) 〈x0,x2〉
-; quadruple … (anyOP HC05 EOR) MODE_DIR1 (Byte 〈xB,x8〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 EOR) MODE_DIR2 (Byte 〈xC,x8〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 EOR) MODE_IX2  (Byte 〈xD,x8〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 EOR) MODE_IX1  (Byte 〈xE,x8〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 EOR) MODE_IX0  (Byte 〈xF,x8〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_HC05_17 ≝
-[
-  quadruple … (anyOP HC05 INC) MODE_DIR1 (Byte 〈x3,xC〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 INC) MODE_INHA (Byte 〈x4,xC〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 INC) MODE_INHX (Byte 〈x5,xC〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 INC) MODE_IX1  (Byte 〈x6,xC〉) 〈x0,x6〉
-; quadruple … (anyOP HC05 INC) MODE_IX0  (Byte 〈x7,xC〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HC05_18 ≝
-[
-  quadruple … (anyOP HC05 JMP) MODE_IMM1EXT  (Byte 〈xB,xC〉) 〈x0,x2〉
-; quadruple … (anyOP HC05 JMP) MODE_IMM2     (Byte 〈xC,xC〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 JMP) MODE_INHX2ADD (Byte 〈xD,xC〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 JMP) MODE_INHX1ADD (Byte 〈xE,xC〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 JMP) MODE_INHX0ADD (Byte 〈xF,xC〉) 〈x0,x2〉
-].
-
-ndefinition opcode_table_HC05_19 ≝
-[
-  quadruple … (anyOP HC05 BSR) MODE_IMM1     (Byte 〈xA,xD〉) 〈x0,x6〉
-; quadruple … (anyOP HC05 JSR) MODE_IMM1EXT  (Byte 〈xB,xD〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 JSR) MODE_IMM2     (Byte 〈xC,xD〉) 〈x0,x6〉
-; quadruple … (anyOP HC05 JSR) MODE_INHX2ADD (Byte 〈xD,xD〉) 〈x0,x7〉
-; quadruple … (anyOP HC05 JSR) MODE_INHX1ADD (Byte 〈xE,xD〉) 〈x0,x6〉
-; quadruple … (anyOP HC05 JSR) MODE_INHX0ADD (Byte 〈xF,xD〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HC05_20 ≝
-[
-  quadruple … (anyOP HC05 LDA) MODE_IMM1 (Byte 〈xA,x6〉) 〈x0,x2〉
-; quadruple … (anyOP HC05 LDA) MODE_DIR1 (Byte 〈xB,x6〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 LDA) MODE_DIR2 (Byte 〈xC,x6〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 LDA) MODE_IX2  (Byte 〈xD,x6〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 LDA) MODE_IX1  (Byte 〈xE,x6〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 LDA) MODE_IX0  (Byte 〈xF,x6〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_HC05_21 ≝
-[
-  quadruple … (anyOP HC05 LDX) MODE_IMM1 (Byte 〈xA,xE〉) 〈x0,x2〉
-; quadruple … (anyOP HC05 LDX) MODE_DIR1 (Byte 〈xB,xE〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 LDX) MODE_DIR2 (Byte 〈xC,xE〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 LDX) MODE_IX2  (Byte 〈xD,xE〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 LDX) MODE_IX1  (Byte 〈xE,xE〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 LDX) MODE_IX0  (Byte 〈xF,xE〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_HC05_22 ≝
-[
-  quadruple … (anyOP HC05 LSR) MODE_DIR1 (Byte 〈x3,x4〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 LSR) MODE_INHA (Byte 〈x4,x4〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 LSR) MODE_INHX (Byte 〈x5,x4〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 LSR) MODE_IX1  (Byte 〈x6,x4〉) 〈x0,x6〉
-; quadruple … (anyOP HC05 LSR) MODE_IX0  (Byte 〈x7,x4〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HC05_23 ≝
-[
-  quadruple … (anyOP HC05 NEG) MODE_DIR1 (Byte 〈x3,x0〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 NEG) MODE_INHA (Byte 〈x4,x0〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 NEG) MODE_INHX (Byte 〈x5,x0〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 NEG) MODE_IX1  (Byte 〈x6,x0〉) 〈x0,x6〉
-; quadruple … (anyOP HC05 NEG) MODE_IX0  (Byte 〈x7,x0〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HC05_24 ≝
-[
-  quadruple … (anyOP HC05 ORA) MODE_IMM1 (Byte 〈xA,xA〉) 〈x0,x2〉
-; quadruple … (anyOP HC05 ORA) MODE_DIR1 (Byte 〈xB,xA〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 ORA) MODE_DIR2 (Byte 〈xC,xA〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 ORA) MODE_IX2  (Byte 〈xD,xA〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 ORA) MODE_IX1  (Byte 〈xE,xA〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 ORA) MODE_IX0  (Byte 〈xF,xA〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_HC05_25 ≝
-[
-  quadruple … (anyOP HC05 ROL) MODE_DIR1 (Byte 〈x3,x9〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 ROL) MODE_INHA (Byte 〈x4,x9〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 ROL) MODE_INHX (Byte 〈x5,x9〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 ROL) MODE_IX1  (Byte 〈x6,x9〉) 〈x0,x6〉
-; quadruple … (anyOP HC05 ROL) MODE_IX0  (Byte 〈x7,x9〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HC05_26 ≝
-[
-  quadruple … (anyOP HC05 ROR) MODE_DIR1 (Byte 〈x3,x6〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 ROR) MODE_INHA (Byte 〈x4,x6〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 ROR) MODE_INHX (Byte 〈x5,x6〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 ROR) MODE_IX1  (Byte 〈x6,x6〉) 〈x0,x6〉
-; quadruple … (anyOP HC05 ROR) MODE_IX0  (Byte 〈x7,x6〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HC05_27 ≝
-[
-  quadruple … (anyOP HC05 SBC) MODE_IMM1 (Byte 〈xA,x2〉) 〈x0,x2〉
-; quadruple … (anyOP HC05 SBC) MODE_DIR1 (Byte 〈xB,x2〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 SBC) MODE_DIR2 (Byte 〈xC,x2〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 SBC) MODE_IX2  (Byte 〈xD,x2〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 SBC) MODE_IX1  (Byte 〈xE,x2〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 SBC) MODE_IX0  (Byte 〈xF,x2〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_HC05_28 ≝
-[
-  quadruple … (anyOP HC05 STA) MODE_DIR1 (Byte 〈xB,x7〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 STA) MODE_DIR2 (Byte 〈xC,x7〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 STA) MODE_IX2  (Byte 〈xD,x7〉) 〈x0,x6〉
-; quadruple … (anyOP HC05 STA) MODE_IX1  (Byte 〈xE,x7〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 STA) MODE_IX0  (Byte 〈xF,x7〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HC05_29 ≝
-[
-  quadruple … (anyOP HC05 STX) MODE_DIR1 (Byte 〈xB,xF〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 STX) MODE_DIR2 (Byte 〈xC,xF〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 STX) MODE_IX2  (Byte 〈xD,xF〉) 〈x0,x6〉
-; quadruple … (anyOP HC05 STX) MODE_IX1  (Byte 〈xE,xF〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 STX) MODE_IX0  (Byte 〈xF,xF〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HC05_30 ≝
-[
-  quadruple … (anyOP HC05 SUB) MODE_IMM1 (Byte 〈xA,x0〉) 〈x0,x2〉
-; quadruple … (anyOP HC05 SUB) MODE_DIR1 (Byte 〈xB,x0〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 SUB) MODE_DIR2 (Byte 〈xC,x0〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 SUB) MODE_IX2  (Byte 〈xD,x0〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 SUB) MODE_IX1  (Byte 〈xE,x0〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 SUB) MODE_IX0  (Byte 〈xF,x0〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_HC05_31 ≝
-[
-  quadruple … (anyOP HC05 TST) MODE_DIR1 (Byte 〈x3,xD〉) 〈x0,x4〉
-; quadruple … (anyOP HC05 TST) MODE_INHA (Byte 〈x4,xD〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 TST) MODE_INHX (Byte 〈x5,xD〉) 〈x0,x3〉
-; quadruple … (anyOP HC05 TST) MODE_IX1  (Byte 〈x6,xD〉) 〈x0,x5〉
-; quadruple … (anyOP HC05 TST) MODE_IX0  (Byte 〈x7,xD〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HC05 ≝
- opcode_table_HC05_1  @ opcode_table_HC05_2  @ opcode_table_HC05_3  @ opcode_table_HC05_4  @
- opcode_table_HC05_5  @ opcode_table_HC05_6  @ opcode_table_HC05_7  @ opcode_table_HC05_8  @
- opcode_table_HC05_9  @ opcode_table_HC05_10 @ opcode_table_HC05_11 @ opcode_table_HC05_12 @
- opcode_table_HC05_13 @ opcode_table_HC05_14 @ opcode_table_HC05_15 @ opcode_table_HC05_16 @
- opcode_table_HC05_17 @ opcode_table_HC05_18 @ opcode_table_HC05_19 @ opcode_table_HC05_20 @
- opcode_table_HC05_21 @ opcode_table_HC05_22 @ opcode_table_HC05_23 @ opcode_table_HC05_24 @
- opcode_table_HC05_25 @ opcode_table_HC05_26 @ opcode_table_HC05_27 @ opcode_table_HC05_28 @
- opcode_table_HC05_29 @ opcode_table_HC05_30 @ opcode_table_HC05_31.
diff --git a/helm/software/matita/contribs/ng_assembly/freescale/table_HC05_tests.ma b/helm/software/matita/contribs/ng_assembly/freescale/table_HC05_tests.ma
deleted file mode 100755 (executable)
index 75bb840..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-(**************************************************************************)
-(*       ___                                                              *)
-(*      ||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              *)
-(*   Ultima modifica: 05/08/2009                                          *)
-(*                                                                        *)
-(* ********************************************************************** *)
-
-include "freescale/table_HC05.ma".
-include "freescale/opcode.ma".
-
-(* ***************** *)
-(* TABELLA DELL'HC05 *)
-(* ***************** *)
-
-(* HC05: opcode non implementati come da manuale *)
-ndefinition HC05_not_impl_byte ≝
- [〈x3,x1〉;〈x3,x2〉;〈x3,x5〉;〈x3,xB〉;〈x3,xE〉
- ;〈x4,x1〉;〈x4,x5〉;〈x4,xB〉;〈x4,xE〉
- ;〈x5,x1〉;〈x5,x2〉;〈x5,x5〉;〈x5,xB〉;〈x5,xE〉
- ;〈x6,x1〉;〈x6,x2〉;〈x6,x5〉;〈x6,xB〉;〈x6,xE〉
- ;〈x7,x1〉;〈x7,x2〉;〈x7,x5〉;〈x7,xB〉;〈x7,xE〉
- ;〈x8,x2〉;〈x8,x4〉;〈x8,x5〉;〈x8,x6〉;〈x8,x7〉;〈x8,x8〉;〈x8,x9〉;〈x8,xA〉;〈x8,xB〉;〈x8,xC〉;〈x8,xD〉
- ;〈x9,x0〉;〈x9,x1〉;〈x9,x2〉;〈x9,x3〉;〈x9,x4〉;〈x9,x5〉;〈x9,x6〉;〈x9,xE〉
- ;〈xA,x7〉;〈xA,xC〉;〈xA,xF〉
- ].
-
-nlemma ok_byte_table_HC05 : forall_b8 (λb.
- (test_not_impl_byte b HC05_not_impl_byte     ⊙ eq_w16 (get_byte_count HC05 b 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_HC05) 〈〈x0,x0〉:〈x0,x1〉〉) ⊗
- (⊖ (test_not_impl_byte b HC05_not_impl_byte) ⊙ eq_w16 (get_byte_count HC05 b 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_HC05) 〈〈x0,x0〉:〈x0,x0〉〉))
- = true.
- napply refl_eq.
-nqed.
-
-(* HC05: pseudocodici non implementati come da manuale *)
-ndefinition HC05_not_impl_pseudo ≝
- [ AIS ; AIX ; BGE ; BGND ; BGT ; BLE ; BLT ; CBEQA ; CBEQX ; CPHX ; DAA
- ; DBNZ ; DIV ; LDHX ; MOV ; NSA ; PSHA ; PSHH ; PSHX ; PULA ; PULH ; PULX
- ; SHA ; SLA ; STHX ; TAP ; TPA ; TSX ; TXS ].
-
-nlemma ok_pseudo_table_HC05 : forall_op (λo.
- (test_not_impl_pseudo o HC05_not_impl_pseudo     ⊙ le_w16 〈〈x0,x0〉:〈x0,x1〉〉 (get_pseudo_count HC05 o 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_HC05)) ⊗
- (⊖ (test_not_impl_pseudo o HC05_not_impl_pseudo) ⊙ eq_w16 (get_pseudo_count HC05 o 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_HC05) 〈〈x0,x0〉:〈x0,x0〉〉))
- = true.
- napply refl_eq.
-nqed.
-
-(* HC05: modalita' non implementate come da manuale *)
-ndefinition HC05_not_impl_mode ≝
- [ MODE_INHH ; MODE_SP1 ; MODE_SP2 ; MODE_DIR1_to_DIR1
- ; MODE_IMM1_to_DIR1 ; MODE_IX0p_to_DIR1 ; MODE_DIR1_to_IX0p
- ; MODE_INHA_and_IMM1 ; MODE_INHX_and_IMM1 ; MODE_IMM1_and_IMM1
- ; MODE_DIR1_and_IMM1 ; MODE_IX0_and_IMM1 ; MODE_IX0p_and_IMM1
- ; MODE_IX1_and_IMM1 ; MODE_IX1p_and_IMM1 ; MODE_SP1_and_IMM1
- ; MODE_TNY x0 ; MODE_TNY x1 ; MODE_TNY x2 ; MODE_TNY x3
- ; MODE_TNY x4 ; MODE_TNY x5 ; MODE_TNY x6 ; MODE_TNY x7
- ; MODE_TNY x8 ; MODE_TNY x9 ; MODE_TNY xA ; MODE_TNY xB
- ; MODE_TNY xC ; MODE_TNY xD ; MODE_TNY xE ; MODE_TNY xF
- ; MODE_SRT t00 ; MODE_SRT t01 ; MODE_SRT t02 ; MODE_SRT t03
- ; MODE_SRT t04 ; MODE_SRT t05 ; MODE_SRT t06 ; MODE_SRT t07
- ; MODE_SRT t08 ; MODE_SRT t09 ; MODE_SRT t0A ; MODE_SRT t0B
- ; MODE_SRT t0C ; MODE_SRT t0D ; MODE_SRT t0E ; MODE_SRT t0F
- ; MODE_SRT t10 ; MODE_SRT t11 ; MODE_SRT t12 ; MODE_SRT t13
- ; MODE_SRT t14 ; MODE_SRT t15 ; MODE_SRT t16 ; MODE_SRT t17
- ; MODE_SRT t18 ; MODE_SRT t19 ; MODE_SRT t1A ; MODE_SRT t1B
- ; MODE_SRT t1C ; MODE_SRT t1D ; MODE_SRT t1E ; MODE_SRT t1F ].
-
-nlemma ok_mode_table_HC05 : forall_im (λi.
- (test_not_impl_mode i HC05_not_impl_mode     ⊙ le_w16 〈〈x0,x0〉:〈x0,x1〉〉 (get_mode_count HC05 i 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_HC05)) ⊗
- (⊖ (test_not_impl_mode i HC05_not_impl_mode) ⊙ eq_w16 (get_mode_count HC05 i 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_HC05) 〈〈x0,x0〉:〈x0,x0〉〉))
- = true.
- napply refl_eq.
-nqed.
-
-nlemma ok_OpIm_table_HC05 :
- forall_im (λi:instr_mode.
- forall_op (λop:opcode.
-  le_w16 (get_OpIm_count HC05 (anyOP HC05 op) i 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_HC05) 〈〈x0,x0〉:〈x0,x1〉〉)) = true.
- napply refl_eq.
-nqed.
diff --git a/helm/software/matita/contribs/ng_assembly/freescale/table_HC08.ma b/helm/software/matita/contribs/ng_assembly/freescale/table_HC08.ma
deleted file mode 100755 (executable)
index bf4f48c..0000000
+++ /dev/null
@@ -1,474 +0,0 @@
-(**************************************************************************)
-(*       ___                                                              *)
-(*      ||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              *)
-(*   Ultima modifica: 05/08/2009                                          *)
-(*                                                                        *)
-(* ********************************************************************** *)
-
-include "freescale/opcode_base.ma".
-include "common/list.ma".
-
-(* ***************** *)
-(* TABELLA DELL'HC08 *)
-(* ***************** *)
-
-(* definizione come concatenazione finale di liste per velocizzare il parsing *)
-(* ogni riga e' (any_opcode m) (instr_mode) (opcode esadecimale) (#cicli esecuzione) *)
-(* NB: l'uso di any_opcode m + concatenazione finale tutte liste
-       impedisce di introdurre opcode disomogenei (per mcu) *)
-
-ndefinition opcode_table_HC08_1 ≝
-[
-  quadruple … (anyOP HC08 ADC) MODE_IMM1 (Byte 〈xA,x9〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 ADC) MODE_DIR1 (Byte 〈xB,x9〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 ADC) MODE_DIR2 (Byte 〈xC,x9〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 ADC) MODE_IX2  (Byte 〈xD,x9〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 ADC) MODE_IX1  (Byte 〈xE,x9〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 ADC) MODE_IX0  (Byte 〈xF,x9〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 ADC) MODE_SP2  (Word 〈〈x9,xE〉:〈xD,x9〉〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 ADC) MODE_SP1  (Word 〈〈x9,xE〉:〈xE,x9〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HC08_2 ≝
-[
-  quadruple … (anyOP HC08 ADD) MODE_IMM1 (Byte 〈xA,xB〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 ADD) MODE_DIR1 (Byte 〈xB,xB〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 ADD) MODE_DIR2 (Byte 〈xC,xB〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 ADD) MODE_IX2  (Byte 〈xD,xB〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 ADD) MODE_IX1  (Byte 〈xE,xB〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 ADD) MODE_IX0  (Byte 〈xF,xB〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 ADD) MODE_SP2  (Word 〈〈x9,xE〉:〈xD,xB〉〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 ADD) MODE_SP1  (Word 〈〈x9,xE〉:〈xE,xB〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HC08_3 ≝
-[
-  quadruple … (anyOP HC08 AND) MODE_IMM1 (Byte 〈xA,x4〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 AND) MODE_DIR1 (Byte 〈xB,x4〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 AND) MODE_DIR2 (Byte 〈xC,x4〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 AND) MODE_IX2  (Byte 〈xD,x4〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 AND) MODE_IX1  (Byte 〈xE,x4〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 AND) MODE_IX0  (Byte 〈xF,x4〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 AND) MODE_SP2  (Word 〈〈x9,xE〉:〈xD,x4〉〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 AND) MODE_SP1  (Word 〈〈x9,xE〉:〈xE,x4〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HC08_4 ≝
-[
-  quadruple … (anyOP HC08 ASL) MODE_DIR1 (Byte 〈x3,x8〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 ASL) MODE_INHA (Byte 〈x4,x8〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 ASL) MODE_INHX (Byte 〈x5,x8〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 ASL) MODE_IX1  (Byte 〈x6,x8〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 ASL) MODE_IX0  (Byte 〈x7,x8〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 ASL) MODE_SP1  (Word 〈〈x9,xE〉:〈x6,x8〉〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HC08_5 ≝
-[
-  quadruple … (anyOP HC08 ASR) MODE_DIR1 (Byte 〈x3,x7〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 ASR) MODE_INHA (Byte 〈x4,x7〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 ASR) MODE_INHX (Byte 〈x5,x7〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 ASR) MODE_IX1  (Byte 〈x6,x7〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 ASR) MODE_IX0  (Byte 〈x7,x7〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 ASR) MODE_SP1  (Word 〈〈x9,xE〉:〈x6,x7〉〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HC08_6 ≝
-[
-  quadruple … (anyOP HC08 BRA ) MODE_IMM1 (Byte 〈x2,x0〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 BRN ) MODE_IMM1 (Byte 〈x2,x1〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 BHI ) MODE_IMM1 (Byte 〈x2,x2〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 BLS ) MODE_IMM1 (Byte 〈x2,x3〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 BCC ) MODE_IMM1 (Byte 〈x2,x4〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 BCS ) MODE_IMM1 (Byte 〈x2,x5〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 BNE ) MODE_IMM1 (Byte 〈x2,x6〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 BEQ ) MODE_IMM1 (Byte 〈x2,x7〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 BHCC) MODE_IMM1 (Byte 〈x2,x8〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 BHCS) MODE_IMM1 (Byte 〈x2,x9〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 BPL ) MODE_IMM1 (Byte 〈x2,xA〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 BMI ) MODE_IMM1 (Byte 〈x2,xB〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 BMC ) MODE_IMM1 (Byte 〈x2,xC〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 BMS ) MODE_IMM1 (Byte 〈x2,xD〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 BIL ) MODE_IMM1 (Byte 〈x2,xE〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 BIH ) MODE_IMM1 (Byte 〈x2,xF〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 BGE ) MODE_IMM1 (Byte 〈x9,x0〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 BLT ) MODE_IMM1 (Byte 〈x9,x1〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 BGT ) MODE_IMM1 (Byte 〈x9,x2〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 BLE ) MODE_IMM1 (Byte 〈x9,x3〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_HC08_7 ≝
-[
-  quadruple … (anyOP HC08 BSETn) (MODE_DIRn o0) (Byte 〈x1,x0〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 BCLRn) (MODE_DIRn o0) (Byte 〈x1,x1〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 BSETn) (MODE_DIRn o1) (Byte 〈x1,x2〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 BCLRn) (MODE_DIRn o1) (Byte 〈x1,x3〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 BSETn) (MODE_DIRn o2) (Byte 〈x1,x4〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 BCLRn) (MODE_DIRn o2) (Byte 〈x1,x5〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 BSETn) (MODE_DIRn o3) (Byte 〈x1,x6〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 BCLRn) (MODE_DIRn o3) (Byte 〈x1,x7〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 BSETn) (MODE_DIRn o4) (Byte 〈x1,x8〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 BCLRn) (MODE_DIRn o4) (Byte 〈x1,x9〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 BSETn) (MODE_DIRn o5) (Byte 〈x1,xA〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 BCLRn) (MODE_DIRn o5) (Byte 〈x1,xB〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 BSETn) (MODE_DIRn o6) (Byte 〈x1,xC〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 BCLRn) (MODE_DIRn o6) (Byte 〈x1,xD〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 BSETn) (MODE_DIRn o7) (Byte 〈x1,xE〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 BCLRn) (MODE_DIRn o7) (Byte 〈x1,xF〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HC08_8 ≝
-[
-  quadruple … (anyOP HC08 BRSETn) (MODE_DIRn_and_IMM1 o0) (Byte 〈x0,x0〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 BRCLRn) (MODE_DIRn_and_IMM1 o0) (Byte 〈x0,x1〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 BRSETn) (MODE_DIRn_and_IMM1 o1) (Byte 〈x0,x2〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 BRCLRn) (MODE_DIRn_and_IMM1 o1) (Byte 〈x0,x3〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 BRSETn) (MODE_DIRn_and_IMM1 o2) (Byte 〈x0,x4〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 BRCLRn) (MODE_DIRn_and_IMM1 o2) (Byte 〈x0,x5〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 BRSETn) (MODE_DIRn_and_IMM1 o3) (Byte 〈x0,x6〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 BRCLRn) (MODE_DIRn_and_IMM1 o3) (Byte 〈x0,x7〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 BRSETn) (MODE_DIRn_and_IMM1 o4) (Byte 〈x0,x8〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 BRCLRn) (MODE_DIRn_and_IMM1 o4) (Byte 〈x0,x9〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 BRSETn) (MODE_DIRn_and_IMM1 o5) (Byte 〈x0,xA〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 BRCLRn) (MODE_DIRn_and_IMM1 o5) (Byte 〈x0,xB〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 BRSETn) (MODE_DIRn_and_IMM1 o6) (Byte 〈x0,xC〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 BRCLRn) (MODE_DIRn_and_IMM1 o6) (Byte 〈x0,xD〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 BRSETn) (MODE_DIRn_and_IMM1 o7) (Byte 〈x0,xE〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 BRCLRn) (MODE_DIRn_and_IMM1 o7) (Byte 〈x0,xF〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HC08_9 ≝
-[
-  quadruple … (anyOP HC08 BIT) MODE_IMM1 (Byte 〈xA,x5〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 BIT) MODE_DIR1 (Byte 〈xB,x5〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 BIT) MODE_DIR2 (Byte 〈xC,x5〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 BIT) MODE_IX2  (Byte 〈xD,x5〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 BIT) MODE_IX1  (Byte 〈xE,x5〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 BIT) MODE_IX0  (Byte 〈xF,x5〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 BIT) MODE_SP2  (Word 〈〈x9,xE〉:〈xD,x5〉〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 BIT) MODE_SP1  (Word 〈〈x9,xE〉:〈xE,x5〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HC08_10 ≝
-[
-  quadruple … (anyOP HC08 MUL ) MODE_INH  (Byte 〈x4,x2〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 DIV ) MODE_INH  (Byte 〈x5,x2〉) 〈x0,x7〉
-; quadruple … (anyOP HC08 NSA ) MODE_INH  (Byte 〈x6,x2〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 DAA ) MODE_INH  (Byte 〈x7,x2〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 RTI ) MODE_INH  (Byte 〈x8,x0〉) 〈x0,x7〉
-; quadruple … (anyOP HC08 RTS ) MODE_INH  (Byte 〈x8,x1〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 SWI ) MODE_INH  (Byte 〈x8,x3〉) 〈x0,x9〉
-; quadruple … (anyOP HC08 TAP ) MODE_INH  (Byte 〈x8,x4〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 TPA ) MODE_INH  (Byte 〈x8,x5〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 PULA) MODE_INH  (Byte 〈x8,x6〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 PSHA) MODE_INH  (Byte 〈x8,x7〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 PULX) MODE_INH  (Byte 〈x8,x8〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 PSHX) MODE_INH  (Byte 〈x8,x9〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 PULH) MODE_INH  (Byte 〈x8,xA〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 PSHH) MODE_INH  (Byte 〈x8,xB〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 STOP) MODE_INH  (Byte 〈x8,xE〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 WAIT) MODE_INH  (Byte 〈x8,xF〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 TXS ) MODE_INH  (Byte 〈x9,x4〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 TSX ) MODE_INH  (Byte 〈x9,x5〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 TAX ) MODE_INH  (Byte 〈x9,x7〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 CLC ) MODE_INH  (Byte 〈x9,x8〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 SEC ) MODE_INH  (Byte 〈x9,x9〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 CLI ) MODE_INH  (Byte 〈x9,xA〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 SEI ) MODE_INH  (Byte 〈x9,xB〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 RSP ) MODE_INH  (Byte 〈x9,xC〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 NOP ) MODE_INH  (Byte 〈x9,xD〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 TXA ) MODE_INH  (Byte 〈x9,xF〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 AIS ) MODE_IMM1 (Byte 〈xA,x7〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 AIX ) MODE_IMM1 (Byte 〈xA,xF〉) 〈x0,x2〉
-].
-
-ndefinition opcode_table_HC08_11 ≝
-[
-  quadruple … (anyOP HC08 CBEQA) MODE_DIR1_and_IMM1 (Byte 〈x3,x1〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 CBEQA) MODE_IMM1_and_IMM1 (Byte 〈x4,x1〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 CBEQX) MODE_IMM1_and_IMM1 (Byte 〈x5,x1〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 CBEQA) MODE_IX1p_and_IMM1 (Byte 〈x6,x1〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 CBEQA) MODE_IX0p_and_IMM1 (Byte 〈x7,x1〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 CBEQA) MODE_SP1_and_IMM1  (Word 〈〈x9,xE〉:〈x6,x1〉〉) 〈x0,x6〉
-].
-
-ndefinition opcode_table_HC08_12 ≝
-[
-  quadruple … (anyOP HC08 CLR) MODE_DIR1 (Byte 〈x3,xF〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 CLR) MODE_INHA (Byte 〈x4,xF〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 CLR) MODE_INHX (Byte 〈x5,xF〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 CLR) MODE_IX1  (Byte 〈x6,xF〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 CLR) MODE_IX0  (Byte 〈x7,xF〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 CLR) MODE_INHH (Byte 〈x8,xC〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 CLR) MODE_SP1  (Word 〈〈x9,xE〉:〈x6,xF〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HC08_13 ≝
-[
-  quadruple … (anyOP HC08 CMP) MODE_IMM1 (Byte 〈xA,x1〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 CMP) MODE_DIR1 (Byte 〈xB,x1〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 CMP) MODE_DIR2 (Byte 〈xC,x1〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 CMP) MODE_IX2  (Byte 〈xD,x1〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 CMP) MODE_IX1  (Byte 〈xE,x1〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 CMP) MODE_IX0  (Byte 〈xF,x1〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 CMP) MODE_SP2  (Word 〈〈x9,xE〉:〈xD,x1〉〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 CMP) MODE_SP1  (Word 〈〈x9,xE〉:〈xE,x1〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HC08_14 ≝
-[
-  quadruple … (anyOP HC08 COM) MODE_DIR1 (Byte 〈x3,x3〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 COM) MODE_INHA (Byte 〈x4,x3〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 COM) MODE_INHX (Byte 〈x5,x3〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 COM) MODE_IX1  (Byte 〈x6,x3〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 COM) MODE_IX0  (Byte 〈x7,x3〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 COM) MODE_SP1  (Word 〈〈x9,xE〉:〈x6,x3〉〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HC08_15 ≝
-[
-  quadruple … (anyOP HC08 STHX) MODE_DIR1 (Byte 〈x3,x5〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 LDHX) MODE_IMM2 (Byte 〈x4,x5〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 LDHX) MODE_DIR1 (Byte 〈x5,x5〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 CPHX) MODE_IMM2 (Byte 〈x6,x5〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 CPHX) MODE_DIR1 (Byte 〈x7,x5〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HC08_16 ≝
-[
-  quadruple … (anyOP HC08 CPX) MODE_IMM1 (Byte 〈xA,x3〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 CPX) MODE_DIR1 (Byte 〈xB,x3〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 CPX) MODE_DIR2 (Byte 〈xC,x3〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 CPX) MODE_IX2  (Byte 〈xD,x3〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 CPX) MODE_IX1  (Byte 〈xE,x3〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 CPX) MODE_IX0  (Byte 〈xF,x3〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 CPX) MODE_SP2  (Word 〈〈x9,xE〉:〈xD,x3〉〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 CPX) MODE_SP1  (Word 〈〈x9,xE〉:〈xE,x3〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HC08_17 ≝
-[
-  quadruple … (anyOP HC08 DBNZ) MODE_DIR1_and_IMM1 (Byte 〈x3,xB〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 DBNZ) MODE_INHA_and_IMM1 (Byte 〈x4,xB〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 DBNZ) MODE_INHX_and_IMM1 (Byte 〈x5,xB〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 DBNZ) MODE_IX1_and_IMM1  (Byte 〈x6,xB〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 DBNZ) MODE_IX0_and_IMM1  (Byte 〈x7,xB〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 DBNZ) MODE_SP1_and_IMM1  (Word 〈〈x9,xE〉:〈x6,xB〉〉) 〈x0,x6〉
-].
-
-ndefinition opcode_table_HC08_18 ≝
-[
-  quadruple … (anyOP HC08 DEC) MODE_DIR1 (Byte 〈x3,xA〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 DEC) MODE_INHA (Byte 〈x4,xA〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 DEC) MODE_INHX (Byte 〈x5,xA〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 DEC) MODE_IX1  (Byte 〈x6,xA〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 DEC) MODE_IX0  (Byte 〈x7,xA〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 DEC) MODE_SP1  (Word 〈〈x9,xE〉:〈x6,xA〉〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HC08_19 ≝
-[
-  quadruple … (anyOP HC08 EOR) MODE_IMM1 (Byte 〈xA,x8〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 EOR) MODE_DIR1 (Byte 〈xB,x8〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 EOR) MODE_DIR2 (Byte 〈xC,x8〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 EOR) MODE_IX2  (Byte 〈xD,x8〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 EOR) MODE_IX1  (Byte 〈xE,x8〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 EOR) MODE_IX0  (Byte 〈xF,x8〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 EOR) MODE_SP2  (Word 〈〈x9,xE〉:〈xD,x8〉〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 EOR) MODE_SP1  (Word 〈〈x9,xE〉:〈xE,x8〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HC08_20 ≝
-[
-  quadruple … (anyOP HC08 INC) MODE_DIR1 (Byte 〈x3,xC〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 INC) MODE_INHA (Byte 〈x4,xC〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 INC) MODE_INHX (Byte 〈x5,xC〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 INC) MODE_IX1  (Byte 〈x6,xC〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 INC) MODE_IX0  (Byte 〈x7,xC〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 INC) MODE_SP1  (Word 〈〈x9,xE〉:〈x6,xC〉〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HC08_21 ≝
-[
-  quadruple … (anyOP HC08 JMP) MODE_IMM1EXT  (Byte 〈xB,xC〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 JMP) MODE_IMM2     (Byte 〈xC,xC〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 JMP) MODE_INHX2ADD (Byte 〈xD,xC〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 JMP) MODE_INHX1ADD (Byte 〈xE,xC〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 JMP) MODE_INHX0ADD (Byte 〈xF,xC〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_HC08_22 ≝
-[
-  quadruple … (anyOP HC08 BSR) MODE_IMM1     (Byte 〈xA,xD〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 JSR) MODE_IMM1EXT  (Byte 〈xB,xD〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 JSR) MODE_IMM2     (Byte 〈xC,xD〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 JSR) MODE_INHX2ADD (Byte 〈xD,xD〉) 〈x0,x6〉
-; quadruple … (anyOP HC08 JSR) MODE_INHX1ADD (Byte 〈xE,xD〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 JSR) MODE_INHX0ADD (Byte 〈xF,xD〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HC08_23 ≝
-[
-  quadruple … (anyOP HC08 LDA) MODE_IMM1 (Byte 〈xA,x6〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 LDA) MODE_DIR1 (Byte 〈xB,x6〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 LDA) MODE_DIR2 (Byte 〈xC,x6〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 LDA) MODE_IX2  (Byte 〈xD,x6〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 LDA) MODE_IX1  (Byte 〈xE,x6〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 LDA) MODE_IX0  (Byte 〈xF,x6〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 LDA) MODE_SP2  (Word 〈〈x9,xE〉:〈xD,x6〉〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 LDA) MODE_SP1  (Word 〈〈x9,xE〉:〈xE,x6〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HC08_24 ≝
-[
-  quadruple … (anyOP HC08 LDX) MODE_IMM1 (Byte 〈xA,xE〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 LDX) MODE_DIR1 (Byte 〈xB,xE〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 LDX) MODE_DIR2 (Byte 〈xC,xE〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 LDX) MODE_IX2  (Byte 〈xD,xE〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 LDX) MODE_IX1  (Byte 〈xE,xE〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 LDX) MODE_IX0  (Byte 〈xF,xE〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 LDX) MODE_SP2  (Word 〈〈x9,xE〉:〈xD,xE〉〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 LDX) MODE_SP1  (Word 〈〈x9,xE〉:〈xE,xE〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HC08_25 ≝
-[
-  quadruple … (anyOP HC08 LSR) MODE_DIR1 (Byte 〈x3,x4〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 LSR) MODE_INHA (Byte 〈x4,x4〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 LSR) MODE_INHX (Byte 〈x5,x4〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 LSR) MODE_IX1  (Byte 〈x6,x4〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 LSR) MODE_IX0  (Byte 〈x7,x4〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 LSR) MODE_SP1  (Word 〈〈x9,xE〉:〈x6,x4〉〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HC08_26 ≝
-[
-  quadruple … (anyOP HC08 MOV) MODE_DIR1_to_DIR1 (Byte 〈x4,xE〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 MOV) MODE_DIR1_to_IX0p (Byte 〈x5,xE〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 MOV) MODE_IMM1_to_DIR1 (Byte 〈x6,xE〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 MOV) MODE_IX0p_to_DIR1 (Byte 〈x7,xE〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HC08_27 ≝
-[
-  quadruple … (anyOP HC08 NEG) MODE_DIR1 (Byte 〈x3,x0〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 NEG) MODE_INHA (Byte 〈x4,x0〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 NEG) MODE_INHX (Byte 〈x5,x0〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 NEG) MODE_IX1  (Byte 〈x6,x0〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 NEG) MODE_IX0  (Byte 〈x7,x0〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 NEG) MODE_SP1  (Word 〈〈x9,xE〉:〈x6,x0〉〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HC08_28 ≝
-[
-  quadruple … (anyOP HC08 ORA) MODE_IMM1 (Byte 〈xA,xA〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 ORA) MODE_DIR1 (Byte 〈xB,xA〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 ORA) MODE_DIR2 (Byte 〈xC,xA〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 ORA) MODE_IX2  (Byte 〈xD,xA〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 ORA) MODE_IX1  (Byte 〈xE,xA〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 ORA) MODE_IX0  (Byte 〈xF,xA〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 ORA) MODE_SP2  (Word 〈〈x9,xE〉:〈xD,xA〉〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 ORA) MODE_SP1  (Word 〈〈x9,xE〉:〈xE,xA〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HC08_29 ≝
-[
-  quadruple … (anyOP HC08 ROL) MODE_DIR1 (Byte 〈x3,x9〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 ROL) MODE_INHA (Byte 〈x4,x9〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 ROL) MODE_INHX (Byte 〈x5,x9〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 ROL) MODE_IX1  (Byte 〈x6,x9〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 ROL) MODE_IX0  (Byte 〈x7,x9〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 ROL) MODE_SP1  (Word 〈〈x9,xE〉:〈x6,x9〉〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HC08_30 ≝
-[
-  quadruple … (anyOP HC08 ROR) MODE_DIR1 (Byte 〈x3,x6〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 ROR) MODE_INHA (Byte 〈x4,x6〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 ROR) MODE_INHX (Byte 〈x5,x6〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 ROR) MODE_IX1  (Byte 〈x6,x6〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 ROR) MODE_IX0  (Byte 〈x7,x6〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 ROR) MODE_SP1  (Word 〈〈x9,xE〉:〈x6,x6〉〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HC08_31 ≝
-[
-  quadruple … (anyOP HC08 SBC) MODE_IMM1 (Byte 〈xA,x2〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 SBC) MODE_DIR1 (Byte 〈xB,x2〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 SBC) MODE_DIR2 (Byte 〈xC,x2〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 SBC) MODE_IX2  (Byte 〈xD,x2〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 SBC) MODE_IX1  (Byte 〈xE,x2〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 SBC) MODE_IX0  (Byte 〈xF,x2〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 SBC) MODE_SP2  (Word 〈〈x9,xE〉:〈xD,x2〉〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 SBC) MODE_SP1  (Word 〈〈x9,xE〉:〈xE,x2〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HC08_32 ≝
-[
-  quadruple … (anyOP HC08 STA) MODE_DIR1 (Byte 〈xB,x7〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 STA) MODE_DIR2 (Byte 〈xC,x7〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 STA) MODE_IX2  (Byte 〈xD,x7〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 STA) MODE_IX1  (Byte 〈xE,x7〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 STA) MODE_IX0  (Byte 〈xF,x7〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 STA) MODE_SP2  (Word 〈〈x9,xE〉:〈xD,x7〉〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 STA) MODE_SP1  (Word 〈〈x9,xE〉:〈xE,x7〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HC08_33 ≝
-[
-  quadruple … (anyOP HC08 STX) MODE_DIR1 (Byte 〈xB,xF〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 STX) MODE_DIR2 (Byte 〈xC,xF〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 STX) MODE_IX2  (Byte 〈xD,xF〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 STX) MODE_IX1  (Byte 〈xE,xF〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 STX) MODE_IX0  (Byte 〈xF,xF〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 STX) MODE_SP2  (Word 〈〈x9,xE〉:〈xD,xF〉〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 STX) MODE_SP1  (Word 〈〈x9,xE〉:〈xE,xF〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HC08_34 ≝
-[
-  quadruple … (anyOP HC08 SUB) MODE_IMM1 (Byte 〈xA,x0〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 SUB) MODE_DIR1 (Byte 〈xB,x0〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 SUB) MODE_DIR2 (Byte 〈xC,x0〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 SUB) MODE_IX2  (Byte 〈xD,x0〉) 〈x0,x4〉
-; quadruple … (anyOP HC08 SUB) MODE_IX1  (Byte 〈xE,x0〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 SUB) MODE_IX0  (Byte 〈xF,x0〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 SUB) MODE_SP2  (Word 〈〈x9,xE〉:〈xD,x0〉〉) 〈x0,x5〉
-; quadruple … (anyOP HC08 SUB) MODE_SP1  (Word 〈〈x9,xE〉:〈xE,x0〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HC08_35 ≝
-[
-  quadruple … (anyOP HC08 TST) MODE_DIR1 (Byte 〈x3,xD〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 TST) MODE_INHA (Byte 〈x4,xD〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 TST) MODE_INHX (Byte 〈x5,xD〉) 〈x0,x1〉
-; quadruple … (anyOP HC08 TST) MODE_IX1  (Byte 〈x6,xD〉) 〈x0,x3〉
-; quadruple … (anyOP HC08 TST) MODE_IX0  (Byte 〈x7,xD〉) 〈x0,x2〉
-; quadruple … (anyOP HC08 TST) MODE_SP1  (Word 〈〈x9,xE〉:〈x6,xD〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HC08 ≝
-opcode_table_HC08_1  @ opcode_table_HC08_2  @ opcode_table_HC08_3  @ opcode_table_HC08_4  @
-opcode_table_HC08_5  @ opcode_table_HC08_6  @ opcode_table_HC08_7  @ opcode_table_HC08_8  @
-opcode_table_HC08_9  @ opcode_table_HC08_10 @ opcode_table_HC08_11 @ opcode_table_HC08_12 @
-opcode_table_HC08_13 @ opcode_table_HC08_14 @ opcode_table_HC08_15 @ opcode_table_HC08_16 @
-opcode_table_HC08_17 @ opcode_table_HC08_18 @ opcode_table_HC08_19 @ opcode_table_HC08_20 @
-opcode_table_HC08_21 @ opcode_table_HC08_22 @ opcode_table_HC08_23 @ opcode_table_HC08_24 @
-opcode_table_HC08_25 @ opcode_table_HC08_26 @ opcode_table_HC08_27 @ opcode_table_HC08_28 @
-opcode_table_HC08_29 @ opcode_table_HC08_30 @ opcode_table_HC08_31 @ opcode_table_HC08_32 @
-opcode_table_HC08_33 @ opcode_table_HC08_34 @ opcode_table_HC08_35.
diff --git a/helm/software/matita/contribs/ng_assembly/freescale/table_HC08_tests.ma b/helm/software/matita/contribs/ng_assembly/freescale/table_HC08_tests.ma
deleted file mode 100755 (executable)
index 8c85e3c..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-(**************************************************************************)
-(*       ___                                                              *)
-(*      ||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              *)
-(*   Ultima modifica: 05/08/2009                                          *)
-(*                                                                        *)
-(* ********************************************************************** *)
-
-include "freescale/table_HC08.ma".
-include "freescale/opcode.ma".
-
-(* ***************** *)
-(* TABELLA DELL'HC08 *)
-(* ***************** *)
-
-(* HC08: opcode non implementati come da manuale (byte) *)
-ndefinition HC08_not_impl_byte ≝
- [〈x3,x2〉;〈x3,xE〉
- ;〈x8,x2〉;〈x8,xD〉
- ;〈x9,x6〉;〈x9,xE〉
- ;〈xA,xC〉
- ].
-
-nlemma ok_byte_table_HC08 : forall_b8 (λb.
- (test_not_impl_byte b HC08_not_impl_byte     ⊙ eq_w16 (get_byte_count HC08 b 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_HC08) 〈〈x0,x0〉:〈x0,x1〉〉) ⊗
- (⊖ (test_not_impl_byte b HC08_not_impl_byte) ⊙ eq_w16 (get_byte_count HC08 b 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_HC08) 〈〈x0,x0〉:〈x0,x0〉〉))
- = true.
- napply refl_eq.
-nqed.
-
-(* HC08: opcode non implementati come da manuale (0x9E+byte) *)
-ndefinition HC08_not_impl_word ≝
- [〈x0,x0〉;〈x0,x1〉;〈x0,x2〉;〈x0,x3〉;〈x0,x4〉;〈x0,x5〉;〈x0,x6〉;〈x0,x7〉
- ;〈x0,x8〉;〈x0,x9〉;〈x0,xA〉;〈x0,xB〉;〈x0,xC〉;〈x0,xD〉;〈x0,xE〉;〈x0,xF〉
- ;〈x1,x0〉;〈x1,x1〉;〈x1,x2〉;〈x1,x3〉;〈x1,x4〉;〈x1,x5〉;〈x1,x6〉;〈x1,x7〉
- ;〈x1,x8〉;〈x1,x9〉;〈x1,xA〉;〈x1,xB〉;〈x1,xC〉;〈x1,xD〉;〈x1,xE〉;〈x1,xF〉
- ;〈x2,x0〉;〈x2,x1〉;〈x2,x2〉;〈x2,x3〉;〈x2,x4〉;〈x2,x5〉;〈x2,x6〉;〈x2,x7〉
- ;〈x2,x8〉;〈x2,x9〉;〈x2,xA〉;〈x2,xB〉;〈x2,xC〉;〈x2,xD〉;〈x2,xE〉;〈x2,xF〉
- ;〈x3,x0〉;〈x3,x1〉;〈x3,x2〉;〈x3,x3〉;〈x3,x4〉;〈x3,x5〉;〈x3,x6〉;〈x3,x7〉
- ;〈x3,x8〉;〈x3,x9〉;〈x3,xA〉;〈x3,xB〉;〈x3,xC〉;〈x3,xD〉;〈x3,xE〉;〈x3,xF〉
- ;〈x4,x0〉;〈x4,x1〉;〈x4,x2〉;〈x4,x3〉;〈x4,x4〉;〈x4,x5〉;〈x4,x6〉;〈x4,x7〉
- ;〈x4,x8〉;〈x4,x9〉;〈x4,xA〉;〈x4,xB〉;〈x4,xC〉;〈x4,xD〉;〈x4,xE〉;〈x4,xF〉
- ;〈x5,x0〉;〈x5,x1〉;〈x5,x2〉;〈x5,x3〉;〈x5,x4〉;〈x5,x5〉;〈x5,x6〉;〈x5,x7〉
- ;〈x5,x8〉;〈x5,x9〉;〈x5,xA〉;〈x5,xB〉;〈x5,xC〉;〈x5,xD〉;〈x5,xE〉;〈x5,xF〉
- ;〈x6,x2〉;〈x6,x5〉;〈x6,xE〉
- ;〈x7,x0〉;〈x7,x1〉;〈x7,x2〉;〈x7,x3〉;〈x7,x4〉;〈x7,x5〉;〈x7,x6〉;〈x7,x7〉
- ;〈x7,x8〉;〈x7,x9〉;〈x7,xA〉;〈x7,xB〉;〈x7,xC〉;〈x7,xD〉;〈x7,xE〉;〈x7,xF〉
- ;〈x8,x0〉;〈x8,x1〉;〈x8,x2〉;〈x8,x3〉;〈x8,x4〉;〈x8,x5〉;〈x8,x6〉;〈x8,x7〉
- ;〈x8,x8〉;〈x8,x9〉;〈x8,xA〉;〈x8,xB〉;〈x8,xC〉;〈x8,xD〉;〈x8,xE〉;〈x8,xF〉
- ;〈x9,x0〉;〈x9,x1〉;〈x9,x2〉;〈x9,x3〉;〈x9,x4〉;〈x9,x5〉;〈x9,x6〉;〈x9,x7〉
- ;〈x9,x8〉;〈x9,x9〉;〈x9,xA〉;〈x9,xB〉;〈x9,xC〉;〈x9,xD〉;〈x9,xE〉;〈x9,xF〉
- ;〈xA,x0〉;〈xA,x1〉;〈xA,x2〉;〈xA,x3〉;〈xA,x4〉;〈xA,x5〉;〈xA,x6〉;〈xA,x7〉
- ;〈xA,x8〉;〈xA,x9〉;〈xA,xA〉;〈xA,xB〉;〈xA,xC〉;〈xA,xD〉;〈xA,xE〉;〈xA,xF〉
- ;〈xB,x0〉;〈xB,x1〉;〈xB,x2〉;〈xB,x3〉;〈xB,x4〉;〈xB,x5〉;〈xB,x6〉;〈xB,x7〉
- ;〈xB,x8〉;〈xB,x9〉;〈xB,xA〉;〈xB,xB〉;〈xB,xC〉;〈xB,xD〉;〈xB,xE〉;〈xB,xF〉
- ;〈xC,x0〉;〈xC,x1〉;〈xC,x2〉;〈xC,x3〉;〈xC,x4〉;〈xC,x5〉;〈xC,x6〉;〈xC,x7〉
- ;〈xC,x8〉;〈xC,x9〉;〈xC,xA〉;〈xC,xB〉;〈xC,xC〉;〈xC,xD〉;〈xC,xE〉;〈xC,xF〉
- ;〈xD,xC〉;〈xD,xD〉
- ;〈xE,xC〉;〈xE,xD〉
- ;〈xF,x0〉;〈xF,x1〉;〈xF,x2〉;〈xF,x3〉;〈xF,x4〉;〈xF,x5〉;〈xF,x6〉;〈xF,x7〉
- ;〈xF,x8〉;〈xF,x9〉;〈xF,xA〉;〈xF,xB〉;〈xF,xC〉;〈xF,xD〉;〈xF,xE〉;〈xF,xF〉
- ].
-
-nlemma ok_word_table_HC08 : forall_b8 (λb.
- (test_not_impl_byte b HC08_not_impl_word     ⊙ eq_w16 (get_word_count HC08 b 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_HC08) 〈〈x0,x0〉:〈x0,x1〉〉) ⊗
- (⊖ (test_not_impl_byte b HC08_not_impl_word) ⊙ eq_w16 (get_word_count HC08 b 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_HC08) 〈〈x0,x0〉:〈x0,x0〉〉))
- = true.
- napply refl_eq.
-nqed.
-
-(* HC08: pseudocodici non implementati come da manuale *)
-ndefinition HC08_not_impl_pseudo ≝
- [ BGND ; SHA ; SLA ].
-
-nlemma ok_pseudo_table_HC08 : forall_op (λo.
- (test_not_impl_pseudo o HC08_not_impl_pseudo     ⊙ le_w16 〈〈x0,x0〉:〈x0,x1〉〉 (get_pseudo_count HC08 o 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_HC08)) ⊗
- (⊖ (test_not_impl_pseudo o HC08_not_impl_pseudo) ⊙ eq_w16 (get_pseudo_count HC08 o 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_HC08) 〈〈x0,x0〉:〈x0,x0〉〉))
- = true.
- napply refl_eq.
-nqed.
-
-(* HC08: modalita' non implementate come da manuale *)
-ndefinition HC08_not_impl_mode ≝
- [ MODE_TNY x0 ; MODE_TNY x1 ; MODE_TNY x2 ; MODE_TNY x3
- ; MODE_TNY x4 ; MODE_TNY x5 ; MODE_TNY x6 ; MODE_TNY x7
- ; MODE_TNY x8 ; MODE_TNY x9 ; MODE_TNY xA ; MODE_TNY xB
- ; MODE_TNY xC ; MODE_TNY xD ; MODE_TNY xE ; MODE_TNY xF
- ; MODE_SRT t00 ; MODE_SRT t01 ; MODE_SRT t02 ; MODE_SRT t03
- ; MODE_SRT t04 ; MODE_SRT t05 ; MODE_SRT t06 ; MODE_SRT t07
- ; MODE_SRT t08 ; MODE_SRT t09 ; MODE_SRT t0A ; MODE_SRT t0B
- ; MODE_SRT t0C ; MODE_SRT t0D ; MODE_SRT t0E ; MODE_SRT t0F
- ; MODE_SRT t10 ; MODE_SRT t11 ; MODE_SRT t12 ; MODE_SRT t13
- ; MODE_SRT t14 ; MODE_SRT t15 ; MODE_SRT t16 ; MODE_SRT t17
- ; MODE_SRT t18 ; MODE_SRT t19 ; MODE_SRT t1A ; MODE_SRT t1B
- ; MODE_SRT t1C ; MODE_SRT t1D ; MODE_SRT t1E ; MODE_SRT t1F ].
-
-nlemma ok_mode_table_HC08 : forall_im (λi.
- (test_not_impl_mode i HC08_not_impl_mode     ⊙ le_w16 〈〈x0,x0〉:〈x0,x1〉〉 (get_mode_count HC08 i 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_HC08)) ⊗
- (⊖ (test_not_impl_mode i HC08_not_impl_mode) ⊙ eq_w16 (get_mode_count HC08 i 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_HC08) 〈〈x0,x0〉:〈x0,x0〉〉))
- = true.
- napply refl_eq.
-nqed.
-
-nlemma ok_OpIm_table_HC08 :
- forall_im (λi:instr_mode.
- forall_op (λop:opcode.
-  le_w16 (get_OpIm_count HC08 (anyOP HC08 op) i 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_HC08) 〈〈x0,x0〉:〈x0,x1〉〉)) = true.
- napply refl_eq.
-nqed.
diff --git a/helm/software/matita/contribs/ng_assembly/freescale/table_HCS08.ma b/helm/software/matita/contribs/ng_assembly/freescale/table_HCS08.ma
deleted file mode 100755 (executable)
index 165ee11..0000000
+++ /dev/null
@@ -1,486 +0,0 @@
-(**************************************************************************)
-(*       ___                                                              *)
-(*      ||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              *)
-(*   Ultima modifica: 05/08/2009                                          *)
-(*                                                                        *)
-(* ********************************************************************** *)
-
-include "freescale/opcode_base.ma".
-include "common/list.ma".
-
-(* ****************** *)
-(* TABELLA DELL'HCS08 *)
-(* ****************** *)
-
-(* definizione come concatenazione finale di liste per velocizzare il parsing *)
-(* ogni riga e' (any_opcode m) (instr_mode) (opcode esadecimale) (#cicli esecuzione) *)
-(* NB: l'uso di any_opcode m + concatenazione finale tutte liste
-       impedisce di introdurre opcode disomogenei (per mcu) *)
-
-ndefinition opcode_table_HCS08_1 ≝
-[
-  quadruple … (anyOP HCS08 ADC) MODE_IMM1 (Byte 〈xA,x9〉) 〈x0,x2〉
-; quadruple … (anyOP HCS08 ADC) MODE_DIR1 (Byte 〈xB,x9〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 ADC) MODE_DIR2 (Byte 〈xC,x9〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 ADC) MODE_IX2  (Byte 〈xD,x9〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 ADC) MODE_IX1  (Byte 〈xE,x9〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 ADC) MODE_IX0  (Byte 〈xF,x9〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 ADC) MODE_SP2  (Word 〈〈x9,xE〉:〈xD,x9〉〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 ADC) MODE_SP1  (Word 〈〈x9,xE〉:〈xE,x9〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HCS08_2 ≝
-[
-  quadruple … (anyOP HCS08 ADD) MODE_IMM1 (Byte 〈xA,xB〉) 〈x0,x2〉
-; quadruple … (anyOP HCS08 ADD) MODE_DIR1 (Byte 〈xB,xB〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 ADD) MODE_DIR2 (Byte 〈xC,xB〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 ADD) MODE_IX2  (Byte 〈xD,xB〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 ADD) MODE_IX1  (Byte 〈xE,xB〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 ADD) MODE_IX0  (Byte 〈xF,xB〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 ADD) MODE_SP2  (Word 〈〈x9,xE〉:〈xD,xB〉〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 ADD) MODE_SP1  (Word 〈〈x9,xE〉:〈xE,xB〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HCS08_3 ≝
-[
-  quadruple … (anyOP HCS08 AND) MODE_IMM1 (Byte 〈xA,x4〉) 〈x0,x2〉
-; quadruple … (anyOP HCS08 AND) MODE_DIR1 (Byte 〈xB,x4〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 AND) MODE_DIR2 (Byte 〈xC,x4〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 AND) MODE_IX2  (Byte 〈xD,x4〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 AND) MODE_IX1  (Byte 〈xE,x4〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 AND) MODE_IX0  (Byte 〈xF,x4〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 AND) MODE_SP2  (Word 〈〈x9,xE〉:〈xD,x4〉〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 AND) MODE_SP1  (Word 〈〈x9,xE〉:〈xE,x4〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HCS08_4 ≝
-[
-  quadruple … (anyOP HCS08 ASL) MODE_DIR1 (Byte 〈x3,x8〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 ASL) MODE_INHA (Byte 〈x4,x8〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 ASL) MODE_INHX (Byte 〈x5,x8〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 ASL) MODE_IX1  (Byte 〈x6,x8〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 ASL) MODE_IX0  (Byte 〈x7,x8〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 ASL) MODE_SP1  (Word 〈〈x9,xE〉:〈x6,x8〉〉) 〈x0,x6〉
-].
-
-ndefinition opcode_table_HCS08_5 ≝
-[
-  quadruple … (anyOP HCS08 ASR) MODE_DIR1 (Byte 〈x3,x7〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 ASR) MODE_INHA (Byte 〈x4,x7〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 ASR) MODE_INHX (Byte 〈x5,x7〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 ASR) MODE_IX1  (Byte 〈x6,x7〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 ASR) MODE_IX0  (Byte 〈x7,x7〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 ASR) MODE_SP1  (Word 〈〈x9,xE〉:〈x6,x7〉〉) 〈x0,x6〉
-].
-
-ndefinition opcode_table_HCS08_6 ≝
-[
-  quadruple … (anyOP HCS08 BRA ) MODE_IMM1 (Byte 〈x2,x0〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 BRN ) MODE_IMM1 (Byte 〈x2,x1〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 BHI ) MODE_IMM1 (Byte 〈x2,x2〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 BLS ) MODE_IMM1 (Byte 〈x2,x3〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 BCC ) MODE_IMM1 (Byte 〈x2,x4〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 BCS ) MODE_IMM1 (Byte 〈x2,x5〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 BNE ) MODE_IMM1 (Byte 〈x2,x6〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 BEQ ) MODE_IMM1 (Byte 〈x2,x7〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 BHCC) MODE_IMM1 (Byte 〈x2,x8〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 BHCS) MODE_IMM1 (Byte 〈x2,x9〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 BPL ) MODE_IMM1 (Byte 〈x2,xA〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 BMI ) MODE_IMM1 (Byte 〈x2,xB〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 BMC ) MODE_IMM1 (Byte 〈x2,xC〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 BMS ) MODE_IMM1 (Byte 〈x2,xD〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 BIL ) MODE_IMM1 (Byte 〈x2,xE〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 BIH ) MODE_IMM1 (Byte 〈x2,xF〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 BGE ) MODE_IMM1 (Byte 〈x9,x0〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 BLT ) MODE_IMM1 (Byte 〈x9,x1〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 BGT ) MODE_IMM1 (Byte 〈x9,x2〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 BLE ) MODE_IMM1 (Byte 〈x9,x3〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_HCS08_7 ≝
-[
-  quadruple … (anyOP HCS08 BSETn) (MODE_DIRn o0) (Byte 〈x1,x0〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BCLRn) (MODE_DIRn o0) (Byte 〈x1,x1〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BSETn) (MODE_DIRn o1) (Byte 〈x1,x2〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BCLRn) (MODE_DIRn o1) (Byte 〈x1,x3〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BSETn) (MODE_DIRn o2) (Byte 〈x1,x4〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BCLRn) (MODE_DIRn o2) (Byte 〈x1,x5〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BSETn) (MODE_DIRn o3) (Byte 〈x1,x6〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BCLRn) (MODE_DIRn o3) (Byte 〈x1,x7〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BSETn) (MODE_DIRn o4) (Byte 〈x1,x8〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BCLRn) (MODE_DIRn o4) (Byte 〈x1,x9〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BSETn) (MODE_DIRn o5) (Byte 〈x1,xA〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BCLRn) (MODE_DIRn o5) (Byte 〈x1,xB〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BSETn) (MODE_DIRn o6) (Byte 〈x1,xC〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BCLRn) (MODE_DIRn o6) (Byte 〈x1,xD〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BSETn) (MODE_DIRn o7) (Byte 〈x1,xE〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BCLRn) (MODE_DIRn o7) (Byte 〈x1,xF〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HCS08_8 ≝
-[
-  quadruple … (anyOP HCS08 BRSETn) (MODE_DIRn_and_IMM1 o0) (Byte 〈x0,x0〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BRCLRn) (MODE_DIRn_and_IMM1 o0) (Byte 〈x0,x1〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BRSETn) (MODE_DIRn_and_IMM1 o1) (Byte 〈x0,x2〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BRCLRn) (MODE_DIRn_and_IMM1 o1) (Byte 〈x0,x3〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BRSETn) (MODE_DIRn_and_IMM1 o2) (Byte 〈x0,x4〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BRCLRn) (MODE_DIRn_and_IMM1 o2) (Byte 〈x0,x5〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BRSETn) (MODE_DIRn_and_IMM1 o3) (Byte 〈x0,x6〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BRCLRn) (MODE_DIRn_and_IMM1 o3) (Byte 〈x0,x7〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BRSETn) (MODE_DIRn_and_IMM1 o4) (Byte 〈x0,x8〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BRCLRn) (MODE_DIRn_and_IMM1 o4) (Byte 〈x0,x9〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BRSETn) (MODE_DIRn_and_IMM1 o5) (Byte 〈x0,xA〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BRCLRn) (MODE_DIRn_and_IMM1 o5) (Byte 〈x0,xB〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BRSETn) (MODE_DIRn_and_IMM1 o6) (Byte 〈x0,xC〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BRCLRn) (MODE_DIRn_and_IMM1 o6) (Byte 〈x0,xD〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BRSETn) (MODE_DIRn_and_IMM1 o7) (Byte 〈x0,xE〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BRCLRn) (MODE_DIRn_and_IMM1 o7) (Byte 〈x0,xF〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HCS08_9 ≝
-[
-  quadruple … (anyOP HCS08 BIT) MODE_IMM1 (Byte 〈xA,x5〉) 〈x0,x2〉
-; quadruple … (anyOP HCS08 BIT) MODE_DIR1 (Byte 〈xB,x5〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 BIT) MODE_DIR2 (Byte 〈xC,x5〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 BIT) MODE_IX2  (Byte 〈xD,x5〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 BIT) MODE_IX1  (Byte 〈xE,x5〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 BIT) MODE_IX0  (Byte 〈xF,x5〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 BIT) MODE_SP2  (Word 〈〈x9,xE〉:〈xD,x5〉〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 BIT) MODE_SP1  (Word 〈〈x9,xE〉:〈xE,x5〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HCS08_10 ≝
-[
-  quadruple … (anyOP HCS08 MUL ) MODE_INH  (Byte 〈x4,x2〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 DIV ) MODE_INH  (Byte 〈x5,x2〉) 〈x0,x6〉
-; quadruple … (anyOP HCS08 NSA ) MODE_INH  (Byte 〈x6,x2〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 DAA ) MODE_INH  (Byte 〈x7,x2〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 RTI ) MODE_INH  (Byte 〈x8,x0〉) 〈x0,x9〉
-; quadruple … (anyOP HCS08 RTS ) MODE_INH  (Byte 〈x8,x1〉) 〈x0,x6〉
-; quadruple … (anyOP HCS08 SWI ) MODE_INH  (Byte 〈x8,x3〉) 〈x0,xB〉
-; quadruple … (anyOP HCS08 BGND) MODE_INH  (Byte 〈x8,x2〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 TAP ) MODE_INH  (Byte 〈x8,x4〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 TPA ) MODE_INH  (Byte 〈x8,x5〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 PULA) MODE_INH  (Byte 〈x8,x6〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 PSHA) MODE_INH  (Byte 〈x8,x7〉) 〈x0,x2〉
-; quadruple … (anyOP HCS08 PULX) MODE_INH  (Byte 〈x8,x8〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 PSHX) MODE_INH  (Byte 〈x8,x9〉) 〈x0,x2〉
-; quadruple … (anyOP HCS08 PULH) MODE_INH  (Byte 〈x8,xA〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 PSHH) MODE_INH  (Byte 〈x8,xB〉) 〈x0,x2〉
-; quadruple … (anyOP HCS08 STOP) MODE_INH  (Byte 〈x8,xE〉) 〈x0,x2〉
-; quadruple … (anyOP HCS08 WAIT) MODE_INH  (Byte 〈x8,xF〉) 〈x0,x2〉
-; quadruple … (anyOP HCS08 TXS ) MODE_INH  (Byte 〈x9,x4〉) 〈x0,x2〉
-; quadruple … (anyOP HCS08 TSX ) MODE_INH  (Byte 〈x9,x5〉) 〈x0,x2〉
-; quadruple … (anyOP HCS08 TAX ) MODE_INH  (Byte 〈x9,x7〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 CLC ) MODE_INH  (Byte 〈x9,x8〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 SEC ) MODE_INH  (Byte 〈x9,x9〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 CLI ) MODE_INH  (Byte 〈x9,xA〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 SEI ) MODE_INH  (Byte 〈x9,xB〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 RSP ) MODE_INH  (Byte 〈x9,xC〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 NOP ) MODE_INH  (Byte 〈x9,xD〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 TXA ) MODE_INH  (Byte 〈x9,xF〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 AIS ) MODE_IMM1 (Byte 〈xA,x7〉) 〈x0,x2〉
-; quadruple … (anyOP HCS08 AIX ) MODE_IMM1 (Byte 〈xA,xF〉) 〈x0,x2〉
-].
-
-ndefinition opcode_table_HCS08_11 ≝
-[
-  quadruple … (anyOP HCS08 CBEQA) MODE_DIR1_and_IMM1 (Byte 〈x3,x1〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 CBEQA) MODE_IMM1_and_IMM1 (Byte 〈x4,x1〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 CBEQX) MODE_IMM1_and_IMM1 (Byte 〈x5,x1〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 CBEQA) MODE_IX1p_and_IMM1 (Byte 〈x6,x1〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 CBEQA) MODE_IX0p_and_IMM1 (Byte 〈x7,x1〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 CBEQA) MODE_SP1_and_IMM1  (Word 〈〈x9,xE〉:〈x6,x1〉〉) 〈x0,x6〉
-].
-
-ndefinition opcode_table_HCS08_12 ≝
-[
-  quadruple … (anyOP HCS08 CLR) MODE_DIR1 (Byte 〈x3,xF〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 CLR) MODE_INHA (Byte 〈x4,xF〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 CLR) MODE_INHX (Byte 〈x5,xF〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 CLR) MODE_IX1  (Byte 〈x6,xF〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 CLR) MODE_IX0  (Byte 〈x7,xF〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 CLR) MODE_INHH (Byte 〈x8,xC〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 CLR) MODE_SP1  (Word 〈〈x9,xE〉:〈x6,xF〉〉) 〈x0,x6〉
-].
-
-ndefinition opcode_table_HCS08_13 ≝
-[
-  quadruple … (anyOP HCS08 CMP) MODE_IMM1 (Byte 〈xA,x1〉) 〈x0,x2〉
-; quadruple … (anyOP HCS08 CMP) MODE_DIR1 (Byte 〈xB,x1〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 CMP) MODE_DIR2 (Byte 〈xC,x1〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 CMP) MODE_IX2  (Byte 〈xD,x1〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 CMP) MODE_IX1  (Byte 〈xE,x1〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 CMP) MODE_IX0  (Byte 〈xF,x1〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 CMP) MODE_SP2  (Word 〈〈x9,xE〉:〈xD,x1〉〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 CMP) MODE_SP1  (Word 〈〈x9,xE〉:〈xE,x1〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HCS08_14 ≝
-[
-  quadruple … (anyOP HCS08 COM) MODE_DIR1 (Byte 〈x3,x3〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 COM) MODE_INHA (Byte 〈x4,x3〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 COM) MODE_INHX (Byte 〈x5,x3〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 COM) MODE_IX1  (Byte 〈x6,x3〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 COM) MODE_IX0  (Byte 〈x7,x3〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 COM) MODE_SP1  (Word 〈〈x9,xE〉:〈x6,x3〉〉) 〈x0,x6〉
-].
-
-ndefinition opcode_table_HCS08_15 ≝
-[
-  quadruple … (anyOP HCS08 CPHX) MODE_DIR2 (Byte 〈x3,xE〉) 〈x0,x6〉
-; quadruple … (anyOP HCS08 CPHX) MODE_IMM2 (Byte 〈x6,x5〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 CPHX) MODE_DIR1 (Byte 〈x7,x5〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 CPHX) MODE_SP1  (Word 〈〈x9,xE〉:〈xF,x3〉〉) 〈x0,x6〉
-
-; quadruple … (anyOP HCS08 LDHX) MODE_DIR2 (Byte 〈x3,x2〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 LDHX) MODE_IMM2 (Byte 〈x4,x5〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 LDHX) MODE_DIR1 (Byte 〈x5,x5〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 LDHX) MODE_IX0  (Word 〈〈x9,xE〉:〈xA,xE〉〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 LDHX) MODE_IX2  (Word 〈〈x9,xE〉:〈xB,xE〉〉) 〈x0,x6〉
-; quadruple … (anyOP HCS08 LDHX) MODE_IX1  (Word 〈〈x9,xE〉:〈xC,xE〉〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 LDHX) MODE_SP1  (Word 〈〈x9,xE〉:〈xF,xE〉〉) 〈x0,x5〉
-
-; quadruple … (anyOP HCS08 STHX) MODE_DIR1 (Byte 〈x3,x5〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 STHX) MODE_DIR2 (Byte 〈x9,x6〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 STHX) MODE_SP1  (Word 〈〈x9,xE〉:〈xF,xF〉〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HCS08_16 ≝
-[
-  quadruple … (anyOP HCS08 CPX) MODE_IMM1 (Byte 〈xA,x3〉) 〈x0,x2〉
-; quadruple … (anyOP HCS08 CPX) MODE_DIR1 (Byte 〈xB,x3〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 CPX) MODE_DIR2 (Byte 〈xC,x3〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 CPX) MODE_IX2  (Byte 〈xD,x3〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 CPX) MODE_IX1  (Byte 〈xE,x3〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 CPX) MODE_IX0  (Byte 〈xF,x3〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 CPX) MODE_SP2  (Word 〈〈x9,xE〉:〈xD,x3〉〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 CPX) MODE_SP1  (Word 〈〈x9,xE〉:〈xE,x3〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HCS08_17 ≝
-[
-  quadruple … (anyOP HCS08 DBNZ) MODE_DIR1_and_IMM1 (Byte 〈x3,xB〉) 〈x0,x7〉
-; quadruple … (anyOP HCS08 DBNZ) MODE_INHA_and_IMM1 (Byte 〈x4,xB〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 DBNZ) MODE_INHX_and_IMM1 (Byte 〈x5,xB〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 DBNZ) MODE_IX1_and_IMM1  (Byte 〈x6,xB〉) 〈x0,x7〉
-; quadruple … (anyOP HCS08 DBNZ) MODE_IX0_and_IMM1  (Byte 〈x7,xB〉) 〈x0,x6〉
-; quadruple … (anyOP HCS08 DBNZ) MODE_SP1_and_IMM1  (Word 〈〈x9,xE〉:〈x6,xB〉〉) 〈x0,x8〉
-].
-
-ndefinition opcode_table_HCS08_18 ≝
-[
-  quadruple … (anyOP HCS08 DEC) MODE_DIR1 (Byte 〈x3,xA〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 DEC) MODE_INHA (Byte 〈x4,xA〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 DEC) MODE_INHX (Byte 〈x5,xA〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 DEC) MODE_IX1  (Byte 〈x6,xA〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 DEC) MODE_IX0  (Byte 〈x7,xA〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 DEC) MODE_SP1  (Word 〈〈x9,xE〉:〈x6,xA〉〉) 〈x0,x6〉
-].
-
-ndefinition opcode_table_HCS08_19 ≝
-[
-  quadruple … (anyOP HCS08 EOR) MODE_IMM1 (Byte 〈xA,x8〉) 〈x0,x2〉
-; quadruple … (anyOP HCS08 EOR) MODE_DIR1 (Byte 〈xB,x8〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 EOR) MODE_DIR2 (Byte 〈xC,x8〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 EOR) MODE_IX2  (Byte 〈xD,x8〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 EOR) MODE_IX1  (Byte 〈xE,x8〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 EOR) MODE_IX0  (Byte 〈xF,x8〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 EOR) MODE_SP2  (Word 〈〈x9,xE〉:〈xD,x8〉〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 EOR) MODE_SP1  (Word 〈〈x9,xE〉:〈xE,x8〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HCS08_20 ≝
-[
-  quadruple … (anyOP HCS08 INC) MODE_DIR1 (Byte 〈x3,xC〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 INC) MODE_INHA (Byte 〈x4,xC〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 INC) MODE_INHX (Byte 〈x5,xC〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 INC) MODE_IX1  (Byte 〈x6,xC〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 INC) MODE_IX0  (Byte 〈x7,xC〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 INC) MODE_SP1  (Word 〈〈x9,xE〉:〈x6,xC〉〉) 〈x0,x6〉
-].
-
-ndefinition opcode_table_HCS08_21 ≝
-[
-  quadruple … (anyOP HCS08 JMP) MODE_IMM1EXT  (Byte 〈xB,xC〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 JMP) MODE_IMM2     (Byte 〈xC,xC〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 JMP) MODE_INHX2ADD (Byte 〈xD,xC〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 JMP) MODE_INHX1ADD (Byte 〈xE,xC〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 JMP) MODE_INHX0ADD (Byte 〈xF,xC〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_HCS08_22 ≝
-[
-  quadruple … (anyOP HCS08 BSR) MODE_IMM1     (Byte 〈xA,xD〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 JSR) MODE_IMM1EXT  (Byte 〈xB,xD〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 JSR) MODE_IMM2     (Byte 〈xC,xD〉) 〈x0,x6〉
-; quadruple … (anyOP HCS08 JSR) MODE_INHX2ADD (Byte 〈xD,xD〉) 〈x0,x6〉
-; quadruple … (anyOP HCS08 JSR) MODE_INHX1ADD (Byte 〈xE,xD〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 JSR) MODE_INHX0ADD (Byte 〈xF,xD〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HCS08_23 ≝
-[
-  quadruple … (anyOP HCS08 LDA) MODE_IMM1 (Byte 〈xA,x6〉) 〈x0,x2〉
-; quadruple … (anyOP HCS08 LDA) MODE_DIR1 (Byte 〈xB,x6〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 LDA) MODE_DIR2 (Byte 〈xC,x6〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 LDA) MODE_IX2  (Byte 〈xD,x6〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 LDA) MODE_IX1  (Byte 〈xE,x6〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 LDA) MODE_IX0  (Byte 〈xF,x6〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 LDA) MODE_SP2  (Word 〈〈x9,xE〉:〈xD,x6〉〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 LDA) MODE_SP1  (Word 〈〈x9,xE〉:〈xE,x6〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HCS08_24 ≝
-[
-  quadruple … (anyOP HCS08 LDX) MODE_IMM1 (Byte 〈xA,xE〉) 〈x0,x2〉
-; quadruple … (anyOP HCS08 LDX) MODE_DIR1 (Byte 〈xB,xE〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 LDX) MODE_DIR2 (Byte 〈xC,xE〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 LDX) MODE_IX2  (Byte 〈xD,xE〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 LDX) MODE_IX1  (Byte 〈xE,xE〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 LDX) MODE_IX0  (Byte 〈xF,xE〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 LDX) MODE_SP2  (Word 〈〈x9,xE〉:〈xD,xE〉〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 LDX) MODE_SP1  (Word 〈〈x9,xE〉:〈xE,xE〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HCS08_25 ≝
-[
-  quadruple … (anyOP HCS08 LSR) MODE_DIR1 (Byte 〈x3,x4〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 LSR) MODE_INHA (Byte 〈x4,x4〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 LSR) MODE_INHX (Byte 〈x5,x4〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 LSR) MODE_IX1  (Byte 〈x6,x4〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 LSR) MODE_IX0  (Byte 〈x7,x4〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 LSR) MODE_SP1  (Word 〈〈x9,xE〉:〈x6,x4〉〉) 〈x0,x6〉
-].
-
-ndefinition opcode_table_HCS08_26 ≝
-[
-  quadruple … (anyOP HCS08 MOV) MODE_DIR1_to_DIR1 (Byte 〈x4,xE〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 MOV) MODE_DIR1_to_IX0p (Byte 〈x5,xE〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 MOV) MODE_IMM1_to_DIR1 (Byte 〈x6,xE〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 MOV) MODE_IX0p_to_DIR1 (Byte 〈x7,xE〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HCS08_27 ≝
-[
-  quadruple … (anyOP HCS08 NEG) MODE_DIR1 (Byte 〈x3,x0〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 NEG) MODE_INHA (Byte 〈x4,x0〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 NEG) MODE_INHX (Byte 〈x5,x0〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 NEG) MODE_IX1  (Byte 〈x6,x0〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 NEG) MODE_IX0  (Byte 〈x7,x0〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 NEG) MODE_SP1  (Word 〈〈x9,xE〉:〈x6,x0〉〉) 〈x0,x6〉
-].
-
-ndefinition opcode_table_HCS08_28 ≝
-[
-  quadruple … (anyOP HCS08 ORA) MODE_IMM1 (Byte 〈xA,xA〉) 〈x0,x2〉
-; quadruple … (anyOP HCS08 ORA) MODE_DIR1 (Byte 〈xB,xA〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 ORA) MODE_DIR2 (Byte 〈xC,xA〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 ORA) MODE_IX2  (Byte 〈xD,xA〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 ORA) MODE_IX1  (Byte 〈xE,xA〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 ORA) MODE_IX0  (Byte 〈xF,xA〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 ORA) MODE_SP2  (Word 〈〈x9,xE〉:〈xD,xA〉〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 ORA) MODE_SP1  (Word 〈〈x9,xE〉:〈xE,xA〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HCS08_29 ≝
-[
-  quadruple … (anyOP HCS08 ROL) MODE_DIR1 (Byte 〈x3,x9〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 ROL) MODE_INHA (Byte 〈x4,x9〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 ROL) MODE_INHX (Byte 〈x5,x9〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 ROL) MODE_IX1  (Byte 〈x6,x9〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 ROL) MODE_IX0  (Byte 〈x7,x9〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 ROL) MODE_SP1  (Word 〈〈x9,xE〉:〈x6,x9〉〉) 〈x0,x6〉
-].
-
-ndefinition opcode_table_HCS08_30 ≝
-[
-  quadruple … (anyOP HCS08 ROR) MODE_DIR1 (Byte 〈x3,x6〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 ROR) MODE_INHA (Byte 〈x4,x6〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 ROR) MODE_INHX (Byte 〈x5,x6〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 ROR) MODE_IX1  (Byte 〈x6,x6〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 ROR) MODE_IX0  (Byte 〈x7,x6〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 ROR) MODE_SP1  (Word 〈〈x9,xE〉:〈x6,x6〉〉) 〈x0,x6〉
-].
-
-ndefinition opcode_table_HCS08_31 ≝
-[
-  quadruple … (anyOP HCS08 SBC) MODE_IMM1 (Byte 〈xA,x2〉) 〈x0,x2〉
-; quadruple … (anyOP HCS08 SBC) MODE_DIR1 (Byte 〈xB,x2〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 SBC) MODE_DIR2 (Byte 〈xC,x2〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 SBC) MODE_IX2  (Byte 〈xD,x2〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 SBC) MODE_IX1  (Byte 〈xE,x2〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 SBC) MODE_IX0  (Byte 〈xF,x2〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 SBC) MODE_SP2  (Word 〈〈x9,xE〉:〈xD,x2〉〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 SBC) MODE_SP1  (Word 〈〈x9,xE〉:〈xE,x2〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HCS08_32 ≝
-[
-  quadruple … (anyOP HCS08 STA) MODE_DIR1 (Byte 〈xB,x7〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 STA) MODE_DIR2 (Byte 〈xC,x7〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 STA) MODE_IX2  (Byte 〈xD,x7〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 STA) MODE_IX1  (Byte 〈xE,x7〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 STA) MODE_IX0  (Byte 〈xF,x7〉) 〈x0,x2〉
-; quadruple … (anyOP HCS08 STA) MODE_SP2  (Word 〈〈x9,xE〉:〈xD,x7〉〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 STA) MODE_SP1  (Word 〈〈x9,xE〉:〈xE,x7〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HCS08_33 ≝
-[
-  quadruple … (anyOP HCS08 STX) MODE_DIR1 (Byte 〈xB,xF〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 STX) MODE_DIR2 (Byte 〈xC,xF〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 STX) MODE_IX2  (Byte 〈xD,xF〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 STX) MODE_IX1  (Byte 〈xE,xF〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 STX) MODE_IX0  (Byte 〈xF,xF〉) 〈x0,x2〉
-; quadruple … (anyOP HCS08 STX) MODE_SP2  (Word 〈〈x9,xE〉:〈xD,xF〉〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 STX) MODE_SP1  (Word 〈〈x9,xE〉:〈xE,xF〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HCS08_34 ≝
-[
-  quadruple … (anyOP HCS08 SUB) MODE_IMM1 (Byte 〈xA,x0〉) 〈x0,x2〉
-; quadruple … (anyOP HCS08 SUB) MODE_DIR1 (Byte 〈xB,x0〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 SUB) MODE_DIR2 (Byte 〈xC,x0〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 SUB) MODE_IX2  (Byte 〈xD,x0〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 SUB) MODE_IX1  (Byte 〈xE,x0〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 SUB) MODE_IX0  (Byte 〈xF,x0〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 SUB) MODE_SP2  (Word 〈〈x9,xE〉:〈xD,x0〉〉) 〈x0,x5〉
-; quadruple … (anyOP HCS08 SUB) MODE_SP1  (Word 〈〈x9,xE〉:〈xE,x0〉〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_HCS08_35 ≝
-[
-  quadruple … (anyOP HCS08 TST) MODE_DIR1 (Byte 〈x3,xD〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 TST) MODE_INHA (Byte 〈x4,xD〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 TST) MODE_INHX (Byte 〈x5,xD〉) 〈x0,x1〉
-; quadruple … (anyOP HCS08 TST) MODE_IX1  (Byte 〈x6,xD〉) 〈x0,x4〉
-; quadruple … (anyOP HCS08 TST) MODE_IX0  (Byte 〈x7,xD〉) 〈x0,x3〉
-; quadruple … (anyOP HCS08 TST) MODE_SP1  (Word 〈〈x9,xE〉:〈x6,xD〉〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_HCS08 ≝
-opcode_table_HCS08_1  @ opcode_table_HCS08_2  @ opcode_table_HCS08_3  @ opcode_table_HCS08_4  @
-opcode_table_HCS08_5  @ opcode_table_HCS08_6  @ opcode_table_HCS08_7  @ opcode_table_HCS08_8  @
-opcode_table_HCS08_9  @ opcode_table_HCS08_10 @ opcode_table_HCS08_11 @ opcode_table_HCS08_12 @
-opcode_table_HCS08_13 @ opcode_table_HCS08_14 @ opcode_table_HCS08_15 @ opcode_table_HCS08_16 @
-opcode_table_HCS08_17 @ opcode_table_HCS08_18 @ opcode_table_HCS08_19 @ opcode_table_HCS08_20 @
-opcode_table_HCS08_21 @ opcode_table_HCS08_22 @ opcode_table_HCS08_23 @ opcode_table_HCS08_24 @
-opcode_table_HCS08_25 @ opcode_table_HCS08_26 @ opcode_table_HCS08_27 @ opcode_table_HCS08_28 @
-opcode_table_HCS08_29 @ opcode_table_HCS08_30 @ opcode_table_HCS08_31 @ opcode_table_HCS08_32 @
-opcode_table_HCS08_33 @ opcode_table_HCS08_34 @ opcode_table_HCS08_35.
diff --git a/helm/software/matita/contribs/ng_assembly/freescale/table_HCS08_tests.ma b/helm/software/matita/contribs/ng_assembly/freescale/table_HCS08_tests.ma
deleted file mode 100755 (executable)
index bd4c8cd..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-(**************************************************************************)
-(*       ___                                                              *)
-(*      ||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              *)
-(*   Ultima modifica: 05/08/2009                                          *)
-(*                                                                        *)
-(* ********************************************************************** *)
-
-include "freescale/table_HCS08.ma".
-include "freescale/opcode.ma".
-
-(* ****************** *)
-(* TABELLA DELL'HCS08 *)
-(* ****************** *)
-
-(* HCS08: opcode non implementati come da manuale (byte) *)
-ndefinition HCS08_not_impl_byte ≝
- [〈x8,xD〉
- ;〈x9,xE〉
- ;〈xA,xC〉
- ].
-
-nlemma ok_byte_table_HCS08 : forall_b8 (λb.
- (test_not_impl_byte b HCS08_not_impl_byte     ⊙ eq_w16 (get_byte_count HCS08 b 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_HCS08) 〈〈x0,x0〉:〈x0,x1〉〉) ⊗
- (⊖ (test_not_impl_byte b HCS08_not_impl_byte) ⊙ eq_w16 (get_byte_count HCS08 b 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_HCS08) 〈〈x0,x0〉:〈x0,x0〉〉))
- = true.
- napply refl_eq.
-nqed.
-
-(* HCS08: opcode non implementati come da manuale (0x9E+byte) *)
-ndefinition HCS08_not_impl_word ≝
- [〈x0,x0〉;〈x0,x1〉;〈x0,x2〉;〈x0,x3〉;〈x0,x4〉;〈x0,x5〉;〈x0,x6〉;〈x0,x7〉
- ;〈x0,x8〉;〈x0,x9〉;〈x0,xA〉;〈x0,xB〉;〈x0,xC〉;〈x0,xD〉;〈x0,xE〉;〈x0,xF〉
- ;〈x1,x0〉;〈x1,x1〉;〈x1,x2〉;〈x1,x3〉;〈x1,x4〉;〈x1,x5〉;〈x1,x6〉;〈x1,x7〉
- ;〈x1,x8〉;〈x1,x9〉;〈x1,xA〉;〈x1,xB〉;〈x1,xC〉;〈x1,xD〉;〈x1,xE〉;〈x1,xF〉
- ;〈x2,x0〉;〈x2,x1〉;〈x2,x2〉;〈x2,x3〉;〈x2,x4〉;〈x2,x5〉;〈x2,x6〉;〈x2,x7〉
- ;〈x2,x8〉;〈x2,x9〉;〈x2,xA〉;〈x2,xB〉;〈x2,xC〉;〈x2,xD〉;〈x2,xE〉;〈x2,xF〉
- ;〈x3,x0〉;〈x3,x1〉;〈x3,x2〉;〈x3,x3〉;〈x3,x4〉;〈x3,x5〉;〈x3,x6〉;〈x3,x7〉
- ;〈x3,x8〉;〈x3,x9〉;〈x3,xA〉;〈x3,xB〉;〈x3,xC〉;〈x3,xD〉;〈x3,xE〉;〈x3,xF〉
- ;〈x4,x0〉;〈x4,x1〉;〈x4,x2〉;〈x4,x3〉;〈x4,x4〉;〈x4,x5〉;〈x4,x6〉;〈x4,x7〉
- ;〈x4,x8〉;〈x4,x9〉;〈x4,xA〉;〈x4,xB〉;〈x4,xC〉;〈x4,xD〉;〈x4,xE〉;〈x4,xF〉
- ;〈x5,x0〉;〈x5,x1〉;〈x5,x2〉;〈x5,x3〉;〈x5,x4〉;〈x5,x5〉;〈x5,x6〉;〈x5,x7〉
- ;〈x5,x8〉;〈x5,x9〉;〈x5,xA〉;〈x5,xB〉;〈x5,xC〉;〈x5,xD〉;〈x5,xE〉;〈x5,xF〉
- ;〈x6,x2〉;〈x6,x5〉;〈x6,xE〉
- ;〈x7,x0〉;〈x7,x1〉;〈x7,x2〉;〈x7,x3〉;〈x7,x4〉;〈x7,x5〉;〈x7,x6〉;〈x7,x7〉
- ;〈x7,x8〉;〈x7,x9〉;〈x7,xA〉;〈x7,xB〉;〈x7,xC〉;〈x7,xD〉;〈x7,xE〉;〈x7,xF〉
- ;〈x8,x0〉;〈x8,x1〉;〈x8,x2〉;〈x8,x3〉;〈x8,x4〉;〈x8,x5〉;〈x8,x6〉;〈x8,x7〉
- ;〈x8,x8〉;〈x8,x9〉;〈x8,xA〉;〈x8,xB〉;〈x8,xC〉;〈x8,xD〉;〈x8,xE〉;〈x8,xF〉
- ;〈x9,x0〉;〈x9,x1〉;〈x9,x2〉;〈x9,x3〉;〈x9,x4〉;〈x9,x5〉;〈x9,x6〉;〈x9,x7〉
- ;〈x9,x8〉;〈x9,x9〉;〈x9,xA〉;〈x9,xB〉;〈x9,xC〉;〈x9,xD〉;〈x9,xE〉;〈x9,xF〉
- ;〈xA,x0〉;〈xA,x1〉;〈xA,x2〉;〈xA,x3〉;〈xA,x4〉;〈xA,x5〉;〈xA,x6〉;〈xA,x7〉;〈xA,x8〉;〈xA,x9〉;〈xA,xA〉;〈xA,xB〉;〈xA,xC〉;〈xA,xD〉;〈xA,xF〉
- ;〈xB,x0〉;〈xB,x1〉;〈xB,x2〉;〈xB,x3〉;〈xB,x4〉;〈xB,x5〉;〈xB,x6〉;〈xB,x7〉;〈xB,x8〉;〈xB,x9〉;〈xB,xA〉;〈xB,xB〉;〈xB,xC〉;〈xB,xD〉;〈xB,xF〉
- ;〈xC,x0〉;〈xC,x1〉;〈xC,x2〉;〈xC,x3〉;〈xC,x4〉;〈xC,x5〉;〈xC,x6〉;〈xC,x7〉;〈xC,x8〉;〈xC,x9〉;〈xC,xA〉;〈xC,xB〉;〈xC,xC〉;〈xC,xD〉;〈xC,xF〉
- ;〈xD,xC〉;〈xD,xD〉
- ;〈xE,xC〉;〈xE,xD〉
- ;〈xF,x0〉;〈xF,x1〉;〈xF,x2〉;〈xF,x4〉;〈xF,x5〉;〈xF,x6〉;〈xF,x7〉;〈xF,x8〉;〈xF,x9〉;〈xF,xA〉;〈xF,xB〉;〈xF,xC〉;〈xF,xD〉
- ].
-
-nlemma ok_word_table_HCS08 : forall_b8 (λb.
- (test_not_impl_byte b HCS08_not_impl_word     ⊙ eq_w16 (get_word_count HCS08 b 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_HCS08) 〈〈x0,x0〉:〈x0,x1〉〉) ⊗
- (⊖ (test_not_impl_byte b HCS08_not_impl_word) ⊙ eq_w16 (get_word_count HCS08 b 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_HCS08) 〈〈x0,x0〉:〈x0,x0〉〉))
- = true.
- napply refl_eq.
-nqed.
-
-(* HCS08: pseudocodici non implementati come da manuale *)
-ndefinition HCS08_not_impl_pseudo ≝
- [ SHA ; SLA ].
-
-nlemma ok_pseudo_table_HCS08 : forall_op (λo.
- (test_not_impl_pseudo o HCS08_not_impl_pseudo     ⊙ le_w16 〈〈x0,x0〉:〈x0,x1〉〉 (get_pseudo_count HCS08 o 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_HCS08)) ⊗
- (⊖ (test_not_impl_pseudo o HCS08_not_impl_pseudo) ⊙ eq_w16 (get_pseudo_count HCS08 o 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_HCS08) 〈〈x0,x0〉:〈x0,x0〉〉))
- = true.
- napply refl_eq.
-nqed.
-
-(* HCS08: modalita' non implementate come da manuale *)
-ndefinition HCS08_not_impl_mode ≝
- [ MODE_TNY x0 ; MODE_TNY x1 ; MODE_TNY x2 ; MODE_TNY x3
- ; MODE_TNY x4 ; MODE_TNY x5 ; MODE_TNY x6 ; MODE_TNY x7
- ; MODE_TNY x8 ; MODE_TNY x9 ; MODE_TNY xA ; MODE_TNY xB
- ; MODE_TNY xC ; MODE_TNY xD ; MODE_TNY xE ; MODE_TNY xF
- ; MODE_SRT t00 ; MODE_SRT t01 ; MODE_SRT t02 ; MODE_SRT t03
- ; MODE_SRT t04 ; MODE_SRT t05 ; MODE_SRT t06 ; MODE_SRT t07
- ; MODE_SRT t08 ; MODE_SRT t09 ; MODE_SRT t0A ; MODE_SRT t0B
- ; MODE_SRT t0C ; MODE_SRT t0D ; MODE_SRT t0E ; MODE_SRT t0F
- ; MODE_SRT t10 ; MODE_SRT t11 ; MODE_SRT t12 ; MODE_SRT t13
- ; MODE_SRT t14 ; MODE_SRT t15 ; MODE_SRT t16 ; MODE_SRT t17
- ; MODE_SRT t18 ; MODE_SRT t19 ; MODE_SRT t1A ; MODE_SRT t1B
- ; MODE_SRT t1C ; MODE_SRT t1D ; MODE_SRT t1E ; MODE_SRT t1F ].
-
-nlemma ok_mode_table_HCS08 : forall_im (λi.
- (test_not_impl_mode i HCS08_not_impl_mode     ⊙ le_w16 〈〈x0,x0〉:〈x0,x1〉〉 (get_mode_count HCS08 i 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_HCS08)) ⊗
- (⊖ (test_not_impl_mode i HCS08_not_impl_mode) ⊙ eq_w16 (get_mode_count HCS08 i 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_HCS08) 〈〈x0,x0〉:〈x0,x0〉〉))
- = true.
- napply refl_eq.
-nqed.
-
-nlemma ok_OpIm_table_HCS08 :
- forall_im (λi:instr_mode.
- forall_op (λop:opcode.
-  le_w16 (get_OpIm_count HCS08 (anyOP HCS08 op) i 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_HCS08) 〈〈x0,x0〉:〈x0,x1〉〉)) = true.
- napply refl_eq.
-nqed.
diff --git a/helm/software/matita/contribs/ng_assembly/freescale/table_RS08.ma b/helm/software/matita/contribs/ng_assembly/freescale/table_RS08.ma
deleted file mode 100755 (executable)
index 8398e96..0000000
+++ /dev/null
@@ -1,395 +0,0 @@
-(**************************************************************************)
-(*       ___                                                              *)
-(*      ||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              *)
-(*   Ultima modifica: 05/08/2009                                          *)
-(*                                                                        *)
-(* ********************************************************************** *)
-
-include "freescale/opcode_base.ma".
-include "common/list.ma".
-
-(* ***************** *)
-(* TABELLA DELL'RS08 *)
-(* ***************** *)
-
-(* definizione come concatenazione finale di liste per velocizzare il parsing *)
-(* ogni riga e' (any_opcode m) (instr_mode) (opcode esadecimale) (#cicli esecuzione) *)
-(* NB: l'uso di any_opcode m + concatenazione finale tutte liste
-       impedisce di introdurre opcode disomogenei (per mcu) *)
-
-ndefinition opcode_table_RS08_1 ≝
-[ 
-  quadruple … (anyOP RS08 ADC) MODE_IMM1 (Byte 〈xA,x9〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 ADC) MODE_DIR1 (Byte 〈xB,x9〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_RS08_2 ≝
-[ 
-  quadruple … (anyOP RS08 ADD) MODE_IMM1     (Byte 〈xA,xB〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 ADD) MODE_DIR1     (Byte 〈xB,xB〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 ADD) (MODE_TNY x0) (Byte 〈x6,x0〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 ADD) (MODE_TNY x1) (Byte 〈x6,x1〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 ADD) (MODE_TNY x2) (Byte 〈x6,x2〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 ADD) (MODE_TNY x3) (Byte 〈x6,x3〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 ADD) (MODE_TNY x4) (Byte 〈x6,x4〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 ADD) (MODE_TNY x5) (Byte 〈x6,x5〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 ADD) (MODE_TNY x6) (Byte 〈x6,x6〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 ADD) (MODE_TNY x7) (Byte 〈x6,x7〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 ADD) (MODE_TNY x8) (Byte 〈x6,x8〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 ADD) (MODE_TNY x9) (Byte 〈x6,x9〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 ADD) (MODE_TNY xA) (Byte 〈x6,xA〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 ADD) (MODE_TNY xB) (Byte 〈x6,xB〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 ADD) (MODE_TNY xC) (Byte 〈x6,xC〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 ADD) (MODE_TNY xD) (Byte 〈x6,xD〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 ADD) (MODE_TNY xE) (Byte 〈x6,xE〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 ADD) (MODE_TNY xF) (Byte 〈x6,xF〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_RS08_3 ≝
-[ 
-  quadruple … (anyOP RS08 AND) MODE_IMM1 (Byte 〈xA,x4〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 AND) MODE_DIR1 (Byte 〈xB,x4〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_RS08_4 ≝
-[
-  quadruple … (anyOP RS08 ASL) MODE_INHA (Byte 〈x4,x8〉) 〈x0,x1〉
-].
-
-ndefinition opcode_table_RS08_5 ≝
-[
-  quadruple … (anyOP RS08 BRA) MODE_IMM1 (Byte 〈x3,x0〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 BCC) MODE_IMM1 (Byte 〈x3,x4〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 BCS) MODE_IMM1 (Byte 〈x3,x5〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 BNE) MODE_IMM1 (Byte 〈x3,x6〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 BEQ) MODE_IMM1 (Byte 〈x3,x7〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_RS08_6 ≝
-[
-  quadruple … (anyOP RS08 BSETn) (MODE_DIRn o0) (Byte 〈x1,x0〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BCLRn) (MODE_DIRn o0) (Byte 〈x1,x1〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BSETn) (MODE_DIRn o1) (Byte 〈x1,x2〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BCLRn) (MODE_DIRn o1) (Byte 〈x1,x3〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BSETn) (MODE_DIRn o2) (Byte 〈x1,x4〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BCLRn) (MODE_DIRn o2) (Byte 〈x1,x5〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BSETn) (MODE_DIRn o3) (Byte 〈x1,x6〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BCLRn) (MODE_DIRn o3) (Byte 〈x1,x7〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BSETn) (MODE_DIRn o4) (Byte 〈x1,x8〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BCLRn) (MODE_DIRn o4) (Byte 〈x1,x9〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BSETn) (MODE_DIRn o5) (Byte 〈x1,xA〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BCLRn) (MODE_DIRn o5) (Byte 〈x1,xB〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BSETn) (MODE_DIRn o6) (Byte 〈x1,xC〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BCLRn) (MODE_DIRn o6) (Byte 〈x1,xD〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BSETn) (MODE_DIRn o7) (Byte 〈x1,xE〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BCLRn) (MODE_DIRn o7) (Byte 〈x1,xF〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_RS08_7 ≝
-[
-  quadruple … (anyOP RS08 BRSETn) (MODE_DIRn_and_IMM1 o0) (Byte 〈x0,x0〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BRCLRn) (MODE_DIRn_and_IMM1 o0) (Byte 〈x0,x1〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BRSETn) (MODE_DIRn_and_IMM1 o1) (Byte 〈x0,x2〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BRCLRn) (MODE_DIRn_and_IMM1 o1) (Byte 〈x0,x3〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BRSETn) (MODE_DIRn_and_IMM1 o2) (Byte 〈x0,x4〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BRCLRn) (MODE_DIRn_and_IMM1 o2) (Byte 〈x0,x5〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BRSETn) (MODE_DIRn_and_IMM1 o3) (Byte 〈x0,x6〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BRCLRn) (MODE_DIRn_and_IMM1 o3) (Byte 〈x0,x7〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BRSETn) (MODE_DIRn_and_IMM1 o4) (Byte 〈x0,x8〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BRCLRn) (MODE_DIRn_and_IMM1 o4) (Byte 〈x0,x9〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BRSETn) (MODE_DIRn_and_IMM1 o5) (Byte 〈x0,xA〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BRCLRn) (MODE_DIRn_and_IMM1 o5) (Byte 〈x0,xB〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BRSETn) (MODE_DIRn_and_IMM1 o6) (Byte 〈x0,xC〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BRCLRn) (MODE_DIRn_and_IMM1 o6) (Byte 〈x0,xD〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BRSETn) (MODE_DIRn_and_IMM1 o7) (Byte 〈x0,xE〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 BRCLRn) (MODE_DIRn_and_IMM1 o7) (Byte 〈x0,xF〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_RS08_8 ≝
-[
-  quadruple … (anyOP RS08 CLC ) MODE_INH (Byte 〈x3,x8〉) 〈x0,x1〉
-; quadruple … (anyOP RS08 SEC ) MODE_INH (Byte 〈x3,x9〉) 〈x0,x1〉
-; quadruple … (anyOP RS08 SLA ) MODE_INH (Byte 〈x4,x2〉) 〈x0,x1〉
-; quadruple … (anyOP RS08 SHA ) MODE_INH (Byte 〈x4,x5〉) 〈x0,x1〉
-; quadruple … (anyOP RS08 NOP ) MODE_INH (Byte 〈xA,xC〉) 〈x0,x1〉
-; quadruple … (anyOP RS08 STOP) MODE_INH (Byte 〈xA,xE〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 WAIT) MODE_INH (Byte 〈xA,xF〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 RTS ) MODE_INH (Byte 〈xB,xE〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 BGND) MODE_INH (Byte 〈xB,xF〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_RS08_9 ≝
-[
-  quadruple … (anyOP RS08 CBEQA) MODE_DIR1_and_IMM1 (Byte 〈x3,x1〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 CBEQA) MODE_IMM1_and_IMM1 (Byte 〈x4,x1〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_RS08_10 ≝
-[
-  quadruple … (anyOP RS08 CLR) MODE_DIR1      (Byte 〈x3,xF〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 CLR) MODE_INHA      (Byte 〈x4,xF〉) 〈x0,x1〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t00) (Byte 〈x8,x0〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t01) (Byte 〈x8,x1〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t02) (Byte 〈x8,x2〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t03) (Byte 〈x8,x3〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t04) (Byte 〈x8,x4〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t05) (Byte 〈x8,x5〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t06) (Byte 〈x8,x6〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t07) (Byte 〈x8,x7〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t08) (Byte 〈x8,x8〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t09) (Byte 〈x8,x9〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t0A) (Byte 〈x8,xA〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t0B) (Byte 〈x8,xB〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t0C) (Byte 〈x8,xC〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t0D) (Byte 〈x8,xD〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t0E) (Byte 〈x8,xE〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t0F) (Byte 〈x8,xF〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t10) (Byte 〈x9,x0〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t11) (Byte 〈x9,x1〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t12) (Byte 〈x9,x2〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t13) (Byte 〈x9,x3〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t14) (Byte 〈x9,x4〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t15) (Byte 〈x9,x5〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t16) (Byte 〈x9,x6〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t17) (Byte 〈x9,x7〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t18) (Byte 〈x9,x8〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t19) (Byte 〈x9,x9〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t1A) (Byte 〈x9,xA〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t1B) (Byte 〈x9,xB〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t1C) (Byte 〈x9,xC〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t1D) (Byte 〈x9,xD〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t1E) (Byte 〈x9,xE〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CLR) (MODE_SRT t1F) (Byte 〈x9,xF〉) 〈x0,x2〉
-].
-
-ndefinition opcode_table_RS08_11 ≝
-[
-  quadruple … (anyOP RS08 CMP) MODE_IMM1 (Byte 〈xA,x1〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 CMP) MODE_DIR1 (Byte 〈xB,x1〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_RS08_12 ≝
-[
-  quadruple … (anyOP RS08 COM) MODE_INHA (Byte 〈x4,x3〉) 〈x0,x1〉
-].
-
-ndefinition opcode_table_RS08_13 ≝
-[
-  quadruple … (anyOP RS08 DBNZ) MODE_DIR1_and_IMM1 (Byte 〈x3,xB〉) 〈x0,x7〉
-; quadruple … (anyOP RS08 DBNZ) MODE_INHA_and_IMM1 (Byte 〈x4,xB〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_RS08_14 ≝
-[
-  quadruple … (anyOP RS08 DEC) MODE_DIR1     (Byte 〈x3,xA〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 DEC) MODE_INHA     (Byte 〈x4,xA〉) 〈x0,x1〉
-; quadruple … (anyOP RS08 DEC) (MODE_TNY x0) (Byte 〈x5,x0〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 DEC) (MODE_TNY x1) (Byte 〈x5,x1〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 DEC) (MODE_TNY x2) (Byte 〈x5,x2〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 DEC) (MODE_TNY x3) (Byte 〈x5,x3〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 DEC) (MODE_TNY x4) (Byte 〈x5,x4〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 DEC) (MODE_TNY x5) (Byte 〈x5,x5〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 DEC) (MODE_TNY x6) (Byte 〈x5,x6〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 DEC) (MODE_TNY x7) (Byte 〈x5,x7〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 DEC) (MODE_TNY x8) (Byte 〈x5,x8〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 DEC) (MODE_TNY x9) (Byte 〈x5,x9〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 DEC) (MODE_TNY xA) (Byte 〈x5,xA〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 DEC) (MODE_TNY xB) (Byte 〈x5,xB〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 DEC) (MODE_TNY xC) (Byte 〈x5,xC〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 DEC) (MODE_TNY xD) (Byte 〈x5,xD〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 DEC) (MODE_TNY xE) (Byte 〈x5,xE〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 DEC) (MODE_TNY xF) (Byte 〈x5,xF〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_RS08_15 ≝
-[ 
-  quadruple … (anyOP RS08 EOR) MODE_IMM1 (Byte 〈xA,x8〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 EOR) MODE_DIR1 (Byte 〈xB,x8〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_RS08_16 ≝
-[
-  quadruple … (anyOP RS08 INC) MODE_DIR1     (Byte 〈x3,xC〉) 〈x0,x5〉
-; quadruple … (anyOP RS08 INC) MODE_INHA     (Byte 〈x4,xC〉) 〈x0,x1〉
-; quadruple … (anyOP RS08 INC) (MODE_TNY x0) (Byte 〈x2,x0〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 INC) (MODE_TNY x1) (Byte 〈x2,x1〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 INC) (MODE_TNY x2) (Byte 〈x2,x2〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 INC) (MODE_TNY x3) (Byte 〈x2,x3〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 INC) (MODE_TNY x4) (Byte 〈x2,x4〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 INC) (MODE_TNY x5) (Byte 〈x2,x5〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 INC) (MODE_TNY x6) (Byte 〈x2,x6〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 INC) (MODE_TNY x7) (Byte 〈x2,x7〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 INC) (MODE_TNY x8) (Byte 〈x2,x8〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 INC) (MODE_TNY x9) (Byte 〈x2,x9〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 INC) (MODE_TNY xA) (Byte 〈x2,xA〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 INC) (MODE_TNY xB) (Byte 〈x2,xB〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 INC) (MODE_TNY xC) (Byte 〈x2,xC〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 INC) (MODE_TNY xD) (Byte 〈x2,xD〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 INC) (MODE_TNY xE) (Byte 〈x2,xE〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 INC) (MODE_TNY xF) (Byte 〈x2,xF〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_RS08_17 ≝
-[
-  quadruple … (anyOP RS08 JMP) MODE_IMM2 (Byte 〈xB,xC〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_RS08_18 ≝
-[
-  quadruple … (anyOP RS08 BSR) MODE_IMM1 (Byte 〈xA,xD〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 JSR) MODE_IMM2 (Byte 〈xB,xD〉) 〈x0,x4〉
-].
-
-ndefinition opcode_table_RS08_19 ≝
-[
-  quadruple … (anyOP RS08 LDA) MODE_IMM1      (Byte 〈xA,x6〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 LDA) MODE_DIR1      (Byte 〈xB,x6〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t00) (Byte 〈xC,x0〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t01) (Byte 〈xC,x1〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t02) (Byte 〈xC,x2〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t03) (Byte 〈xC,x3〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t04) (Byte 〈xC,x4〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t05) (Byte 〈xC,x5〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t06) (Byte 〈xC,x6〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t07) (Byte 〈xC,x7〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t08) (Byte 〈xC,x8〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t09) (Byte 〈xC,x9〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t0A) (Byte 〈xC,xA〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t0B) (Byte 〈xC,xB〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t0C) (Byte 〈xC,xC〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t0D) (Byte 〈xC,xD〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t0E) (Byte 〈xC,xE〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t0F) (Byte 〈xC,xF〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t10) (Byte 〈xD,x0〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t11) (Byte 〈xD,x1〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t12) (Byte 〈xD,x2〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t13) (Byte 〈xD,x3〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t14) (Byte 〈xD,x4〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t15) (Byte 〈xD,x5〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t16) (Byte 〈xD,x6〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t17) (Byte 〈xD,x7〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t18) (Byte 〈xD,x8〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t19) (Byte 〈xD,x9〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t1A) (Byte 〈xD,xA〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t1B) (Byte 〈xD,xB〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t1C) (Byte 〈xD,xC〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t1D) (Byte 〈xD,xD〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t1E) (Byte 〈xD,xE〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 LDA) (MODE_SRT t1F) (Byte 〈xD,xF〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_RS08_20 ≝
-[
-  quadruple … (anyOP RS08 LSR) MODE_INHA (Byte 〈x4,x4〉) 〈x0,x1〉
-].
-
-ndefinition opcode_table_RS08_21 ≝
-[
-  quadruple … (anyOP RS08 MOV) MODE_IMM1_to_DIR1 (Byte 〈x3,xE〉) 〈x0,x4〉
-; quadruple … (anyOP RS08 MOV) MODE_DIR1_to_DIR1 (Byte 〈x4,xE〉) 〈x0,x5〉
-].
-
-ndefinition opcode_table_RS08_22 ≝
-[ 
-  quadruple … (anyOP RS08 ORA) MODE_IMM1 (Byte 〈xA,xA〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 ORA) MODE_DIR1 (Byte 〈xB,xA〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_RS08_23 ≝
-[
-  quadruple … (anyOP RS08 ROL) MODE_INHA (Byte 〈x4,x9〉) 〈x0,x1〉
-].
-
-ndefinition opcode_table_RS08_24 ≝
-[
-  quadruple … (anyOP RS08 ROR) MODE_INHA (Byte 〈x4,x6〉) 〈x0,x1〉
-].
-
-ndefinition opcode_table_RS08_25 ≝
-[
-  quadruple … (anyOP RS08 SBC) MODE_IMM1 (Byte 〈xA,x2〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 SBC) MODE_DIR1 (Byte 〈xB,x2〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_RS08_26 ≝
-[
-  quadruple … (anyOP RS08 STA) MODE_DIR1      (Byte 〈xB,x7〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t00) (Byte 〈xE,x0〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t01) (Byte 〈xE,x1〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t02) (Byte 〈xE,x2〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t03) (Byte 〈xE,x3〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t04) (Byte 〈xE,x4〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t05) (Byte 〈xE,x5〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t06) (Byte 〈xE,x6〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t07) (Byte 〈xE,x7〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t08) (Byte 〈xE,x8〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t09) (Byte 〈xE,x9〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t0A) (Byte 〈xE,xA〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t0B) (Byte 〈xE,xB〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t0C) (Byte 〈xE,xC〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t0D) (Byte 〈xE,xD〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t0E) (Byte 〈xE,xE〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t0F) (Byte 〈xE,xF〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t10) (Byte 〈xF,x0〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t11) (Byte 〈xF,x1〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t12) (Byte 〈xF,x2〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t13) (Byte 〈xF,x3〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t14) (Byte 〈xF,x4〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t15) (Byte 〈xF,x5〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t16) (Byte 〈xF,x6〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t17) (Byte 〈xF,x7〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t18) (Byte 〈xF,x8〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t19) (Byte 〈xF,x9〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t1A) (Byte 〈xF,xA〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t1B) (Byte 〈xF,xB〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t1C) (Byte 〈xF,xC〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t1D) (Byte 〈xF,xD〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t1E) (Byte 〈xF,xE〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 STA) (MODE_SRT t1F) (Byte 〈xF,xF〉) 〈x0,x2〉
-].
-
-ndefinition opcode_table_RS08_27 ≝
-[ 
-  quadruple … (anyOP RS08 SUB) MODE_IMM1     (Byte 〈xA,x0〉) 〈x0,x2〉
-; quadruple … (anyOP RS08 SUB) MODE_DIR1     (Byte 〈xB,x0〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 SUB) (MODE_TNY x0) (Byte 〈x7,x0〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 SUB) (MODE_TNY x1) (Byte 〈x7,x1〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 SUB) (MODE_TNY x2) (Byte 〈x7,x2〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 SUB) (MODE_TNY x3) (Byte 〈x7,x3〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 SUB) (MODE_TNY x4) (Byte 〈x7,x4〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 SUB) (MODE_TNY x5) (Byte 〈x7,x5〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 SUB) (MODE_TNY x6) (Byte 〈x7,x6〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 SUB) (MODE_TNY x7) (Byte 〈x7,x7〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 SUB) (MODE_TNY x8) (Byte 〈x7,x8〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 SUB) (MODE_TNY x9) (Byte 〈x7,x9〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 SUB) (MODE_TNY xA) (Byte 〈x7,xA〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 SUB) (MODE_TNY xB) (Byte 〈x7,xB〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 SUB) (MODE_TNY xC) (Byte 〈x7,xC〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 SUB) (MODE_TNY xD) (Byte 〈x7,xD〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 SUB) (MODE_TNY xE) (Byte 〈x7,xE〉) 〈x0,x3〉
-; quadruple … (anyOP RS08 SUB) (MODE_TNY xF) (Byte 〈x7,xF〉) 〈x0,x3〉
-].
-
-ndefinition opcode_table_RS08 ≝
-opcode_table_RS08_1  @ opcode_table_RS08_2  @ opcode_table_RS08_3  @ opcode_table_RS08_4  @
-opcode_table_RS08_5  @ opcode_table_RS08_6  @ opcode_table_RS08_7  @ opcode_table_RS08_8  @
-opcode_table_RS08_9  @ opcode_table_RS08_10 @ opcode_table_RS08_11 @ opcode_table_RS08_12 @
-opcode_table_RS08_13 @ opcode_table_RS08_14 @ opcode_table_RS08_15 @ opcode_table_RS08_16 @
-opcode_table_RS08_17 @ opcode_table_RS08_18 @ opcode_table_RS08_19 @ opcode_table_RS08_20 @
-opcode_table_RS08_21 @ opcode_table_RS08_22 @ opcode_table_RS08_23 @ opcode_table_RS08_24 @
-opcode_table_RS08_25 @ opcode_table_RS08_26 @ opcode_table_RS08_27.
diff --git a/helm/software/matita/contribs/ng_assembly/freescale/table_RS08_tests.ma b/helm/software/matita/contribs/ng_assembly/freescale/table_RS08_tests.ma
deleted file mode 100755 (executable)
index 759d1bf..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-(**************************************************************************)
-(*       ___                                                              *)
-(*      ||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              *)
-(*   Ultima modifica: 05/08/2009                                          *)
-(*                                                                        *)
-(* ********************************************************************** *)
-
-include "freescale/table_RS08.ma".
-include "freescale/opcode.ma".
-
-(* ***************** *)
-(* TABELLA DELL'RS08 *)
-(* ***************** *)
-
-(* RS08: opcode non implementati come da manuale *)
-ndefinition RS08_not_impl_byte ≝
- [〈x3,x2〉;〈x3,x3〉;〈x3,xD〉
- ;〈x4,x0〉;〈x4,x7〉;〈x4,xD〉
- ;〈xA,x3〉;〈xA,x5〉;〈xA,x7〉
- ;〈xB,x3〉;〈xB,x5〉
- ].
-
-nlemma ok_byte_table_RS08 : forall_b8 (λb.
- (test_not_impl_byte b RS08_not_impl_byte     ⊙ eq_w16 (get_byte_count RS08 b 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_RS08) 〈〈x0,x0〉:〈x0,x1〉〉) ⊗
- (⊖ (test_not_impl_byte b RS08_not_impl_byte) ⊙ eq_w16 (get_byte_count RS08 b 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_RS08) 〈〈x0,x0〉:〈x0,x0〉〉))
- = true.
- napply refl_eq.
-nqed.
-
-(* RS08: pseudocodici non implementati come da manuale *)
-ndefinition RS08_not_impl_pseudo ≝
- [ AIS ; AIX ; ASR ; BGE ; BGT ; BHCC ; BHCS ; BHI ; BIH ; BIL ; BIT ; BLE ; BLS
- ; BLT ; BMC ; BMI ; BMS ; BPL ; BRN ; CBEQX ; CLI ; CPHX ; CPX ; DAA ; DIV
- ; LDHX ; LDX ; MUL ; NEG ; NSA ; PSHA ; PSHH ; PSHX ; PULA ; PULH ; PULX ; RSP  
- ; RTI ; SEI ; STHX ; STX ; SWI ; TAP ; TAX ; TPA ; TST ; TSX ; TXA ; TXS ].
-
-nlemma ok_pseudo_table_RS08 : forall_op (λo.
- (test_not_impl_pseudo o RS08_not_impl_pseudo     ⊙ le_w16 〈〈x0,x0〉:〈x0,x1〉〉 (get_pseudo_count RS08 o 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_RS08)) ⊗
- (⊖ (test_not_impl_pseudo o RS08_not_impl_pseudo) ⊙ eq_w16 (get_pseudo_count RS08 o 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_RS08) 〈〈x0,x0〉:〈x0,x0〉〉))
- = true.
- napply refl_eq.
-nqed.
-
-(* RS08: modalita' non implementate come da manuale *)
-ndefinition RS08_not_impl_mode ≝
- [ MODE_INHX ; MODE_INHH ; MODE_INHX0ADD ; MODE_INHX1ADD ; MODE_INHX2ADD ; MODE_IMM1EXT
- ; MODE_DIR2 ; MODE_IX0 ; MODE_IX1 ; MODE_IX2 ; MODE_SP1 ; MODE_SP2
- ; MODE_IX0p_to_DIR1 ; MODE_DIR1_to_IX0p ; MODE_INHX_and_IMM1 ; MODE_IX0_and_IMM1
- ; MODE_IX0p_and_IMM1 ; MODE_IX1_and_IMM1 ; MODE_IX1p_and_IMM1 ; MODE_SP1_and_IMM1 ].
-
-nlemma ok_mode_table_RS08 : forall_im (λi.
- (test_not_impl_mode i RS08_not_impl_mode     ⊙ le_w16 〈〈x0,x0〉:〈x0,x1〉〉 (get_mode_count RS08 i 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_RS08)) ⊗
- (⊖ (test_not_impl_mode i RS08_not_impl_mode) ⊙ eq_w16 (get_mode_count RS08 i 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_RS08) 〈〈x0,x0〉:〈x0,x0〉〉))
- = true.
- napply refl_eq.
-nqed.
-
-nlemma ok_OpIm_table_RS08 :
- forall_im (λi:instr_mode.
- forall_op (λop:opcode.
-  le_w16 (get_OpIm_count RS08 (anyOP RS08 op) i 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_RS08) 〈〈x0,x0〉:〈x0,x1〉〉)) = true.
- napply refl_eq.
-nqed.
diff --git a/helm/software/matita/contribs/ng_assembly/opcodes/HC05_opcode_base.ma b/helm/software/matita/contribs/ng_assembly/opcodes/HC05_opcode_base.ma
new file mode 100755 (executable)
index 0000000..4d03008
--- /dev/null
@@ -0,0 +1,222 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||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".
+
+(* ********************************************** *)
+(* MATTONI BASE PER DEFINIRE LE TABELLE DELLE MCU *)
+(* ********************************************** *)
+
+(* enumerazione delle modalita' di indirizzamento = caricamento degli operandi *)
+ninductive HC05_instr_mode: Type ≝
+  (* INHERENT = nessun operando *)
+  MODE_INH  : HC05_instr_mode
+  (* INHERENT = nessun operando (A implicito) *)
+| MODE_INHA : HC05_instr_mode
+  (* INHERENT = nessun operando (X implicito) *)
+| MODE_INHX : HC05_instr_mode
+
+  (* INHERENT_ADDRESS = nessun operando (HX implicito) *)
+| MODE_INHX0ADD : HC05_instr_mode
+  (* INHERENT_ADDRESS = nessun operando (HX implicito+0x00bb) *)
+| MODE_INHX1ADD : HC05_instr_mode
+  (* INHERENT_ADDRESS = nessun operando (HX implicito+0xwwww) *)
+| MODE_INHX2ADD : HC05_instr_mode
+
+  (* IMMEDIATE = operando valore immediato byte = 0xbb *)
+| MODE_IMM1 : HC05_instr_mode
+  (* IMMEDIATE_EXT = operando valore immediato byte = 0xbb -> esteso a word *)
+| MODE_IMM1EXT : HC05_instr_mode
+  (* IMMEDIATE = operando valore immediato word = 0xwwww *)
+| MODE_IMM2 : HC05_instr_mode
+  (* DIRECT = operando offset byte = [0x00bb] *)
+| MODE_DIR1 : HC05_instr_mode
+  (* DIRECT = operando offset word = [0xwwww] *)
+| MODE_DIR2 : HC05_instr_mode
+  (* INDEXED = nessun operando (implicito [X] *)
+| MODE_IX0  : HC05_instr_mode
+  (* INDEXED = operando offset relativo byte = [X+0x00bb] *)
+| MODE_IX1  : HC05_instr_mode
+  (* INDEXED = operando offset relativo word = [X+0xwwww] *)
+| MODE_IX2  : HC05_instr_mode
+
+  (* DIRECT(mTNY) = operando offset byte(maschera scrittura implicita 3 bit) *)
+  (* ex: DIR3 e' carica b, scrivi b con n-simo bit modificato *)
+| MODE_DIRn          : oct → HC05_instr_mode
+  (* DIRECT(mTNY) + IMMEDIATE = operando offset byte(maschera lettura implicita 3 bit) *)
+  (*                            + operando valore immediato byte  *)
+  (* ex: DIR2_and_IMM1 e' carica b, carica imm, restituisci n-simo bit di b + imm *)
+| MODE_DIRn_and_IMM1 : oct → HC05_instr_mode
+.
+
+ndefinition eq_HC05_im ≝
+λi1,i2:HC05_instr_mode.
+ match i1 with
+  [ MODE_INH ⇒ match i2 with [ MODE_INH ⇒ true | _ ⇒ false ]
+  | MODE_INHA ⇒ match i2 with [ MODE_INHA ⇒ true | _ ⇒ false ]
+  | MODE_INHX ⇒ match i2 with [ MODE_INHX ⇒ true | _ ⇒ false ]
+  | MODE_INHX0ADD ⇒ match i2 with [ MODE_INHX0ADD ⇒ true | _ ⇒ false ]
+  | MODE_INHX1ADD ⇒ match i2 with [ MODE_INHX1ADD ⇒ true | _ ⇒ false ]
+  | MODE_INHX2ADD ⇒ match i2 with [ MODE_INHX2ADD ⇒ true | _ ⇒ false ]
+  | MODE_IMM1 ⇒ match i2 with [ MODE_IMM1 ⇒ true | _ ⇒ false ]
+  | MODE_IMM1EXT ⇒ match i2 with [ MODE_IMM1EXT ⇒ true | _ ⇒ false ]
+  | MODE_IMM2 ⇒ match i2 with [ MODE_IMM2 ⇒ true | _ ⇒ false ]
+  | MODE_DIR1 ⇒ match i2 with [ MODE_DIR1 ⇒ true | _ ⇒ false ]
+  | MODE_DIR2 ⇒ match i2 with [ MODE_DIR2 ⇒ true | _ ⇒ false ]
+  | MODE_IX0 ⇒ match i2 with [ MODE_IX0 ⇒ true | _ ⇒ false ]
+  | MODE_IX1 ⇒ match i2 with [ MODE_IX1 ⇒ true | _ ⇒ false ]
+  | MODE_IX2 ⇒ match i2 with [ MODE_IX2 ⇒ true | _ ⇒ false ]
+  | MODE_DIRn n1 ⇒ match i2 with [ MODE_DIRn n2 ⇒ eq_oct n1 n2 | _ ⇒ false ]  
+  | MODE_DIRn_and_IMM1 n1 ⇒ match i2 with [ MODE_DIRn_and_IMM1 n2  ⇒ eq_oct n1 n2 | _ ⇒ false ]
+  ].        
+
+(* iteratore sulle modalita' *)
+ndefinition forall_HC05_im ≝ λP:HC05_instr_mode → bool.
+  P MODE_INH
+⊗ P MODE_INHA
+⊗ P MODE_INHX
+⊗ P MODE_INHX0ADD
+⊗ P MODE_INHX1ADD
+⊗ P MODE_INHX2ADD
+⊗ P MODE_IMM1
+⊗ P MODE_IMM1EXT
+⊗ P MODE_IMM2
+⊗ P MODE_DIR1
+⊗ P MODE_DIR2
+⊗ P MODE_IX0
+⊗ P MODE_IX1
+⊗ P MODE_IX2
+⊗ forall_oct (λo. P (MODE_DIRn o))
+⊗ forall_oct (λo. P (MODE_DIRn_and_IMM1 o)).
+
+(* enumerazione delle istruzioni *)
+ninductive HC05_opcode: Type ≝
+  ADC    : HC05_opcode (* add with carry *)
+| ADD    : HC05_opcode (* add *)
+| AND    : HC05_opcode (* and *)
+| ASL    : HC05_opcode (* aritmetic shift left *)
+| ASR    : HC05_opcode (* aritmetic shift right *)
+| BCC    : HC05_opcode (* branch if C=0 *)
+| BCLRn  : HC05_opcode (* clear bit n *)
+| BCS    : HC05_opcode (* branch if C=1 *)
+| BEQ    : HC05_opcode (* branch if Z=1 *)
+| BHCC   : HC05_opcode (* branch if H=0 *)
+| BHCS   : HC05_opcode (* branch if H=1 *)
+| BHI    : HC05_opcode (* branch if C|Z=0, (higher) *)
+| BIH    : HC05_opcode (* branch if nIRQ=1 *)
+| BIL    : HC05_opcode (* branch if nIRQ=0 *)
+| BIT    : HC05_opcode (* flag = and (bit test) *)
+| BLS    : HC05_opcode (* branch if C|Z=1 (lower or same) *)
+| BMC    : HC05_opcode (* branch if I=0 (interrupt mask clear) *)
+| BMI    : HC05_opcode (* branch if N=1 (minus) *)
+| BMS    : HC05_opcode (* branch if I=1 (interrupt mask set) *)
+| BNE    : HC05_opcode (* branch if Z=0 *)
+| BPL    : HC05_opcode (* branch if N=0 (plus) *)
+| BRA    : HC05_opcode (* branch always *)
+| BRCLRn : HC05_opcode (* branch if bit n clear *)
+| BRN    : HC05_opcode (* branch never (nop) *)
+| BRSETn : HC05_opcode (* branch if bit n set *)
+| BSETn  : HC05_opcode (* set bit n *)
+| BSR    : HC05_opcode (* branch to subroutine *)
+| CLC    : HC05_opcode (* C=0 *)
+| CLI    : HC05_opcode (* I=0 *)
+| CLR    : HC05_opcode (* operand=0 *)
+| CMP    : HC05_opcode (* flag = sub (compare A) *)
+| COM    : HC05_opcode (* not (1 complement) *)
+| CPX    : HC05_opcode (* flag = sub (compare X) *)
+| DEC    : HC05_opcode (* operand=operand-1 (decrement) *)
+| EOR    : HC05_opcode (* xor *)
+| INC    : HC05_opcode (* operand=operand+1 (increment) *)
+| JMP    : HC05_opcode (* jmp word [operand] *)
+| JSR    : HC05_opcode (* jmp to subroutine *)
+| LDA    : HC05_opcode (* load in A *)
+| LDX    : HC05_opcode (* load in X *)
+| LSR    : HC05_opcode (* logical shift right *)
+| MUL    : HC05_opcode (* mul *)
+| NEG    : HC05_opcode (* neg (2 complement) *)
+| NOP    : HC05_opcode (* nop *)
+| ORA    : HC05_opcode (* or *)
+| ROL    : HC05_opcode (* rotate left *)
+| ROR    : HC05_opcode (* rotate right *)
+| RSP    : HC05_opcode (* reset SP (0x00FF) *)
+| RTI    : HC05_opcode (* return from interrupt *)
+| RTS    : HC05_opcode (* return from subroutine *)
+| SBC    : HC05_opcode (* sub with carry*)
+| SEC    : HC05_opcode (* C=1 *)
+| SEI    : HC05_opcode (* I=1 *)
+| STA    : HC05_opcode (* store from A *)
+| STOP   : HC05_opcode (* !!stop mode!! *)
+| STX    : HC05_opcode (* store from X *)
+| SUB    : HC05_opcode (* sub *)
+| SWI    : HC05_opcode (* software interrupt *)
+| TAX    : HC05_opcode (* X=A (transfer A to X) *)
+| TST    : HC05_opcode (* flag = sub (test) *)
+| TXA    : HC05_opcode (* A=X (transfer X to A) *)
+| WAIT   : HC05_opcode (* !!wait mode!! *)
+.
+
+ndefinition eq_HC05_op ≝
+λop1,op2:HC05_opcode.
+ match op1 with
+  [ ADC ⇒ match op2 with [ ADC ⇒ true | _ ⇒ false ]       | ADD ⇒ match op2 with [ ADD ⇒ true | _ ⇒ false ]
+  | AND ⇒ match op2 with [ AND ⇒ true | _ ⇒ false ]       | ASL ⇒ match op2 with [ ASL ⇒ true | _ ⇒ false ]
+  | ASR ⇒ match op2 with [ ASR ⇒ true | _ ⇒ false ]       | BCC ⇒ match op2 with [ BCC ⇒ true | _ ⇒ false ]
+  | BCLRn ⇒ match op2 with [ BCLRn ⇒ true | _ ⇒ false ]   | BCS ⇒ match op2 with [ BCS ⇒ true | _ ⇒ false ]
+  | BEQ ⇒ match op2 with [ BEQ ⇒ true | _ ⇒ false ]       | BHCC ⇒ match op2 with [ BHCC ⇒ true | _ ⇒ false ]
+  | BHCS ⇒ match op2 with [ BHCS ⇒ true | _ ⇒ false ]     | BHI ⇒ match op2 with [ BHI ⇒ true | _ ⇒ false ]
+  | BIH ⇒ match op2 with [ BIH ⇒ true | _ ⇒ false ]       | BIL ⇒ match op2 with [ BIL ⇒ true | _ ⇒ false ]
+  | BIT ⇒ match op2 with [ BIT ⇒ true | _ ⇒ false ]       | BLS ⇒ match op2 with [ BLS ⇒ true | _ ⇒ false ]
+  | BMC ⇒ match op2 with [ BMC ⇒ true | _ ⇒ false ]       | BMI ⇒ match op2 with [ BMI ⇒ true | _ ⇒ false ]
+  | BMS ⇒ match op2 with [ BMS ⇒ true | _ ⇒ false ]       | BNE ⇒ match op2 with [ BNE ⇒ true | _ ⇒ false ]
+  | BPL ⇒ match op2 with [ BPL ⇒ true | _ ⇒ false ]       | BRA ⇒ match op2 with [ BRA ⇒ true | _ ⇒ false ]
+  | BRCLRn ⇒ match op2 with [ BRCLRn ⇒ true | _ ⇒ false ] | BRN ⇒ match op2 with [ BRN ⇒ true | _ ⇒ false ]
+  | BRSETn ⇒ match op2 with [ BRSETn ⇒ true | _ ⇒ false ] | BSETn ⇒ match op2 with [ BSETn ⇒ true | _ ⇒ false ]
+  | BSR ⇒ match op2 with [ BSR ⇒ true | _ ⇒ false ]       | CLC ⇒ match op2 with [ CLC ⇒ true | _ ⇒ false ]
+  | CLI ⇒ match op2 with [ CLI ⇒ true | _ ⇒ false ]       | CLR ⇒ match op2 with [ CLR ⇒ true | _ ⇒ false ]
+  | CMP ⇒ match op2 with [ CMP ⇒ true | _ ⇒ false ]       | COM ⇒ match op2 with [ COM ⇒ true | _ ⇒ false ] 
+  | CPX ⇒ match op2 with [ CPX ⇒ true | _ ⇒ false ]       | DEC ⇒ match op2 with [ DEC ⇒ true | _ ⇒ false ]
+  | EOR ⇒ match op2 with [ EOR ⇒ true | _ ⇒ false ]       | INC ⇒ match op2 with [ INC ⇒ true | _ ⇒ false ]
+  | JMP ⇒ match op2 with [ JMP ⇒ true | _ ⇒ false ]       | JSR ⇒ match op2 with [ JSR ⇒ true | _ ⇒ false ]
+  | LDA ⇒ match op2 with [ LDA ⇒ true | _ ⇒ false ]       | LDX ⇒ match op2 with [ LDX ⇒ true | _ ⇒ false ]
+  | LSR ⇒ match op2 with [ LSR ⇒ true | _ ⇒ false ]       | MUL ⇒ match op2 with [ MUL ⇒ true | _ ⇒ false ]
+  | NEG ⇒ match op2 with [ NEG ⇒ true | _ ⇒ false ]       | NOP ⇒ match op2 with [ NOP ⇒ true | _ ⇒ false ] 
+  | ORA ⇒ match op2 with [ ORA ⇒ true | _ ⇒ false ]       | ROL ⇒ match op2 with [ ROL ⇒ true | _ ⇒ false ]
+  | ROR ⇒ match op2 with [ ROR ⇒ true | _ ⇒ false ]       | RSP ⇒ match op2 with [ RSP ⇒ true | _ ⇒ false ]
+  | RTI ⇒ match op2 with [ RTI ⇒ true | _ ⇒ false ]       | RTS ⇒ match op2 with [ RTS ⇒ true | _ ⇒ false ]
+  | SBC ⇒ match op2 with [ SBC ⇒ true | _ ⇒ false ]       | SEC ⇒ match op2 with [ SEC ⇒ true | _ ⇒ false ]
+  | SEI ⇒ match op2 with [ SEI ⇒ true | _ ⇒ false ]       | STA ⇒ match op2 with [ STA ⇒ true | _ ⇒ false ]
+  | STOP ⇒ match op2 with [ STOP ⇒ true | _ ⇒ false ]     | STX ⇒ match op2 with [ STX ⇒ true | _ ⇒ false ]
+  | SUB ⇒ match op2 with [ SUB ⇒ true | _ ⇒ false ]       | SWI ⇒ match op2 with [ SWI ⇒ true | _ ⇒ false ] 
+  | TAX ⇒ match op2 with [ TAX ⇒ true | _ ⇒ false ]       | TST ⇒ match op2 with [ TST ⇒ true | _ ⇒ false ] 
+  | TXA ⇒ match op2 with [ TXA ⇒ true | _ ⇒ false ]       | WAIT ⇒ match op2 with [ WAIT ⇒ true | _ ⇒ false ]
+  ].
+
+(* iteratore sugli opcode *)
+ndefinition forall_HC05_op ≝ λP:HC05_opcode → bool.
+ P ADC    ⊗ P ADD    ⊗ P AND    ⊗ P ASL    ⊗ P ASR    ⊗ P BCC    ⊗ P BCLRn  ⊗ P BCS    ⊗
+ P BEQ    ⊗ P BHCC   ⊗ P BHCS   ⊗ P BHI    ⊗ P BIH    ⊗ P BIL    ⊗ P BIT    ⊗ P BLS    ⊗
+ P BMC    ⊗ P BMI    ⊗ P BMS    ⊗ P BNE    ⊗ P BPL    ⊗ P BRA    ⊗ P BRCLRn ⊗ P BRN    ⊗
+ P BRSETn ⊗ P BSETn  ⊗ P BSR    ⊗ P CLC    ⊗ P CLI    ⊗ P CLR    ⊗ P CMP    ⊗ P COM    ⊗
+ P CPX    ⊗ P DEC    ⊗ P EOR    ⊗ P INC    ⊗ P JMP    ⊗ P JSR    ⊗ P LDA    ⊗ P LDX    ⊗
+ P LSR    ⊗ P MUL    ⊗ P NEG    ⊗ P NOP    ⊗ P ORA    ⊗ P ROL    ⊗ P ROR    ⊗ P RSP    ⊗
+ P RTI    ⊗ P RTS    ⊗ P SBC    ⊗ P SEC    ⊗ P SEI    ⊗ P STA    ⊗ P STOP   ⊗ P STX    ⊗
+ P SUB    ⊗ P SWI    ⊗ P TAX    ⊗ P TST    ⊗ P TXA    ⊗ P WAIT.
diff --git a/helm/software/matita/contribs/ng_assembly/opcodes/HC05_table.ma b/helm/software/matita/contribs/ng_assembly/opcodes/HC05_table.ma
new file mode 100755 (executable)
index 0000000..0497130
--- /dev/null
@@ -0,0 +1,378 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||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 "opcodes/HC05_opcode_base.ma".
+include "opcodes/byte_or_word.ma".
+include "common/list.ma".
+
+(* ***************** *)
+(* TABELLA DELL'HC05 *)
+(* ***************** *)
+
+(* definizione come concatenazione finale di liste per velocizzare il parsing *)
+(* ogni riga e' (any_opcode m) (instr_mode) (opcode esadecimale) (#cicli esecuzione) *)
+(* NB: l'uso di any_opcode m + concatenazione finale tutte liste
+       impedisce di introdurre opcode disomogenei (per mcu) *)
+
+ndefinition opcode_table_HC05_1 ≝
+[
+  quadruple … ADC MODE_IMM1 (Byte 〈xA,x9〉) 〈x0,x2〉
+; quadruple … ADC MODE_DIR1 (Byte 〈xB,x9〉) 〈x0,x3〉
+; quadruple … ADC MODE_DIR2 (Byte 〈xC,x9〉) 〈x0,x4〉
+; quadruple … ADC MODE_IX2  (Byte 〈xD,x9〉) 〈x0,x5〉
+; quadruple … ADC MODE_IX1  (Byte 〈xE,x9〉) 〈x0,x4〉
+; quadruple … ADC MODE_IX0  (Byte 〈xF,x9〉) 〈x0,x4〉
+].
+
+ndefinition opcode_table_HC05_2 ≝
+[
+  quadruple … ADD MODE_IMM1 (Byte 〈xA,xB〉) 〈x0,x2〉
+; quadruple … ADD MODE_DIR1 (Byte 〈xB,xB〉) 〈x0,x3〉
+; quadruple … ADD MODE_DIR2 (Byte 〈xC,xB〉) 〈x0,x4〉
+; quadruple … ADD MODE_IX2  (Byte 〈xD,xB〉) 〈x0,x5〉
+; quadruple … ADD MODE_IX1  (Byte 〈xE,xB〉) 〈x0,x4〉
+; quadruple … ADD MODE_IX0  (Byte 〈xF,xB〉) 〈x0,x3〉
+].
+
+ndefinition opcode_table_HC05_3 ≝
+[
+  quadruple … AND MODE_IMM1 (Byte 〈xA,x4〉) 〈x0,x2〉
+; quadruple … AND MODE_DIR1 (Byte 〈xB,x4〉) 〈x0,x3〉
+; quadruple … AND MODE_DIR2 (Byte 〈xC,x4〉) 〈x0,x4〉
+; quadruple … AND MODE_IX2  (Byte 〈xD,x4〉) 〈x0,x5〉
+; quadruple … AND MODE_IX1  (Byte 〈xE,x4〉) 〈x0,x4〉
+; quadruple … AND MODE_IX0  (Byte 〈xF,x4〉) 〈x0,x3〉
+].
+
+ndefinition opcode_table_HC05_4 ≝
+[
+  quadruple … ASL MODE_DIR1 (Byte 〈x3,x8〉) 〈x0,x5〉
+; quadruple … ASL MODE_INHA (Byte 〈x4,x8〉) 〈x0,x3〉
+; quadruple … ASL MODE_INHX (Byte 〈x5,x8〉) 〈x0,x3〉
+; quadruple … ASL MODE_IX1  (Byte 〈x6,x8〉) 〈x0,x6〉
+; quadruple … ASL MODE_IX0  (Byte 〈x7,x8〉) 〈x0,x5〉
+].
+
+ndefinition opcode_table_HC05_5 ≝
+[
+  quadruple … ASR MODE_DIR1 (Byte 〈x3,x7〉) 〈x0,x5〉
+; quadruple … ASR MODE_INHA (Byte 〈x4,x7〉) 〈x0,x3〉
+; quadruple … ASR MODE_INHX (Byte 〈x5,x7〉) 〈x0,x3〉
+; quadruple … ASR MODE_IX1  (Byte 〈x6,x7〉) 〈x0,x6〉
+; quadruple … ASR MODE_IX0  (Byte 〈x7,x7〉) 〈x0,x5〉
+].
+
+ndefinition opcode_table_HC05_6 ≝
+[
+  quadruple … BRA  MODE_IMM1 (Byte 〈x2,x0〉) 〈x0,x3〉
+; quadruple … BRN  MODE_IMM1 (Byte 〈x2,x1〉) 〈x0,x3〉
+; quadruple … BHI  MODE_IMM1 (Byte 〈x2,x2〉) 〈x0,x3〉
+; quadruple … BLS  MODE_IMM1 (Byte 〈x2,x3〉) 〈x0,x3〉
+; quadruple … BCC  MODE_IMM1 (Byte 〈x2,x4〉) 〈x0,x3〉
+; quadruple … BCS  MODE_IMM1 (Byte 〈x2,x5〉) 〈x0,x3〉
+; quadruple … BNE  MODE_IMM1 (Byte 〈x2,x6〉) 〈x0,x3〉
+; quadruple … BEQ  MODE_IMM1 (Byte 〈x2,x7〉) 〈x0,x3〉
+; quadruple … BHCC MODE_IMM1 (Byte 〈x2,x8〉) 〈x0,x3〉
+; quadruple … BHCS MODE_IMM1 (Byte 〈x2,x9〉) 〈x0,x3〉
+; quadruple … BPL  MODE_IMM1 (Byte 〈x2,xA〉) 〈x0,x3〉
+; quadruple … BMI  MODE_IMM1 (Byte 〈x2,xB〉) 〈x0,x3〉
+; quadruple … BMC  MODE_IMM1 (Byte 〈x2,xC〉) 〈x0,x3〉
+; quadruple … BMS  MODE_IMM1 (Byte 〈x2,xD〉) 〈x0,x3〉
+; quadruple … BIL  MODE_IMM1 (Byte 〈x2,xE〉) 〈x0,x3〉
+; quadruple … BIH  MODE_IMM1 (Byte 〈x2,xF〉) 〈x0,x3〉
+].
+
+ndefinition opcode_table_HC05_7 ≝
+[
+  quadruple … BSETn (MODE_DIRn o0) (Byte 〈x1,x0〉) 〈x0,x5〉
+; quadruple … BCLRn (MODE_DIRn o0) (Byte 〈x1,x1〉) 〈x0,x5〉
+; quadruple … BSETn (MODE_DIRn o1) (Byte 〈x1,x2〉) 〈x0,x5〉
+; quadruple … BCLRn (MODE_DIRn o1) (Byte 〈x1,x3〉) 〈x0,x5〉
+; quadruple … BSETn (MODE_DIRn o2) (Byte 〈x1,x4〉) 〈x0,x5〉
+; quadruple … BCLRn (MODE_DIRn o2) (Byte 〈x1,x5〉) 〈x0,x5〉
+; quadruple … BSETn (MODE_DIRn o3) (Byte 〈x1,x6〉) 〈x0,x5〉
+; quadruple … BCLRn (MODE_DIRn o3) (Byte 〈x1,x7〉) 〈x0,x5〉
+; quadruple … BSETn (MODE_DIRn o4) (Byte 〈x1,x8〉) 〈x0,x5〉
+; quadruple … BCLRn (MODE_DIRn o4) (Byte 〈x1,x9〉) 〈x0,x5〉
+; quadruple … BSETn (MODE_DIRn o5) (Byte 〈x1,xA〉) 〈x0,x5〉
+; quadruple … BCLRn (MODE_DIRn o5) (Byte 〈x1,xB〉) 〈x0,x5〉
+; quadruple … BSETn (MODE_DIRn o6) (Byte 〈x1,xC〉) 〈x0,x5〉
+; quadruple … BCLRn (MODE_DIRn o6) (Byte 〈x1,xD〉) 〈x0,x5〉
+; quadruple … BSETn (MODE_DIRn o7) (Byte 〈x1,xE〉) 〈x0,x5〉
+; quadruple … BCLRn (MODE_DIRn o7) (Byte 〈x1,xF〉) 〈x0,x5〉
+].
+
+ndefinition opcode_table_HC05_8 ≝
+[
+  quadruple … BRSETn (MODE_DIRn_and_IMM1 o0) (Byte 〈x0,x0〉) 〈x0,x5〉
+; quadruple … BRCLRn (MODE_DIRn_and_IMM1 o0) (Byte 〈x0,x1〉) 〈x0,x5〉
+; quadruple … BRSETn (MODE_DIRn_and_IMM1 o1) (Byte 〈x0,x2〉) 〈x0,x5〉
+; quadruple … BRCLRn (MODE_DIRn_and_IMM1 o1) (Byte 〈x0,x3〉) 〈x0,x5〉
+; quadruple … BRSETn (MODE_DIRn_and_IMM1 o2) (Byte 〈x0,x4〉) 〈x0,x5〉
+; quadruple … BRCLRn (MODE_DIRn_and_IMM1 o2) (Byte 〈x0,x5〉) 〈x0,x5〉
+; quadruple … BRSETn (MODE_DIRn_and_IMM1 o3) (Byte 〈x0,x6〉) 〈x0,x5〉
+; quadruple … BRCLRn (MODE_DIRn_and_IMM1 o3) (Byte 〈x0,x7〉) 〈x0,x5〉
+; quadruple … BRSETn (MODE_DIRn_and_IMM1 o4) (Byte 〈x0,x8〉) 〈x0,x5〉
+; quadruple … BRCLRn (MODE_DIRn_and_IMM1 o4) (Byte 〈x0,x9〉) 〈x0,x5〉
+; quadruple … BRSETn (MODE_DIRn_and_IMM1 o5) (Byte 〈x0,xA〉) 〈x0,x5〉
+; quadruple … BRCLRn (MODE_DIRn_and_IMM1 o5) (Byte 〈x0,xB〉) 〈x0,x5〉
+; quadruple … BRSETn (MODE_DIRn_and_IMM1 o6) (Byte 〈x0,xC〉) 〈x0,x5〉
+; quadruple … BRCLRn (MODE_DIRn_and_IMM1 o6) (Byte 〈x0,xD〉) 〈x0,x5〉
+; quadruple … BRSETn (MODE_DIRn_and_IMM1 o7) (Byte 〈x0,xE〉) 〈x0,x5〉
+; quadruple … BRCLRn (MODE_DIRn_and_IMM1 o7) (Byte 〈x0,xF〉) 〈x0,x5〉
+].
+
+ndefinition opcode_table_HC05_9 ≝
+[
+  quadruple … BIT MODE_IMM1 (Byte 〈xA,x5〉) 〈x0,x2〉
+; quadruple … BIT MODE_DIR1 (Byte 〈xB,x5〉) 〈x0,x3〉
+; quadruple … BIT MODE_DIR2 (Byte 〈xC,x5〉) 〈x0,x4〉
+; quadruple … BIT MODE_IX2  (Byte 〈xD,x5〉) 〈x0,x5〉
+; quadruple … BIT MODE_IX1  (Byte 〈xE,x5〉) 〈x0,x4〉
+; quadruple … BIT MODE_IX0  (Byte 〈xF,x5〉) 〈x0,x3〉
+].
+
+ndefinition opcode_table_HC05_10 ≝
+[
+  quadruple … MUL  MODE_INH (Byte 〈x4,x2〉) 〈x0,xB〉
+; quadruple … RTI  MODE_INH (Byte 〈x8,x0〉) 〈x0,x9〉
+; quadruple … RTS  MODE_INH (Byte 〈x8,x1〉) 〈x0,x6〉
+; quadruple … SWI  MODE_INH (Byte 〈x8,x3〉) 〈x0,xA〉
+; quadruple … STOP MODE_INH (Byte 〈x8,xE〉) 〈x0,x2〉
+; quadruple … WAIT MODE_INH (Byte 〈x8,xF〉) 〈x0,x2〉
+; quadruple … TAX  MODE_INH (Byte 〈x9,x7〉) 〈x0,x2〉
+; quadruple … CLC  MODE_INH (Byte 〈x9,x8〉) 〈x0,x2〉
+; quadruple … SEC  MODE_INH (Byte 〈x9,x9〉) 〈x0,x2〉
+; quadruple … CLI  MODE_INH (Byte 〈x9,xA〉) 〈x0,x2〉
+; quadruple … SEI  MODE_INH (Byte 〈x9,xB〉) 〈x0,x2〉
+; quadruple … RSP  MODE_INH (Byte 〈x9,xC〉) 〈x0,x2〉
+; quadruple … NOP  MODE_INH (Byte 〈x9,xD〉) 〈x0,x2〉
+; quadruple … TXA  MODE_INH (Byte 〈x9,xF〉) 〈x0,x2〉
+].
+
+ndefinition opcode_table_HC05_11 ≝
+[
+  quadruple … CLR MODE_DIR1 (Byte 〈x3,xF〉) 〈x0,x5〉
+; quadruple … CLR MODE_INHA (Byte 〈x4,xF〉) 〈x0,x3〉
+; quadruple … CLR MODE_INHX (Byte 〈x5,xF〉) 〈x0,x3〉
+; quadruple … CLR MODE_IX1  (Byte 〈x6,xF〉) 〈x0,x6〉
+; quadruple … CLR MODE_IX0  (Byte 〈x7,xF〉) 〈x0,x5〉
+].
+
+ndefinition opcode_table_HC05_12 ≝
+[
+  quadruple … CMP MODE_IMM1 (Byte 〈xA,x1〉) 〈x0,x2〉
+; quadruple … CMP MODE_DIR1 (Byte 〈xB,x1〉) 〈x0,x3〉
+; quadruple … CMP MODE_DIR2 (Byte 〈xC,x1〉) 〈x0,x4〉
+; quadruple … CMP MODE_IX2  (Byte 〈xD,x1〉) 〈x0,x5〉
+; quadruple … CMP MODE_IX1  (Byte 〈xE,x1〉) 〈x0,x4〉
+; quadruple … CMP MODE_IX0  (Byte 〈xF,x1〉) 〈x0,x3〉
+].
+
+ndefinition opcode_table_HC05_13 ≝
+[
+  quadruple … COM MODE_DIR1 (Byte 〈x3,x3〉) 〈x0,x5〉
+; quadruple … COM MODE_INHA (Byte 〈x4,x3〉) 〈x0,x3〉
+; quadruple … COM MODE_INHX (Byte 〈x5,x3〉) 〈x0,x3〉
+; quadruple … COM MODE_IX1  (Byte 〈x6,x3〉) 〈x0,x6〉
+; quadruple … COM MODE_IX0  (Byte 〈x7,x3〉) 〈x0,x5〉
+].
+
+ndefinition opcode_table_HC05_14 ≝
+[
+  quadruple … CPX MODE_IMM1 (Byte 〈xA,x3〉) 〈x0,x2〉
+; quadruple … CPX MODE_DIR1 (Byte 〈xB,x3〉) 〈x0,x3〉
+; quadruple … CPX MODE_DIR2 (Byte 〈xC,x3〉) 〈x0,x4〉
+; quadruple … CPX MODE_IX2  (Byte 〈xD,x3〉) 〈x0,x5〉
+; quadruple … CPX MODE_IX1  (Byte 〈xE,x3〉) 〈x0,x4〉
+; quadruple … CPX MODE_IX0  (Byte 〈xF,x3〉) 〈x0,x3〉
+].
+
+ndefinition opcode_table_HC05_15 ≝
+[
+  quadruple … DEC MODE_DIR1 (Byte 〈x3,xA〉) 〈x0,x5〉
+; quadruple … DEC MODE_INHA (Byte 〈x4,xA〉) 〈x0,x3〉
+; quadruple … DEC MODE_INHX (Byte 〈x5,xA〉) 〈x0,x3〉
+; quadruple … DEC MODE_IX1  (Byte 〈x6,xA〉) 〈x0,x6〉
+; quadruple … DEC MODE_IX0  (Byte 〈x7,xA〉) 〈x0,x5〉
+].
+
+ndefinition opcode_table_HC05_16 ≝
+[
+  quadruple … EOR MODE_IMM1 (Byte 〈xA,x8〉) 〈x0,x2〉
+; quadruple … EOR MODE_DIR1 (Byte 〈xB,x8〉) 〈x0,x3〉
+; quadruple … EOR MODE_DIR2 (Byte 〈xC,x8〉) 〈x0,x4〉
+; quadruple … EOR MODE_IX2  (Byte 〈xD,x8〉) 〈x0,x5〉
+; quadruple … EOR MODE_IX1  (Byte 〈xE,x8〉) 〈x0,x4〉
+; quadruple … EOR MODE_IX0  (Byte 〈xF,x8〉) 〈x0,x3〉
+].
+
+ndefinition opcode_table_HC05_17 ≝
+[
+  quadruple … INC MODE_DIR1 (Byte 〈x3,xC〉) 〈x0,x5〉
+; quadruple … INC MODE_INHA (Byte 〈x4,xC〉) 〈x0,x3〉
+; quadruple … INC MODE_INHX (Byte 〈x5,xC〉) 〈x0,x3〉
+; quadruple … INC MODE_IX1  (Byte 〈x6,xC〉) 〈x0,x6〉
+; quadruple … INC MODE_IX0  (Byte 〈x7,xC〉) 〈x0,x5〉
+].
+
+ndefinition opcode_table_HC05_18 ≝
+[
+  quadruple … JMP MODE_IMM1EXT  (Byte 〈xB,xC〉) 〈x0,x2〉
+; quadruple … JMP MODE_IMM2     (Byte 〈xC,xC〉) 〈x0,x3〉
+; quadruple … JMP MODE_INHX2ADD (Byte 〈xD,xC〉) 〈x0,x4〉
+; quadruple … JMP MODE_INHX1ADD (Byte 〈xE,xC〉) 〈x0,x3〉
+; quadruple … JMP MODE_INHX0ADD (Byte 〈xF,xC〉) 〈x0,x2〉
+].
+
+ndefinition opcode_table_HC05_19 ≝
+[
+  quadruple … BSR MODE_IMM1     (Byte 〈xA,xD〉) 〈x0,x6〉
+; quadruple … JSR MODE_IMM1EXT  (Byte 〈xB,xD〉) 〈x0,x5〉
+; quadruple … JSR MODE_IMM2     (Byte 〈xC,xD〉) 〈x0,x6〉
+; quadruple … JSR MODE_INHX2ADD (Byte 〈xD,xD〉) 〈x0,x7〉
+; quadruple … JSR MODE_INHX1ADD (Byte 〈xE,xD〉) 〈x0,x6〉
+; quadruple … JSR MODE_INHX0ADD (Byte 〈xF,xD〉) 〈x0,x5〉
+].
+
+ndefinition opcode_table_HC05_20 ≝
+[
+  quadruple … LDA MODE_IMM1 (Byte 〈xA,x6〉) 〈x0,x2〉
+; quadruple … LDA MODE_DIR1 (Byte 〈xB,x6〉) 〈x0,x3〉
+; quadruple … LDA MODE_DIR2 (Byte 〈xC,x6〉) 〈x0,x4〉
+; quadruple … LDA MODE_IX2  (Byte 〈xD,x6〉) 〈x0,x5〉
+; quadruple … LDA MODE_IX1  (Byte 〈xE,x6〉) 〈x0,x4〉
+; quadruple … LDA MODE_IX0  (Byte 〈xF,x6〉) 〈x0,x3〉
+].
+
+ndefinition opcode_table_HC05_21 ≝
+[
+  quadruple … LDX MODE_IMM1 (Byte 〈xA,xE〉) 〈x0,x2〉
+; quadruple … LDX MODE_DIR1 (Byte 〈xB,xE〉) 〈x0,x3〉
+; quadruple … LDX MODE_DIR2 (Byte 〈xC,xE〉) 〈x0,x4〉
+; quadruple … LDX MODE_IX2  (Byte 〈xD,xE〉) 〈x0,x5〉
+; quadruple … LDX MODE_IX1  (Byte 〈xE,xE〉) 〈x0,x4〉
+; quadruple … LDX MODE_IX0  (Byte 〈xF,xE〉) 〈x0,x3〉
+].
+
+ndefinition opcode_table_HC05_22 ≝
+[
+  quadruple … LSR MODE_DIR1 (Byte 〈x3,x4〉) 〈x0,x5〉
+; quadruple … LSR MODE_INHA (Byte 〈x4,x4〉) 〈x0,x3〉
+; quadruple … LSR MODE_INHX (Byte 〈x5,x4〉) 〈x0,x3〉
+; quadruple … LSR MODE_IX1  (Byte 〈x6,x4〉) 〈x0,x6〉
+; quadruple … LSR MODE_IX0  (Byte 〈x7,x4〉) 〈x0,x5〉
+].
+
+ndefinition opcode_table_HC05_23 ≝
+[
+  quadruple … NEG MODE_DIR1 (Byte 〈x3,x0〉) 〈x0,x5〉
+; quadruple … NEG MODE_INHA (Byte 〈x4,x0〉) 〈x0,x3〉
+; quadruple … NEG MODE_INHX (Byte 〈x5,x0〉) 〈x0,x3〉
+; quadruple … NEG MODE_IX1  (Byte 〈x6,x0〉) 〈x0,x6〉
+; quadruple … NEG MODE_IX0  (Byte 〈x7,x0〉) 〈x0,x5〉
+].
+
+ndefinition opcode_table_HC05_24 ≝
+[
+  quadruple … ORA MODE_IMM1 (Byte 〈xA,xA〉) 〈x0,x2〉
+; quadruple … ORA MODE_DIR1 (Byte 〈xB,xA〉) 〈x0,x3〉
+; quadruple … ORA MODE_DIR2 (Byte 〈xC,xA〉) 〈x0,x4〉
+; quadruple … ORA MODE_IX2  (Byte 〈xD,xA〉) 〈x0,x5〉
+; quadruple … ORA MODE_IX1  (Byte 〈xE,xA〉) 〈x0,x4〉
+; quadruple … ORA MODE_IX0  (Byte 〈xF,xA〉) 〈x0,x3〉
+].
+
+ndefinition opcode_table_HC05_25 ≝
+[
+  quadruple … ROL MODE_DIR1 (Byte 〈x3,x9〉) 〈x0,x5〉
+; quadruple … ROL MODE_INHA (Byte 〈x4,x9〉) 〈x0,x3〉
+; quadruple … ROL MODE_INHX (Byte 〈x5,x9〉) 〈x0,x3〉
+; quadruple … ROL MODE_IX1  (Byte 〈x6,x9〉) 〈x0,x6〉
+; quadruple … ROL MODE_IX0  (Byte 〈x7,x9〉) 〈x0,x5〉
+].
+
+ndefinition opcode_table_HC05_26 ≝
+[
+  quadruple … ROR MODE_DIR1 (Byte 〈x3,x6〉) 〈x0,x5〉
+; quadruple … ROR MODE_INHA (Byte 〈x4,x6〉) 〈x0,x3〉
+; quadruple … ROR MODE_INHX (Byte 〈x5,x6〉) 〈x0,x3〉
+; quadruple … ROR MODE_IX1  (Byte 〈x6,x6〉) 〈x0,x6〉
+; quadruple … ROR MODE_IX0  (Byte 〈x7,x6〉) 〈x0,x5〉
+].
+
+ndefinition opcode_table_HC05_27 ≝
+[
+  quadruple … SBC MODE_IMM1 (Byte 〈xA,x2〉) 〈x0,x2〉
+; quadruple … SBC MODE_DIR1 (Byte 〈xB,x2〉) 〈x0,x3〉
+; quadruple … SBC MODE_DIR2 (Byte 〈xC,x2〉) 〈x0,x4〉
+; quadruple … SBC MODE_IX2  (Byte 〈xD,x2〉) 〈x0,x5〉
+; quadruple … SBC MODE_IX1  (Byte 〈xE,x2〉) 〈x0,x4〉
+; quadruple … SBC MODE_IX0  (Byte 〈xF,x2〉) 〈x0,x3〉
+].
+
+ndefinition opcode_table_HC05_28 ≝
+[
+  quadruple … STA MODE_DIR1 (Byte 〈xB,x7〉) 〈x0,x4〉
+; quadruple … STA MODE_DIR2 (Byte 〈xC,x7〉) 〈x0,x5〉
+; quadruple … STA MODE_IX2  (Byte 〈xD,x7〉) 〈x0,x6〉
+; quadruple … STA MODE_IX1  (Byte 〈xE,x7〉) 〈x0,x5〉
+; quadruple … STA MODE_IX0  (Byte 〈xF,x7〉) 〈x0,x4〉
+].
+
+ndefinition opcode_table_HC05_29 ≝
+[
+  quadruple … STX MODE_DIR1 (Byte 〈xB,xF〉) 〈x0,x4〉
+; quadruple … STX MODE_DIR2 (Byte 〈xC,xF〉) 〈x0,x5〉
+; quadruple … STX MODE_IX2  (Byte 〈xD,xF〉) 〈x0,x6〉
+; quadruple … STX MODE_IX1  (Byte 〈xE,xF〉) 〈x0,x5〉
+; quadruple … STX MODE_IX0  (Byte 〈xF,xF〉) 〈x0,x4〉
+].
+
+ndefinition opcode_table_HC05_30 ≝
+[
+  quadruple … SUB MODE_IMM1 (Byte 〈xA,x0〉) 〈x0,x2〉
+; quadruple … SUB MODE_DIR1 (Byte 〈xB,x0〉) 〈x0,x3〉
+; quadruple … SUB MODE_DIR2 (Byte 〈xC,x0〉) 〈x0,x4〉
+; quadruple … SUB MODE_IX2  (Byte 〈xD,x0〉) 〈x0,x5〉
+; quadruple … SUB MODE_IX1  (Byte 〈xE,x0〉) 〈x0,x4〉
+; quadruple … SUB MODE_IX0  (Byte 〈xF,x0〉) 〈x0,x3〉
+].
+
+ndefinition opcode_table_HC05_31 ≝
+[
+  quadruple … TST MODE_DIR1 (Byte 〈x3,xD〉) 〈x0,x4〉
+; quadruple … TST MODE_INHA (Byte 〈x4,xD〉) 〈x0,x3〉
+; quadruple … TST MODE_INHX (Byte 〈x5,xD〉) 〈x0,x3〉
+; quadruple … TST MODE_IX1  (Byte 〈x6,xD〉) 〈x0,x5〉
+; quadruple … TST MODE_IX0  (Byte 〈x7,xD〉) 〈x0,x4〉
+].
+
+ndefinition opcode_table_HC05 ≝
+ opcode_table_HC05_1  @ opcode_table_HC05_2  @ opcode_table_HC05_3  @ opcode_table_HC05_4  @
+ opcode_table_HC05_5  @ opcode_table_HC05_6  @ opcode_table_HC05_7  @ opcode_table_HC05_8  @
+ opcode_table_HC05_9  @ opcode_table_HC05_10 @ opcode_table_HC05_11 @ opcode_table_HC05_12 @
+ opcode_table_HC05_13 @ opcode_table_HC05_14 @ opcode_table_HC05_15 @ opcode_table_HC05_16 @
+ opcode_table_HC05_17 @ opcode_table_HC05_18 @ opcode_table_HC05_19 @ opcode_table_HC05_20 @
+ opcode_table_HC05_21 @ opcode_table_HC05_22 @ opcode_table_HC05_23 @ opcode_table_HC05_24 @
+ opcode_table_HC05_25 @ opcode_table_HC05_26 @ opcode_table_HC05_27 @ opcode_table_HC05_28 @
+ opcode_table_HC05_29 @ opcode_table_HC05_30 @ opcode_table_HC05_31.
diff --git a/helm/software/matita/contribs/ng_assembly/opcodes/HC05_table_tests.ma b/helm/software/matita/contribs/ng_assembly/opcodes/HC05_table_tests.ma
new file mode 100755 (executable)
index 0000000..4168e01
--- /dev/null
@@ -0,0 +1,69 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||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 "opcodes/opcode.ma".
+
+(* ***************** *)
+(* TABELLA DELL'HC05 *)
+(* ***************** *)
+
+(* HC05: opcode non implementati come da manuale *)
+ndefinition HC05_not_impl_byte ≝
+ [〈x3,x1〉;〈x3,x2〉;〈x3,x5〉;〈x3,xB〉;〈x3,xE〉
+ ;〈x4,x1〉;〈x4,x5〉;〈x4,xB〉;〈x4,xE〉
+ ;〈x5,x1〉;〈x5,x2〉;〈x5,x5〉;〈x5,xB〉;〈x5,xE〉
+ ;〈x6,x1〉;〈x6,x2〉;〈x6,x5〉;〈x6,xB〉;〈x6,xE〉
+ ;〈x7,x1〉;〈x7,x2〉;〈x7,x5〉;〈x7,xB〉;〈x7,xE〉
+ ;〈x8,x2〉;〈x8,x4〉;〈x8,x5〉;〈x8,x6〉;〈x8,x7〉;〈x8,x8〉;〈x8,x9〉;〈x8,xA〉;〈x8,xB〉;〈x8,xC〉;〈x8,xD〉
+ ;〈x9,x0〉;〈x9,x1〉;〈x9,x2〉;〈x9,x3〉;〈x9,x4〉;〈x9,x5〉;〈x9,x6〉;〈x9,xE〉
+ ;〈xA,x7〉;〈xA,xC〉;〈xA,xF〉
+ ].
+
+(* test bytecode non implementati *)
+nlemma ok_byte_table_HC05 : forall_b8 (λb.
+ (test_not_impl_byte b HC05_not_impl_byte     ⊙ eq_w16 (get_byte_count HC05 b 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_HC05) 〈〈x0,x0〉:〈x0,x1〉〉) ⊗
+ (⊖ (test_not_impl_byte b HC05_not_impl_byte) ⊙ eq_w16 (get_byte_count HC05 b 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_HC05) 〈〈x0,x0〉:〈x0,x0〉〉))
+ = true.
+ napply refl_eq.
+nqed.
+
+(* tutti op implementati *)
+nlemma ok_pseudo_table_HC05 :
+ forall_op HC05 (λo.
+  le_w16 〈〈x0,x0〉:〈x0,x1〉〉 (get_pseudo_count HC05 o 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_HC05)) = true.
+ napply refl_eq.
+nqed.
+
+(* tutte im implementate *)
+nlemma ok_mode_table_HC05 :
+ forall_im HC05 (λi.
+  le_w16 〈〈x0,x0〉:〈x0,x1〉〉 (get_mode_count HC05 i 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_HC05)) = true.
+ napply refl_eq.
+nqed.
+
+(* nessuna ripetizione di combinazione op + imm *)
+nlemma ok_OpIm_table_HC05 :
+ forall_im HC05 (λi.
+  forall_op HC05 (λo.
+   le_w16 (get_OpIm_count HC05 o i 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_HC05) 〈〈x0,x0〉:〈x0,x1〉〉)) = true.
+ napply refl_eq.
+nqed.
diff --git a/helm/software/matita/contribs/ng_assembly/opcodes/HC08_opcode_base.ma b/helm/software/matita/contribs/ng_assembly/opcodes/HC08_opcode_base.ma
new file mode 100755 (executable)
index 0000000..525b48c
--- /dev/null
@@ -0,0 +1,330 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||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".
+
+(* ********************************************** *)
+(* MATTONI BASE PER DEFINIRE LE TABELLE DELLE MCU *)
+(* ********************************************** *)
+
+(* enumerazione delle modalita' di indirizzamento = caricamento degli operandi *)
+ninductive HC08_instr_mode: Type ≝
+  (* INHERENT = nessun operando *)
+  MODE_INH  : HC08_instr_mode
+  (* INHERENT = nessun operando (A implicito) *)
+| MODE_INHA : HC08_instr_mode
+  (* INHERENT = nessun operando (X implicito) *)
+| MODE_INHX : HC08_instr_mode
+  (* INHERENT = nessun operando (H implicito) *)
+| MODE_INHH : HC08_instr_mode
+
+  (* INHERENT_ADDRESS = nessun operando (HX implicito) *)
+| MODE_INHX0ADD : HC08_instr_mode
+  (* INHERENT_ADDRESS = nessun operando (HX implicito+0x00bb) *)
+| MODE_INHX1ADD : HC08_instr_mode
+  (* INHERENT_ADDRESS = nessun operando (HX implicito+0xwwww) *)
+| MODE_INHX2ADD : HC08_instr_mode
+
+  (* IMMEDIATE = operando valore immediato byte = 0xbb *)
+| MODE_IMM1 : HC08_instr_mode
+  (* IMMEDIATE_EXT = operando valore immediato byte = 0xbb -> esteso a word *)
+| MODE_IMM1EXT : HC08_instr_mode
+  (* IMMEDIATE = operando valore immediato word = 0xwwww *)
+| MODE_IMM2 : HC08_instr_mode
+  (* DIRECT = operando offset byte = [0x00bb] *)
+| MODE_DIR1 : HC08_instr_mode
+  (* DIRECT = operando offset word = [0xwwww] *)
+| MODE_DIR2 : HC08_instr_mode
+  (* INDEXED = nessun operando (implicito [X] *)
+| MODE_IX0  : HC08_instr_mode
+  (* INDEXED = operando offset relativo byte = [X+0x00bb] *)
+| MODE_IX1  : HC08_instr_mode
+  (* INDEXED = operando offset relativo word = [X+0xwwww] *)
+| MODE_IX2  : HC08_instr_mode
+  (* INDEXED = operando offset relativo byte = [SP+0x00bb] *)
+| MODE_SP1  : HC08_instr_mode
+  (* INDEXED = operando offset relativo word = [SP+0xwwww] *)
+| MODE_SP2  : HC08_instr_mode
+
+  (* DIRECT → DIRECT = carica da diretto/scrive su diretto *)
+| MODE_DIR1_to_DIR1 : HC08_instr_mode
+  (* IMMEDIATE → DIRECT = carica da immediato/scrive su diretto *)
+| MODE_IMM1_to_DIR1 : HC08_instr_mode
+  (* INDEXED++ → DIRECT = carica da [X]/scrive su diretto/H:X++ *)
+| MODE_IX0p_to_DIR1 : HC08_instr_mode
+  (* DIRECT → INDEXED++ = carica da diretto/scrive su [X]/H:X++ *)
+| MODE_DIR1_to_IX0p : HC08_instr_mode
+
+  (* INHERENT(A) + IMMEDIATE *)
+| MODE_INHA_and_IMM1 : HC08_instr_mode
+  (* INHERENT(X) + IMMEDIATE *)
+| MODE_INHX_and_IMM1 : HC08_instr_mode
+  (* IMMEDIATE + IMMEDIATE *)
+| MODE_IMM1_and_IMM1 : HC08_instr_mode
+  (* DIRECT + IMMEDIATE *)
+| MODE_DIR1_and_IMM1 : HC08_instr_mode
+  (* INDEXED + IMMEDIATE *)
+| MODE_IX0_and_IMM1  : HC08_instr_mode
+  (* INDEXED++ + IMMEDIATE *)
+| MODE_IX0p_and_IMM1 : HC08_instr_mode
+  (* INDEXED + IMMEDIATE *)
+| MODE_IX1_and_IMM1  : HC08_instr_mode
+  (* INDEXED++ + IMMEDIATE *)
+| MODE_IX1p_and_IMM1 : HC08_instr_mode
+  (* INDEXED + IMMEDIATE *)
+| MODE_SP1_and_IMM1  : HC08_instr_mode
+
+  (* DIRECT(mTNY) = operando offset byte(maschera scrittura implicita 3 bit) *)
+  (* ex: DIR3 e' carica b, scrivi b con n-simo bit modificato *)
+| MODE_DIRn          : oct → HC08_instr_mode
+  (* DIRECT(mTNY) + IMMEDIATE = operando offset byte(maschera lettura implicita 3 bit) *)
+  (*                            + operando valore immediato byte  *)
+  (* ex: DIR2_and_IMM1 e' carica b, carica imm, restituisci n-simo bit di b + imm *)
+| MODE_DIRn_and_IMM1 : oct → HC08_instr_mode
+.
+
+ndefinition eq_HC08_im ≝
+λi1,i2:HC08_instr_mode.
+ match i1 with
+  [ MODE_INH ⇒ match i2 with [ MODE_INH ⇒ true | _ ⇒ false ]
+  | MODE_INHA ⇒ match i2 with [ MODE_INHA ⇒ true | _ ⇒ false ]
+  | MODE_INHX ⇒ match i2 with [ MODE_INHX ⇒ true | _ ⇒ false ]
+  | MODE_INHH ⇒ match i2 with [ MODE_INHH ⇒ true | _ ⇒ false ]
+  | MODE_INHX0ADD ⇒ match i2 with [ MODE_INHX0ADD ⇒ true | _ ⇒ false ]
+  | MODE_INHX1ADD ⇒ match i2 with [ MODE_INHX1ADD ⇒ true | _ ⇒ false ]
+  | MODE_INHX2ADD ⇒ match i2 with [ MODE_INHX2ADD ⇒ true | _ ⇒ false ]
+  | MODE_IMM1 ⇒ match i2 with [ MODE_IMM1 ⇒ true | _ ⇒ false ]
+  | MODE_IMM1EXT ⇒ match i2 with [ MODE_IMM1EXT ⇒ true | _ ⇒ false ]
+  | MODE_IMM2 ⇒ match i2 with [ MODE_IMM2 ⇒ true | _ ⇒ false ]
+  | MODE_DIR1 ⇒ match i2 with [ MODE_DIR1 ⇒ true | _ ⇒ false ]
+  | MODE_DIR2 ⇒ match i2 with [ MODE_DIR2 ⇒ true | _ ⇒ false ]
+  | MODE_IX0 ⇒ match i2 with [ MODE_IX0 ⇒ true | _ ⇒ false ]
+  | MODE_IX1 ⇒ match i2 with [ MODE_IX1 ⇒ true | _ ⇒ false ]
+  | MODE_IX2 ⇒ match i2 with [ MODE_IX2 ⇒ true | _ ⇒ false ]
+  | MODE_SP1 ⇒ match i2 with [ MODE_SP1 ⇒ true | _ ⇒ false ]
+  | MODE_SP2 ⇒ match i2 with [ MODE_SP2 ⇒ true | _ ⇒ false ]  
+  | MODE_DIR1_to_DIR1 ⇒ match i2 with [ MODE_DIR1_to_DIR1 ⇒ true | _ ⇒ false ]
+  | MODE_IMM1_to_DIR1 ⇒ match i2 with [ MODE_IMM1_to_DIR1 ⇒ true | _ ⇒ false ]
+  | MODE_IX0p_to_DIR1 ⇒ match i2 with [ MODE_IX0p_to_DIR1 ⇒ true | _ ⇒ false ]
+  | MODE_DIR1_to_IX0p ⇒ match i2 with [ MODE_DIR1_to_IX0p ⇒ true | _ ⇒ false ]
+  | MODE_INHA_and_IMM1 ⇒ match i2 with [ MODE_INHA_and_IMM1 ⇒ true | _ ⇒ false ]
+  | MODE_INHX_and_IMM1 ⇒ match i2 with [ MODE_INHX_and_IMM1 ⇒ true | _ ⇒ false ]
+  | MODE_IMM1_and_IMM1 ⇒ match i2 with [ MODE_IMM1_and_IMM1 ⇒ true | _ ⇒ false ]  
+  | MODE_DIR1_and_IMM1 ⇒ match i2 with [ MODE_DIR1_and_IMM1 ⇒ true | _ ⇒ false ]  
+  | MODE_IX0_and_IMM1 ⇒ match i2 with [ MODE_IX0_and_IMM1 ⇒ true | _ ⇒ false ]  
+  | MODE_IX0p_and_IMM1 ⇒ match i2 with [ MODE_IX0p_and_IMM1 ⇒ true | _ ⇒ false ]  
+  | MODE_IX1_and_IMM1 ⇒ match i2 with [ MODE_IX1_and_IMM1 ⇒ true | _ ⇒ false ]  
+  | MODE_IX1p_and_IMM1 ⇒ match i2 with [ MODE_IX1p_and_IMM1 ⇒ true | _ ⇒ false ]
+  | MODE_SP1_and_IMM1 ⇒ match i2 with [ MODE_SP1_and_IMM1 ⇒ true | _ ⇒ false ]
+  | MODE_DIRn n1 ⇒ match i2 with [ MODE_DIRn n2 ⇒ eq_oct n1 n2 | _ ⇒ false ]  
+  | MODE_DIRn_and_IMM1 n1 ⇒ match i2 with [ MODE_DIRn_and_IMM1 n2  ⇒ eq_oct n1 n2 | _ ⇒ false ]
+  ].    
+
+(* iteratore sulle modalita' *)
+ndefinition forall_HC08_im ≝ λP:HC08_instr_mode → bool.
+  P MODE_INH
+⊗ P MODE_INHA
+⊗ P MODE_INHX
+⊗ P MODE_INHH
+⊗ P MODE_INHX0ADD
+⊗ P MODE_INHX1ADD
+⊗ P MODE_INHX2ADD
+⊗ P MODE_IMM1
+⊗ P MODE_IMM1EXT
+⊗ P MODE_IMM2
+⊗ P MODE_DIR1
+⊗ P MODE_DIR2
+⊗ P MODE_IX0
+⊗ P MODE_IX1
+⊗ P MODE_IX2
+⊗ P MODE_SP1
+⊗ P MODE_SP2
+⊗ P MODE_DIR1_to_DIR1
+⊗ P MODE_IMM1_to_DIR1
+⊗ P MODE_IX0p_to_DIR1
+⊗ P MODE_DIR1_to_IX0p
+⊗ P MODE_INHA_and_IMM1
+⊗ P MODE_INHX_and_IMM1
+⊗ P MODE_IMM1_and_IMM1
+⊗ P MODE_DIR1_and_IMM1
+⊗ P MODE_IX0_and_IMM1
+⊗ P MODE_IX0p_and_IMM1
+⊗ P MODE_IX1_and_IMM1
+⊗ P MODE_IX1p_and_IMM1
+⊗ P MODE_SP1_and_IMM1
+⊗ forall_oct (λo. P (MODE_DIRn o))
+⊗ forall_oct (λo. P (MODE_DIRn_and_IMM1 o)).
+
+(* enumerazione delle istruzioni *)
+ninductive HC08_opcode: Type ≝
+  ADC    : HC08_opcode (* add with carry *)
+| ADD    : HC08_opcode (* add *)
+| AIS    : HC08_opcode (* add immediate to SP *)
+| AIX    : HC08_opcode (* add immediate to X *)
+| AND    : HC08_opcode (* and *)
+| ASL    : HC08_opcode (* aritmetic shift left *)
+| ASR    : HC08_opcode (* aritmetic shift right *)
+| BCC    : HC08_opcode (* branch if C=0 *)
+| BCLRn  : HC08_opcode (* clear bit n *)
+| BCS    : HC08_opcode (* branch if C=1 *)
+| BEQ    : HC08_opcode (* branch if Z=1 *)
+| BGE    : HC08_opcode (* branch if N⊙V=0 (great or equal) *)
+| BGT    : HC08_opcode (* branch if Z|N⊙V=0 clear (great) *)
+| BHCC   : HC08_opcode (* branch if H=0 *)
+| BHCS   : HC08_opcode (* branch if H=1 *)
+| BHI    : HC08_opcode (* branch if C|Z=0, (higher) *)
+| BIH    : HC08_opcode (* branch if nIRQ=1 *)
+| BIL    : HC08_opcode (* branch if nIRQ=0 *)
+| BIT    : HC08_opcode (* flag = and (bit test) *)
+| BLE    : HC08_opcode (* branch if Z|N⊙V=1 (less or equal) *)
+| BLS    : HC08_opcode (* branch if C|Z=1 (lower or same) *)
+| BLT    : HC08_opcode (* branch if N⊙1=1 (less) *)
+| BMC    : HC08_opcode (* branch if I=0 (interrupt mask clear) *)
+| BMI    : HC08_opcode (* branch if N=1 (minus) *)
+| BMS    : HC08_opcode (* branch if I=1 (interrupt mask set) *)
+| BNE    : HC08_opcode (* branch if Z=0 *)
+| BPL    : HC08_opcode (* branch if N=0 (plus) *)
+| BRA    : HC08_opcode (* branch always *)
+| BRCLRn : HC08_opcode (* branch if bit n clear *)
+| BRN    : HC08_opcode (* branch never (nop) *)
+| BRSETn : HC08_opcode (* branch if bit n set *)
+| BSETn  : HC08_opcode (* set bit n *)
+| BSR    : HC08_opcode (* branch to subroutine *)
+| CBEQA  : HC08_opcode (* compare (A) and BEQ *)
+| CBEQX  : HC08_opcode (* compare (X) and BEQ *)
+| CLC    : HC08_opcode (* C=0 *)
+| CLI    : HC08_opcode (* I=0 *)
+| CLR    : HC08_opcode (* operand=0 *)
+| CMP    : HC08_opcode (* flag = sub (compare A) *)
+| COM    : HC08_opcode (* not (1 complement) *)
+| CPHX   : HC08_opcode (* flag = sub (compare H:X) *)
+| CPX    : HC08_opcode (* flag = sub (compare X) *)
+| DAA    : HC08_opcode (* decimal adjust A *)
+| DBNZ   : HC08_opcode (* dec and BNE *)
+| DEC    : HC08_opcode (* operand=operand-1 (decrement) *)
+| DIV    : HC08_opcode (* div *)
+| EOR    : HC08_opcode (* xor *)
+| INC    : HC08_opcode (* operand=operand+1 (increment) *)
+| JMP    : HC08_opcode (* jmp word [operand] *)
+| JSR    : HC08_opcode (* jmp to subroutine *)
+| LDA    : HC08_opcode (* load in A *)
+| LDHX   : HC08_opcode (* load in H:X *)
+| LDX    : HC08_opcode (* load in X *)
+| LSR    : HC08_opcode (* logical shift right *)
+| MOV    : HC08_opcode (* move *)
+| MUL    : HC08_opcode (* mul *)
+| NEG    : HC08_opcode (* neg (2 complement) *)
+| NOP    : HC08_opcode (* nop *)
+| NSA    : HC08_opcode (* nibble swap A (al:ah <- ah:al) *)
+| ORA    : HC08_opcode (* or *)
+| PSHA   : HC08_opcode (* push A *)
+| PSHH   : HC08_opcode (* push H *)
+| PSHX   : HC08_opcode (* push X *)
+| PULA   : HC08_opcode (* pop A *)
+| PULH   : HC08_opcode (* pop H *)
+| PULX   : HC08_opcode (* pop X *)
+| ROL    : HC08_opcode (* rotate left *)
+| ROR    : HC08_opcode (* rotate right *)
+| RSP    : HC08_opcode (* reset SP (0x00FF) *)
+| RTI    : HC08_opcode (* return from interrupt *)
+| RTS    : HC08_opcode (* return from subroutine *)
+| SBC    : HC08_opcode (* sub with carry*)
+| SEC    : HC08_opcode (* C=1 *)
+| SEI    : HC08_opcode (* I=1 *)
+| STA    : HC08_opcode (* store from A *)
+| STHX   : HC08_opcode (* store from H:X *)
+| STOP   : HC08_opcode (* !!stop mode!! *)
+| STX    : HC08_opcode (* store from X *)
+| SUB    : HC08_opcode (* sub *)
+| SWI    : HC08_opcode (* software interrupt *)
+| TAP    : HC08_opcode (* flag=A (transfer A to process status byte *)
+| TAX    : HC08_opcode (* X=A (transfer A to X) *)
+| TPA    : HC08_opcode (* A=flag (transfer process status byte to A) *)
+| TST    : HC08_opcode (* flag = sub (test) *)
+| TSX    : HC08_opcode (* X:H=SP (transfer SP to H:X) *)
+| TXA    : HC08_opcode (* A=X (transfer X to A) *)
+| TXS    : HC08_opcode (* SP=X:H (transfer H:X to SP) *)
+| WAIT   : HC08_opcode (* !!wait mode!! *)
+.
+
+ndefinition eq_HC08_op ≝
+λop1,op2:HC08_opcode.
+ match op1 with
+  [ ADC ⇒ match op2 with [ ADC ⇒ true | _ ⇒ false ]       | ADD ⇒ match op2 with [ ADD ⇒ true | _ ⇒ false ]
+  | AIS ⇒ match op2 with [ AIS ⇒ true | _ ⇒ false ]       | AIX ⇒ match op2 with [ AIX ⇒ true | _ ⇒ false ]
+  | AND ⇒ match op2 with [ AND ⇒ true | _ ⇒ false ]       | ASL ⇒ match op2 with [ ASL ⇒ true | _ ⇒ false ]
+  | ASR ⇒ match op2 with [ ASR ⇒ true | _ ⇒ false ]       | BCC ⇒ match op2 with [ BCC ⇒ true | _ ⇒ false ]
+  | BCLRn ⇒ match op2 with [ BCLRn ⇒ true | _ ⇒ false ]   | BCS ⇒ match op2 with [ BCS ⇒ true | _ ⇒ false ]
+  | BEQ ⇒ match op2 with [ BEQ ⇒ true | _ ⇒ false ]       | BGE ⇒ match op2 with [ BGE ⇒ true | _ ⇒ false ]
+  | BGT ⇒ match op2 with [ BGT ⇒ true | _ ⇒ false ]       | BHCC ⇒ match op2 with [ BHCC ⇒ true | _ ⇒ false ]
+  | BHCS ⇒ match op2 with [ BHCS ⇒ true | _ ⇒ false ]     | BHI ⇒ match op2 with [ BHI ⇒ true | _ ⇒ false ]
+  | BIH ⇒ match op2 with [ BIH ⇒ true | _ ⇒ false ]       | BIL ⇒ match op2 with [ BIL ⇒ true | _ ⇒ false ]
+  | BIT ⇒ match op2 with [ BIT ⇒ true | _ ⇒ false ]       | BLE ⇒ match op2 with [ BLE ⇒ true | _ ⇒ false ]
+  | BLS ⇒ match op2 with [ BLS ⇒ true | _ ⇒ false ]       | BLT ⇒ match op2 with [ BLT ⇒ true | _ ⇒ false ]
+  | BMC ⇒ match op2 with [ BMC ⇒ true | _ ⇒ false ]       | BMI ⇒ match op2 with [ BMI ⇒ true | _ ⇒ false ]
+  | BMS ⇒ match op2 with [ BMS ⇒ true | _ ⇒ false ]       | BNE ⇒ match op2 with [ BNE ⇒ true | _ ⇒ false ]
+  | BPL ⇒ match op2 with [ BPL ⇒ true | _ ⇒ false ]       | BRA ⇒ match op2 with [ BRA ⇒ true | _ ⇒ false ]
+  | BRCLRn ⇒ match op2 with [ BRCLRn ⇒ true | _ ⇒ false ] | BRN ⇒ match op2 with [ BRN ⇒ true | _ ⇒ false ]
+  | BRSETn ⇒ match op2 with [ BRSETn ⇒ true | _ ⇒ false ] | BSETn ⇒ match op2 with [ BSETn ⇒ true | _ ⇒ false ]
+  | BSR ⇒ match op2 with [ BSR ⇒ true | _ ⇒ false ]       | CBEQA ⇒ match op2 with [ CBEQA ⇒ true | _ ⇒ false ]
+  | CBEQX ⇒ match op2 with [ CBEQX ⇒ true | _ ⇒ false ]   | CLC ⇒ match op2 with [ CLC ⇒ true | _ ⇒ false ]
+  | CLI ⇒ match op2 with [ CLI ⇒ true | _ ⇒ false ]       | CLR ⇒ match op2 with [ CLR ⇒ true | _ ⇒ false ]
+  | CMP ⇒ match op2 with [ CMP ⇒ true | _ ⇒ false ]       | COM ⇒ match op2 with [ COM ⇒ true | _ ⇒ false ]
+  | CPHX ⇒ match op2 with [ CPHX ⇒ true | _ ⇒ false ]     | CPX ⇒ match op2 with [ CPX ⇒ true | _ ⇒ false ]
+  | DAA ⇒ match op2 with [ DAA ⇒ true | _ ⇒ false ]       | DBNZ ⇒ match op2 with [ DBNZ ⇒ true | _ ⇒ false ]
+  | DEC ⇒ match op2 with [ DEC ⇒ true | _ ⇒ false ]       | DIV ⇒ match op2 with [ DIV ⇒ true | _ ⇒ false ]
+  | EOR ⇒ match op2 with [ EOR ⇒ true | _ ⇒ false ]       | INC ⇒ match op2 with [ INC ⇒ true | _ ⇒ false ]
+  | JMP ⇒ match op2 with [ JMP ⇒ true | _ ⇒ false ]       | JSR ⇒ match op2 with [ JSR ⇒ true | _ ⇒ false ]
+  | LDA ⇒ match op2 with [ LDA ⇒ true | _ ⇒ false ]       | LDHX ⇒ match op2 with [ LDHX ⇒ true | _ ⇒ false ]
+  | LDX ⇒ match op2 with [ LDX ⇒ true | _ ⇒ false ]       | LSR ⇒ match op2 with [ LSR ⇒ true | _ ⇒ false ]
+  | MOV ⇒ match op2 with [ MOV ⇒ true | _ ⇒ false ]       | MUL ⇒ match op2 with [ MUL ⇒ true | _ ⇒ false ]
+  | NEG ⇒ match op2 with [ NEG ⇒ true | _ ⇒ false ]       | NOP ⇒ match op2 with [ NOP ⇒ true | _ ⇒ false ]
+  | NSA ⇒ match op2 with [ NSA ⇒ true | _ ⇒ false ]       | ORA ⇒ match op2 with [ ORA ⇒ true | _ ⇒ false ]
+  | PSHA ⇒ match op2 with [ PSHA ⇒ true | _ ⇒ false ]     | PSHH ⇒ match op2 with [ PSHH ⇒ true | _ ⇒ false ]
+  | PSHX ⇒ match op2 with [ PSHX ⇒ true | _ ⇒ false ]     | PULA ⇒ match op2 with [ PULA ⇒ true | _ ⇒ false ]
+  | PULH ⇒ match op2 with [ PULH ⇒ true | _ ⇒ false ]     | PULX ⇒ match op2 with [ PULX ⇒ true | _ ⇒ false ]
+  | ROL ⇒ match op2 with [ ROL ⇒ true | _ ⇒ false ]       | ROR ⇒ match op2 with [ ROR ⇒ true | _ ⇒ false ]
+  | RSP ⇒ match op2 with [ RSP ⇒ true | _ ⇒ false ]       | RTI ⇒ match op2 with [ RTI ⇒ true | _ ⇒ false ]
+  | RTS ⇒ match op2 with [ RTS ⇒ true | _ ⇒ false ]       | SBC ⇒ match op2 with [ SBC ⇒ true | _ ⇒ false ]
+  | SEC ⇒ match op2 with [ SEC ⇒ true | _ ⇒ false ]       | SEI ⇒ match op2 with [ SEI ⇒ true | _ ⇒ false ] 
+  | STA ⇒ match op2 with [ STA ⇒ true | _ ⇒ false ]       | STHX ⇒ match op2 with [ STHX ⇒ true | _ ⇒ false ]
+  | STOP ⇒ match op2 with [ STOP ⇒ true | _ ⇒ false ]     | STX ⇒ match op2 with [ STX ⇒ true | _ ⇒ false ]
+  | SUB ⇒ match op2 with [ SUB ⇒ true | _ ⇒ false ]       | SWI ⇒ match op2 with [ SWI ⇒ true | _ ⇒ false ]
+  | TAP ⇒ match op2 with [ TAP ⇒ true | _ ⇒ false ]       | TAX ⇒ match op2 with [ TAX ⇒ true | _ ⇒ false ]
+  | TPA ⇒ match op2 with [ TPA ⇒ true | _ ⇒ false ]       | TST ⇒ match op2 with [ TST ⇒ true | _ ⇒ false ]
+  | TSX ⇒ match op2 with [ TSX ⇒ true | _ ⇒ false ]       | TXA ⇒ match op2 with [ TXA ⇒ true | _ ⇒ false ]
+  | TXS ⇒ match op2 with [ TXS ⇒ true | _ ⇒ false ]       | WAIT ⇒ match op2 with [ WAIT ⇒ true | _ ⇒ false ]
+  ].
+
+(* iteratore sugli opcode *)
+ndefinition forall_HC08_op ≝ λP:HC08_opcode → bool.
+ P ADC    ⊗ P ADD    ⊗ P AIS    ⊗ P AIX    ⊗ P AND    ⊗ P ASL    ⊗ P ASR    ⊗ P BCC    ⊗
+ P BCLRn  ⊗ P BCS    ⊗ P BEQ    ⊗ P BGE    ⊗ P BGT    ⊗ P BHCC   ⊗ P BHCS   ⊗ P BHI    ⊗
+ P BIH    ⊗ P BIL    ⊗ P BIT    ⊗ P BLE    ⊗ P BLS    ⊗ P BLT    ⊗ P BMC    ⊗ P BMI    ⊗
+ P BMS    ⊗ P BNE    ⊗ P BPL    ⊗ P BRA    ⊗ P BRCLRn ⊗ P BRN    ⊗ P BRSETn ⊗ P BSETn  ⊗
+ P BSR    ⊗ P CBEQA  ⊗ P CBEQX  ⊗ P CLC    ⊗ P CLI    ⊗ P CLR    ⊗ P CMP    ⊗ P COM    ⊗
+ P CPHX   ⊗ P CPX    ⊗ P DAA    ⊗ P DBNZ   ⊗ P DEC    ⊗ P DIV    ⊗ P EOR    ⊗ P INC    ⊗
+ P JMP    ⊗ P JSR    ⊗ P LDA    ⊗ P LDHX   ⊗ P LDX    ⊗ P LSR    ⊗ P MOV    ⊗ P MUL    ⊗
+ P NEG    ⊗ P NOP    ⊗ P NSA    ⊗ P ORA    ⊗ P PSHA   ⊗ P PSHH   ⊗ P PSHX   ⊗ P PULA   ⊗
+ P PULH   ⊗ P PULX   ⊗ P ROL    ⊗ P ROR    ⊗ P RSP    ⊗ P RTI    ⊗ P RTS    ⊗ P SBC    ⊗
+ P SEC    ⊗ P SEI    ⊗ P STA    ⊗ P STHX   ⊗ P STOP   ⊗ P STX    ⊗ P SUB    ⊗ P SWI    ⊗
+ P TAP    ⊗ P TAX    ⊗ P TPA    ⊗ P TST    ⊗ P TSX    ⊗ P TXA    ⊗ P TXS    ⊗ P WAIT.
diff --git a/helm/software/matita/contribs/ng_assembly/opcodes/HC08_table.ma b/helm/software/matita/contribs/ng_assembly/opcodes/HC08_table.ma
new file mode 100755 (executable)
index 0000000..5ef3c50
--- /dev/null
@@ -0,0 +1,475 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||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 "opcodes/HC08_opcode_base.ma".
+include "opcodes/byte_or_word.ma".
+include "common/list.ma".
+
+(* ***************** *)
+(* TABELLA DELL'HC08 *)
+(* ***************** *)
+
+(* definizione come concatenazione finale di liste per velocizzare il parsing *)
+(* ogni riga e' (any_opcode m) (instr_mode) (opcode esadecimale) (#cicli esecuzione) *)
+(* NB: l'uso di any_opcode m + concatenazione finale tutte liste
+       impedisce di introdurre opcode disomogenei (per mcu) *)
+
+ndefinition opcode_table_HC08_1 ≝
+[
+  quadruple … ADC MODE_IMM1 (Byte 〈xA,x9〉) 〈x0,x2〉
+; quadruple … ADC MODE_DIR1 (Byte 〈xB,x9〉) 〈x0,x3〉
+; quadruple … ADC MODE_DIR2 (Byte 〈xC,x9〉) 〈x0,x4〉
+; quadruple … ADC MODE_IX2  (Byte 〈xD,x9〉) 〈x0,x4〉
+; quadruple … ADC MODE_IX1  (Byte 〈xE,x9〉) 〈x0,x3〉
+; quadruple … ADC MODE_IX0  (Byte 〈xF,x9〉) 〈x0,x2〉
+; quadruple … ADC MODE_SP2  (Word 〈〈x9,xE〉:〈xD,x9〉〉) 〈x0,x5〉
+; quadruple … ADC MODE_SP1  (Word 〈〈x9,xE〉:〈xE,x9〉〉) 〈x0,x4〉
+].
+
+ndefinition opcode_table_HC08_2 ≝
+[
+  quadruple … ADD MODE_IMM1 (Byte 〈xA,xB〉) 〈x0,x2〉
+; quadruple … ADD MODE_DIR1 (Byte 〈xB,xB〉) 〈x0,x3〉
+; quadruple … ADD MODE_DIR2 (Byte 〈xC,xB〉) 〈x0,x4〉
+; quadruple … ADD MODE_IX2  (Byte 〈xD,xB〉) 〈x0,x4〉
+; quadruple … ADD MODE_IX1  (Byte 〈xE,xB〉) 〈x0,x3〉
+; quadruple … ADD MODE_IX0  (Byte 〈xF,xB〉) 〈x0,x2〉
+; quadruple … ADD MODE_SP2  (Word 〈〈x9,xE〉:〈xD,xB〉〉) 〈x0,x5〉
+; quadruple … ADD MODE_SP1  (Word 〈〈x9,xE〉:〈xE,xB〉〉) 〈x0,x4〉
+].
+
+ndefinition opcode_table_HC08_3 ≝
+[
+  quadruple … AND MODE_IMM1 (Byte 〈xA,x4〉) 〈x0,x2〉
+; quadruple … AND MODE_DIR1 (Byte 〈xB,x4〉) 〈x0,x3〉
+; quadruple … AND MODE_DIR2 (Byte 〈xC,x4〉) 〈x0,x4〉
+; quadruple … AND MODE_IX2  (Byte 〈xD,x4〉) 〈x0,x4〉
+; quadruple … AND MODE_IX1  (Byte 〈xE,x4〉) 〈x0,x3〉
+; quadruple … AND MODE_IX0  (Byte 〈xF,x4〉) 〈x0,x2〉
+; quadruple … AND MODE_SP2  (Word 〈〈x9,xE〉:〈xD,x4〉〉) 〈x0,x5〉
+; quadruple … AND MODE_SP1  (Word 〈〈x9,xE〉:〈xE,x4〉〉) 〈x0,x4〉
+].
+
+ndefinition opcode_table_HC08_4 ≝
+[
+  quadruple … ASL MODE_DIR1 (Byte 〈x3,x8〉) 〈x0,x4〉
+; quadruple … ASL MODE_INHA (Byte 〈x4,x8〉) 〈x0,x1〉
+; quadruple … ASL MODE_INHX (Byte 〈x5,x8〉) 〈x0,x1〉
+; quadruple … ASL MODE_IX1  (Byte 〈x6,x8〉) 〈x0,x4〉
+; quadruple … ASL MODE_IX0  (Byte 〈x7,x8〉) 〈x0,x3〉
+; quadruple … ASL MODE_SP1  (Word 〈〈x9,xE〉:〈x6,x8〉〉) 〈x0,x5〉
+].
+
+ndefinition opcode_table_HC08_5 ≝
+[
+  quadruple … ASR MODE_DIR1 (Byte 〈x3,x7〉) 〈x0,x4〉
+; quadruple … ASR MODE_INHA (Byte 〈x4,x7〉) 〈x0,x1〉
+; quadruple … ASR MODE_INHX (Byte 〈x5,x7〉) 〈x0,x1〉
+; quadruple … ASR MODE_IX1  (Byte 〈x6,x7〉) 〈x0,x4〉
+; quadruple … ASR MODE_IX0  (Byte 〈x7,x7〉) 〈x0,x3〉
+; quadruple … ASR MODE_SP1  (Word 〈〈x9,xE〉:〈x6,x7〉〉) 〈x0,x5〉
+].
+
+ndefinition opcode_table_HC08_6 ≝
+[
+  quadruple … BRA  MODE_IMM1 (Byte 〈x2,x0〉) 〈x0,x3〉
+; quadruple … BRN  MODE_IMM1 (Byte 〈x2,x1〉) 〈x0,x3〉
+; quadruple … BHI  MODE_IMM1 (Byte 〈x2,x2〉) 〈x0,x3〉
+; quadruple … BLS  MODE_IMM1 (Byte 〈x2,x3〉) 〈x0,x3〉
+; quadruple … BCC  MODE_IMM1 (Byte 〈x2,x4〉) 〈x0,x3〉
+; quadruple … BCS  MODE_IMM1 (Byte 〈x2,x5〉) 〈x0,x3〉
+; quadruple … BNE  MODE_IMM1 (Byte 〈x2,x6〉) 〈x0,x3〉
+; quadruple … BEQ  MODE_IMM1 (Byte 〈x2,x7〉) 〈x0,x3〉
+; quadruple … BHCC MODE_IMM1 (Byte 〈x2,x8〉) 〈x0,x3〉
+; quadruple … BHCS MODE_IMM1 (Byte 〈x2,x9〉) 〈x0,x3〉
+; quadruple … BPL  MODE_IMM1 (Byte 〈x2,xA〉) 〈x0,x3〉
+; quadruple … BMI  MODE_IMM1 (Byte 〈x2,xB〉) 〈x0,x3〉
+; quadruple … BMC  MODE_IMM1 (Byte 〈x2,xC〉) 〈x0,x3〉
+; quadruple … BMS  MODE_IMM1 (Byte 〈x2,xD〉) 〈x0,x3〉
+; quadruple … BIL  MODE_IMM1 (Byte 〈x2,xE〉) 〈x0,x3〉
+; quadruple … BIH  MODE_IMM1 (Byte 〈x2,xF〉) 〈x0,x3〉
+; quadruple … BGE  MODE_IMM1 (Byte 〈x9,x0〉) 〈x0,x3〉
+; quadruple … BLT  MODE_IMM1 (Byte 〈x9,x1〉) 〈x0,x3〉
+; quadruple … BGT  MODE_IMM1 (Byte 〈x9,x2〉) 〈x0,x3〉
+; quadruple … BLE  MODE_IMM1 (Byte 〈x9,x3〉) 〈x0,x3〉
+].
+
+ndefinition opcode_table_HC08_7 ≝
+[
+  quadruple … BSETn (MODE_DIRn o0) (Byte 〈x1,x0〉) 〈x0,x4〉
+; quadruple … BCLRn (MODE_DIRn o0) (Byte 〈x1,x1〉) 〈x0,x4〉
+; quadruple … BSETn (MODE_DIRn o1) (Byte 〈x1,x2〉) 〈x0,x4〉
+; quadruple … BCLRn (MODE_DIRn o1) (Byte 〈x1,x3〉) 〈x0,x4〉
+; quadruple … BSETn (MODE_DIRn o2) (Byte 〈x1,x4〉) 〈x0,x4〉
+; quadruple … BCLRn (MODE_DIRn o2) (Byte 〈x1,x5〉) 〈x0,x4〉
+; quadruple … BSETn (MODE_DIRn o3) (Byte 〈x1,x6〉) 〈x0,x4〉
+; quadruple … BCLRn (MODE_DIRn o3) (Byte 〈x1,x7〉) 〈x0,x4〉
+; quadruple … BSETn (MODE_DIRn o4) (Byte 〈x1,x8〉) 〈x0,x4〉
+; quadruple … BCLRn (MODE_DIRn o4) (Byte 〈x1,x9〉) 〈x0,x4〉
+; quadruple … BSETn (MODE_DIRn o5) (Byte 〈x1,xA〉) 〈x0,x4〉
+; quadruple … BCLRn (MODE_DIRn o5) (Byte 〈x1,xB〉) 〈x0,x4〉
+; quadruple … BSETn (MODE_DIRn o6) (Byte 〈x1,xC〉) 〈x0,x4〉
+; quadruple … BCLRn (MODE_DIRn o6) (Byte 〈x1,xD〉) 〈x0,x4〉
+; quadruple … BSETn (MODE_DIRn o7) (Byte 〈x1,xE〉) 〈x0,x4〉
+; quadruple … BCLRn (MODE_DIRn o7) (Byte 〈x1,xF〉) 〈x0,x4〉
+].
+
+ndefinition opcode_table_HC08_8 ≝
+[
+  quadruple … BRSETn (MODE_DIRn_and_IMM1 o0) (Byte 〈x0,x0〉) 〈x0,x5〉
+; quadruple … BRCLRn (MODE_DIRn_and_IMM1 o0) (Byte 〈x0,x1〉) 〈x0,x5〉
+; quadruple … BRSETn (MODE_DIRn_and_IMM1 o1) (Byte 〈x0,x2〉) 〈x0,x5〉
+; quadruple … BRCLRn (MODE_DIRn_and_IMM1 o1) (Byte 〈x0,x3〉) 〈x0,x5〉
+; quadruple … BRSETn (MODE_DIRn_and_IMM1 o2) (Byte 〈x0,x4〉) 〈x0,x5〉
+; quadruple … BRCLRn (MODE_DIRn_and_IMM1 o2) (Byte 〈x0,x5〉) 〈x0,x5〉
+; quadruple … BRSETn (MODE_DIRn_and_IMM1 o3) (Byte 〈x0,x6〉) 〈x0,x5〉
+; quadruple … BRCLRn (MODE_DIRn_and_IMM1 o3) (Byte 〈x0,x7〉) 〈x0,x5〉
+; quadruple … BRSETn (MODE_DIRn_and_IMM1 o4) (Byte 〈x0,x8〉) 〈x0,x5〉
+; quadruple … BRCLRn (MODE_DIRn_and_IMM1 o4) (Byte 〈x0,x9〉) 〈x0,x5〉
+; quadruple … BRSETn (MODE_DIRn_and_IMM1 o5) (Byte 〈x0,xA〉) 〈x0,x5〉
+; quadruple … BRCLRn (MODE_DIRn_and_IMM1 o5) (Byte 〈x0,xB〉) 〈x0,x5〉
+; quadruple … BRSETn (MODE_DIRn_and_IMM1 o6) (Byte 〈x0,xC〉) 〈x0,x5〉
+; quadruple … BRCLRn (MODE_DIRn_and_IMM1 o6) (Byte 〈x0,xD〉) 〈x0,x5〉
+; quadruple … BRSETn (MODE_DIRn_and_IMM1 o7) (Byte 〈x0,xE〉) 〈x0,x5〉
+; quadruple … BRCLRn (MODE_DIRn_and_IMM1 o7) (Byte 〈x0,xF〉) 〈x0,x5〉
+].
+
+ndefinition opcode_table_HC08_9 ≝
+[
+  quadruple … BIT MODE_IMM1 (Byte 〈xA,x5〉) 〈x0,x2〉
+; quadruple … BIT MODE_DIR1 (Byte 〈xB,x5〉) 〈x0,x3〉
+; quadruple … BIT MODE_DIR2 (Byte 〈xC,x5〉) 〈x0,x4〉
+; quadruple … BIT MODE_IX2  (Byte 〈xD,x5〉) 〈x0,x4〉
+; quadruple … BIT MODE_IX1  (Byte 〈xE,x5〉) 〈x0,x3〉
+; quadruple … BIT MODE_IX0  (Byte 〈xF,x5〉) 〈x0,x2〉
+; quadruple … BIT MODE_SP2  (Word 〈〈x9,xE〉:〈xD,x5〉〉) 〈x0,x5〉
+; quadruple … BIT MODE_SP1  (Word 〈〈x9,xE〉:〈xE,x5〉〉) 〈x0,x4〉
+].
+
+ndefinition opcode_table_HC08_10 ≝
+[
+  quadruple … MUL  MODE_INH  (Byte 〈x4,x2〉) 〈x0,x5〉
+; quadruple … DIV  MODE_INH  (Byte 〈x5,x2〉) 〈x0,x7〉
+; quadruple … NSA  MODE_INH  (Byte 〈x6,x2〉) 〈x0,x3〉
+; quadruple … DAA  MODE_INH  (Byte 〈x7,x2〉) 〈x0,x2〉
+; quadruple … RTI  MODE_INH  (Byte 〈x8,x0〉) 〈x0,x7〉
+; quadruple … RTS  MODE_INH  (Byte 〈x8,x1〉) 〈x0,x4〉
+; quadruple … SWI  MODE_INH  (Byte 〈x8,x3〉) 〈x0,x9〉
+; quadruple … TAP  MODE_INH  (Byte 〈x8,x4〉) 〈x0,x2〉
+; quadruple … TPA  MODE_INH  (Byte 〈x8,x5〉) 〈x0,x1〉
+; quadruple … PULA MODE_INH  (Byte 〈x8,x6〉) 〈x0,x2〉
+; quadruple … PSHA MODE_INH  (Byte 〈x8,x7〉) 〈x0,x2〉
+; quadruple … PULX MODE_INH  (Byte 〈x8,x8〉) 〈x0,x2〉
+; quadruple … PSHX MODE_INH  (Byte 〈x8,x9〉) 〈x0,x2〉
+; quadruple … PULH MODE_INH  (Byte 〈x8,xA〉) 〈x0,x2〉
+; quadruple … PSHH MODE_INH  (Byte 〈x8,xB〉) 〈x0,x2〉
+; quadruple … STOP MODE_INH  (Byte 〈x8,xE〉) 〈x0,x1〉
+; quadruple … WAIT MODE_INH  (Byte 〈x8,xF〉) 〈x0,x1〉
+; quadruple … TXS  MODE_INH  (Byte 〈x9,x4〉) 〈x0,x2〉
+; quadruple … TSX  MODE_INH  (Byte 〈x9,x5〉) 〈x0,x2〉
+; quadruple … TAX  MODE_INH  (Byte 〈x9,x7〉) 〈x0,x1〉
+; quadruple … CLC  MODE_INH  (Byte 〈x9,x8〉) 〈x0,x1〉
+; quadruple … SEC  MODE_INH  (Byte 〈x9,x9〉) 〈x0,x1〉
+; quadruple … CLI  MODE_INH  (Byte 〈x9,xA〉) 〈x0,x2〉
+; quadruple … SEI  MODE_INH  (Byte 〈x9,xB〉) 〈x0,x2〉
+; quadruple … RSP  MODE_INH  (Byte 〈x9,xC〉) 〈x0,x1〉
+; quadruple … NOP  MODE_INH  (Byte 〈x9,xD〉) 〈x0,x1〉
+; quadruple … TXA  MODE_INH  (Byte 〈x9,xF〉) 〈x0,x1〉
+; quadruple … AIS  MODE_IMM1 (Byte 〈xA,x7〉) 〈x0,x2〉
+; quadruple … AIX  MODE_IMM1 (Byte 〈xA,xF〉) 〈x0,x2〉
+].
+
+ndefinition opcode_table_HC08_11 ≝
+[
+  quadruple … CBEQA MODE_DIR1_and_IMM1 (Byte 〈x3,x1〉) 〈x0,x5〉
+; quadruple … CBEQA MODE_IMM1_and_IMM1 (Byte 〈x4,x1〉) 〈x0,x4〉
+; quadruple … CBEQX MODE_IMM1_and_IMM1 (Byte 〈x5,x1〉) 〈x0,x4〉
+; quadruple … CBEQA MODE_IX1p_and_IMM1 (Byte 〈x6,x1〉) 〈x0,x5〉
+; quadruple … CBEQA MODE_IX0p_and_IMM1 (Byte 〈x7,x1〉) 〈x0,x4〉
+; quadruple … CBEQA MODE_SP1_and_IMM1  (Word 〈〈x9,xE〉:〈x6,x1〉〉) 〈x0,x6〉
+].
+
+ndefinition opcode_table_HC08_12 ≝
+[
+  quadruple … CLR MODE_DIR1 (Byte 〈x3,xF〉) 〈x0,x3〉
+; quadruple … CLR MODE_INHA (Byte 〈x4,xF〉) 〈x0,x1〉
+; quadruple … CLR MODE_INHX (Byte 〈x5,xF〉) 〈x0,x1〉
+; quadruple … CLR MODE_IX1  (Byte 〈x6,xF〉) 〈x0,x3〉
+; quadruple … CLR MODE_IX0  (Byte 〈x7,xF〉) 〈x0,x2〉
+; quadruple … CLR MODE_INHH (Byte 〈x8,xC〉) 〈x0,x1〉
+; quadruple … CLR MODE_SP1  (Word 〈〈x9,xE〉:〈x6,xF〉〉) 〈x0,x4〉
+].
+
+ndefinition opcode_table_HC08_13 ≝
+[
+  quadruple … CMP MODE_IMM1 (Byte 〈xA,x1〉) 〈x0,x2〉
+; quadruple … CMP MODE_DIR1 (Byte 〈xB,x1〉) 〈x0,x3〉
+; quadruple … CMP MODE_DIR2 (Byte 〈xC,x1〉) 〈x0,x4〉
+; quadruple … CMP MODE_IX2  (Byte 〈xD,x1〉) 〈x0,x4〉
+; quadruple … CMP MODE_IX1  (Byte 〈xE,x1〉) 〈x0,x3〉
+; quadruple … CMP MODE_IX0  (Byte 〈xF,x1〉) 〈x0,x2〉
+; quadruple … CMP MODE_SP2  (Word 〈〈x9,xE〉:〈xD,x1〉〉) 〈x0,x5〉
+; quadruple … CMP MODE_SP1  (Word 〈〈x9,xE〉:〈xE,x1〉〉) 〈x0,x4〉
+].
+
+ndefinition opcode_table_HC08_14 ≝
+[
+  quadruple … COM MODE_DIR1 (Byte 〈x3,x3〉) 〈x0,x4〉
+; quadruple … COM MODE_INHA (Byte 〈x4,x3〉) 〈x0,x1〉
+; quadruple … COM MODE_INHX (Byte 〈x5,x3〉) 〈x0,x1〉
+; quadruple … COM MODE_IX1  (Byte 〈x6,x3〉) 〈x0,x4〉
+; quadruple … COM MODE_IX0  (Byte 〈x7,x3〉) 〈x0,x3〉
+; quadruple … COM MODE_SP1  (Word 〈〈x9,xE〉:〈x6,x3〉〉) 〈x0,x5〉
+].
+
+ndefinition opcode_table_HC08_15 ≝
+[
+  quadruple … STHX MODE_DIR1 (Byte 〈x3,x5〉) 〈x0,x4〉
+; quadruple … LDHX MODE_IMM2 (Byte 〈x4,x5〉) 〈x0,x3〉
+; quadruple … LDHX MODE_DIR1 (Byte 〈x5,x5〉) 〈x0,x4〉
+; quadruple … CPHX MODE_IMM2 (Byte 〈x6,x5〉) 〈x0,x3〉
+; quadruple … CPHX MODE_DIR1 (Byte 〈x7,x5〉) 〈x0,x4〉
+].
+
+ndefinition opcode_table_HC08_16 ≝
+[
+  quadruple … CPX MODE_IMM1 (Byte 〈xA,x3〉) 〈x0,x2〉
+; quadruple … CPX MODE_DIR1 (Byte 〈xB,x3〉) 〈x0,x3〉
+; quadruple … CPX MODE_DIR2 (Byte 〈xC,x3〉) 〈x0,x4〉
+; quadruple … CPX MODE_IX2  (Byte 〈xD,x3〉) 〈x0,x4〉
+; quadruple … CPX MODE_IX1  (Byte 〈xE,x3〉) 〈x0,x3〉
+; quadruple … CPX MODE_IX0  (Byte 〈xF,x3〉) 〈x0,x2〉
+; quadruple … CPX MODE_SP2  (Word 〈〈x9,xE〉:〈xD,x3〉〉) 〈x0,x5〉
+; quadruple … CPX MODE_SP1  (Word 〈〈x9,xE〉:〈xE,x3〉〉) 〈x0,x4〉
+].
+
+ndefinition opcode_table_HC08_17 ≝
+[
+  quadruple … DBNZ MODE_DIR1_and_IMM1 (Byte 〈x3,xB〉) 〈x0,x5〉
+; quadruple … DBNZ MODE_INHA_and_IMM1 (Byte 〈x4,xB〉) 〈x0,x3〉
+; quadruple … DBNZ MODE_INHX_and_IMM1 (Byte 〈x5,xB〉) 〈x0,x3〉
+; quadruple … DBNZ MODE_IX1_and_IMM1  (Byte 〈x6,xB〉) 〈x0,x5〉
+; quadruple … DBNZ MODE_IX0_and_IMM1  (Byte 〈x7,xB〉) 〈x0,x4〉
+; quadruple … DBNZ MODE_SP1_and_IMM1  (Word 〈〈x9,xE〉:〈x6,xB〉〉) 〈x0,x6〉
+].
+
+ndefinition opcode_table_HC08_18 ≝
+[
+  quadruple … DEC MODE_DIR1 (Byte 〈x3,xA〉) 〈x0,x4〉
+; quadruple … DEC MODE_INHA (Byte 〈x4,xA〉) 〈x0,x1〉
+; quadruple … DEC MODE_INHX (Byte 〈x5,xA〉) 〈x0,x1〉
+; quadruple … DEC MODE_IX1  (Byte 〈x6,xA〉) 〈x0,x4〉
+; quadruple … DEC MODE_IX0  (Byte 〈x7,xA〉) 〈x0,x3〉
+; quadruple … DEC MODE_SP1  (Word 〈〈x9,xE〉:〈x6,xA〉〉) 〈x0,x5〉
+].
+
+ndefinition opcode_table_HC08_19 ≝
+[
+  quadruple … EOR MODE_IMM1 (Byte 〈xA,x8〉) 〈x0,x2〉
+; quadruple … EOR MODE_DIR1 (Byte 〈xB,x8〉) 〈x0,x3〉
+; quadruple … EOR MODE_DIR2 (Byte 〈xC,x8〉) 〈x0,x4〉
+; quadruple … EOR MODE_IX2  (Byte 〈xD,x8〉) 〈x0,x4〉
+; quadruple … EOR MODE_IX1  (Byte 〈xE,x8〉) 〈x0,x3〉
+; quadruple … EOR MODE_IX0  (Byte 〈xF,x8〉) 〈x0,x2〉
+; quadruple … EOR MODE_SP2  (Word 〈〈x9,xE〉:〈xD,x8〉〉) 〈x0,x5〉
+; quadruple … EOR MODE_SP1  (Word 〈〈x9,xE〉:〈xE,x8〉〉) 〈x0,x4〉
+].
+
+ndefinition opcode_table_HC08_20 ≝
+[
+  quadruple … INC MODE_DIR1 (Byte 〈x3,xC〉) 〈x0,x4〉
+; quadruple … INC MODE_INHA (Byte 〈x4,xC〉) 〈x0,x1〉
+; quadruple … INC MODE_INHX (Byte 〈x5,xC〉) 〈x0,x1〉
+; quadruple … INC MODE_IX1  (Byte 〈x6,xC〉) 〈x0,x4〉
+; quadruple … INC MODE_IX0  (Byte 〈x7,xC〉) 〈x0,x3〉
+; quadruple … INC MODE_SP1  (Word 〈〈x9,xE〉:〈x6,xC〉〉) 〈x0,x5〉
+].
+
+ndefinition opcode_table_HC08_21 ≝
+[
+  quadruple … JMP MODE_IMM1EXT  (Byte 〈xB,xC〉) 〈x0,x2〉
+; quadruple … JMP MODE_IMM2     (Byte 〈xC,xC〉) 〈x0,x3〉
+; quadruple … JMP MODE_INHX2ADD (Byte 〈xD,xC〉) 〈x0,x4〉
+; quadruple … JMP MODE_INHX1ADD (Byte 〈xE,xC〉) 〈x0,x3〉
+; quadruple … JMP MODE_INHX0ADD (Byte 〈xF,xC〉) 〈x0,x3〉
+].
+
+ndefinition opcode_table_HC08_22 ≝
+[
+  quadruple … BSR MODE_IMM1     (Byte 〈xA,xD〉) 〈x0,x4〉
+; quadruple … JSR MODE_IMM1EXT  (Byte 〈xB,xD〉) 〈x0,x4〉
+; quadruple … JSR MODE_IMM2     (Byte 〈xC,xD〉) 〈x0,x5〉
+; quadruple … JSR MODE_INHX2ADD (Byte 〈xD,xD〉) 〈x0,x6〉
+; quadruple … JSR MODE_INHX1ADD (Byte 〈xE,xD〉) 〈x0,x5〉
+; quadruple … JSR MODE_INHX0ADD (Byte 〈xF,xD〉) 〈x0,x4〉
+].
+
+ndefinition opcode_table_HC08_23 ≝
+[
+  quadruple … LDA MODE_IMM1 (Byte 〈xA,x6〉) 〈x0,x2〉
+; quadruple … LDA MODE_DIR1 (Byte 〈xB,x6〉) 〈x0,x3〉
+; quadruple … LDA MODE_DIR2 (Byte 〈xC,x6〉) 〈x0,x4〉
+; quadruple … LDA MODE_IX2  (Byte 〈xD,x6〉) 〈x0,x4〉
+; quadruple … LDA MODE_IX1  (Byte 〈xE,x6〉) 〈x0,x3〉
+; quadruple … LDA MODE_IX0  (Byte 〈xF,x6〉) 〈x0,x2〉
+; quadruple … LDA MODE_SP2  (Word 〈〈x9,xE〉:〈xD,x6〉〉) 〈x0,x5〉
+; quadruple … LDA MODE_SP1  (Word 〈〈x9,xE〉:〈xE,x6〉〉) 〈x0,x4〉
+].
+
+ndefinition opcode_table_HC08_24 ≝
+[
+  quadruple … LDX MODE_IMM1 (Byte 〈xA,xE〉) 〈x0,x2〉
+; quadruple … LDX MODE_DIR1 (Byte 〈xB,xE〉) 〈x0,x3〉
+; quadruple … LDX MODE_DIR2 (Byte 〈xC,xE〉) 〈x0,x4〉
+; quadruple … LDX MODE_IX2  (Byte 〈xD,xE〉) 〈x0,x4〉
+; quadruple … LDX MODE_IX1  (Byte 〈xE,xE〉) 〈x0,x3〉
+; quadruple … LDX MODE_IX0  (Byte 〈xF,xE〉) 〈x0,x2〉
+; quadruple … LDX MODE_SP2  (Word 〈〈x9,xE〉:〈xD,xE〉〉) 〈x0,x5〉
+; quadruple … LDX MODE_SP1  (Word 〈〈x9,xE〉:〈xE,xE〉〉) 〈x0,x4〉
+].
+
+ndefinition opcode_table_HC08_25 ≝
+[
+  quadruple … LSR MODE_DIR1 (Byte 〈x3,x4〉) 〈x0,x4〉
+; quadruple … LSR MODE_INHA (Byte 〈x4,x4〉) 〈x0,x1〉
+; quadruple … LSR MODE_INHX (Byte 〈x5,x4〉) 〈x0,x1〉
+; quadruple … LSR MODE_IX1  (Byte 〈x6,x4〉) 〈x0,x4〉
+; quadruple … LSR MODE_IX0  (Byte 〈x7,x4〉) 〈x0,x3〉
+; quadruple … LSR MODE_SP1  (Word 〈〈x9,xE〉:〈x6,x4〉〉) 〈x0,x5〉
+].
+
+ndefinition opcode_table_HC08_26 ≝
+[
+  quadruple … MOV MODE_DIR1_to_DIR1 (Byte 〈x4,xE〉) 〈x0,x5〉
+; quadruple … MOV MODE_DIR1_to_IX0p (Byte 〈x5,xE〉) 〈x0,x4〉
+; quadruple … MOV MODE_IMM1_to_DIR1 (Byte 〈x6,xE〉) 〈x0,x4〉
+; quadruple … MOV MODE_IX0p_to_DIR1 (Byte 〈x7,xE〉) 〈x0,x4〉
+].
+
+ndefinition opcode_table_HC08_27 ≝
+[
+  quadruple … NEG MODE_DIR1 (Byte 〈x3,x0〉) 〈x0,x4〉
+; quadruple … NEG MODE_INHA (Byte 〈x4,x0〉) 〈x0,x1〉
+; quadruple … NEG MODE_INHX (Byte 〈x5,x0〉) 〈x0,x1〉
+; quadruple … NEG MODE_IX1  (Byte 〈x6,x0〉) 〈x0,x4〉
+; quadruple … NEG MODE_IX0  (Byte 〈x7,x0〉) 〈x0,x3〉
+; quadruple … NEG MODE_SP1  (Word 〈〈x9,xE〉:〈x6,x0〉〉) 〈x0,x5〉
+].
+
+ndefinition opcode_table_HC08_28 ≝
+[
+  quadruple … ORA MODE_IMM1 (Byte 〈xA,xA〉) 〈x0,x2〉
+; quadruple … ORA MODE_DIR1 (Byte 〈xB,xA〉) 〈x0,x3〉
+; quadruple … ORA MODE_DIR2 (Byte 〈xC,xA〉) 〈x0,x4〉
+; quadruple … ORA MODE_IX2  (Byte 〈xD,xA〉) 〈x0,x4〉
+; quadruple … ORA MODE_IX1  (Byte 〈xE,xA〉) 〈x0,x3〉
+; quadruple … ORA MODE_IX0  (Byte 〈xF,xA〉) 〈x0,x2〉
+; quadruple … ORA MODE_SP2  (Word 〈〈x9,xE〉:〈xD,xA〉〉) 〈x0,x5〉
+; quadruple … ORA MODE_SP1  (Word 〈〈x9,xE〉:〈xE,xA〉〉) 〈x0,x4〉
+].
+
+ndefinition opcode_table_HC08_29 ≝
+[
+  quadruple … ROL MODE_DIR1 (Byte 〈x3,x9〉) 〈x0,x4〉
+; quadruple … ROL MODE_INHA (Byte 〈x4,x9〉) 〈x0,x1〉
+; quadruple … ROL MODE_INHX (Byte 〈x5,x9〉) 〈x0,x1〉
+; quadruple … ROL MODE_IX1  (Byte 〈x6,x9〉) 〈x0,x4〉
+; quadruple … ROL MODE_IX0  (Byte 〈x7,x9〉) 〈x0,x3〉
+; quadruple … ROL MODE_SP1  (Word 〈〈x9,xE〉:〈x6,x9〉〉) 〈x0,x5〉
+].
+
+ndefinition opcode_table_HC08_30 ≝
+[
+  quadruple … ROR MODE_DIR1 (Byte 〈x3,x6〉) 〈x0,x4〉
+; quadruple … ROR MODE_INHA (Byte 〈x4,x6〉) 〈x0,x1〉
+; quadruple … ROR MODE_INHX (Byte 〈x5,x6〉) 〈x0,x1〉
+; quadruple … ROR MODE_IX1  (Byte 〈x6,x6〉) 〈x0,x4〉
+; quadruple … ROR MODE_IX0  (Byte 〈x7,x6〉) 〈x0,x3〉
+; quadruple … ROR MODE_SP1  (Word 〈〈x9,xE〉:〈x6,x6〉〉) 〈x0,x5〉
+].
+
+ndefinition opcode_table_HC08_31 ≝
+[
+  quadruple … SBC MODE_IMM1 (Byte 〈xA,x2〉) 〈x0,x2〉
+; quadruple … SBC MODE_DIR1 (Byte 〈xB,x2〉) 〈x0,x3〉
+; quadruple … SBC MODE_DIR2 (Byte 〈xC,x2〉) 〈x0,x4〉
+; quadruple … SBC MODE_IX2  (Byte 〈xD,x2〉) 〈x0,x4〉
+; quadruple … SBC MODE_IX1  (Byte 〈xE,x2〉) 〈x0,x3〉
+; quadruple … SBC MODE_IX0  (Byte 〈xF,x2〉) 〈x0,x2〉
+; quadruple … SBC MODE_SP2  (Word 〈〈x9,xE〉:〈xD,x2〉〉) 〈x0,x5〉
+; quadruple … SBC MODE_SP1  (Word 〈〈x9,xE〉:〈xE,x2〉〉) 〈x0,x4〉
+].
+
+ndefinition opcode_table_HC08_32 ≝
+[
+  quadruple … STA MODE_DIR1 (Byte 〈xB,x7〉) 〈x0,x3〉
+; quadruple … STA MODE_DIR2 (Byte 〈xC,x7〉) 〈x0,x4〉
+; quadruple … STA MODE_IX2  (Byte 〈xD,x7〉) 〈x0,x4〉
+; quadruple … STA MODE_IX1  (Byte 〈xE,x7〉) 〈x0,x3〉
+; quadruple … STA MODE_IX0  (Byte 〈xF,x7〉) 〈x0,x2〉
+; quadruple … STA MODE_SP2  (Word 〈〈x9,xE〉:〈xD,x7〉〉) 〈x0,x5〉
+; quadruple … STA MODE_SP1  (Word 〈〈x9,xE〉:〈xE,x7〉〉) 〈x0,x4〉
+].
+
+ndefinition opcode_table_HC08_33 ≝
+[
+  quadruple … STX MODE_DIR1 (Byte 〈xB,xF〉) 〈x0,x3〉
+; quadruple … STX MODE_DIR2 (Byte 〈xC,xF〉) 〈x0,x4〉
+; quadruple … STX MODE_IX2  (Byte 〈xD,xF〉) 〈x0,x4〉
+; quadruple … STX MODE_IX1  (Byte 〈xE,xF〉) 〈x0,x3〉
+; quadruple … STX MODE_IX0  (Byte 〈xF,xF〉) 〈x0,x2〉
+; quadruple … STX MODE_SP2  (Word 〈〈x9,xE〉:〈xD,xF〉〉) 〈x0,x5〉
+; quadruple … STX MODE_SP1  (Word 〈〈x9,xE〉:〈xE,xF〉〉) 〈x0,x4〉
+].
+
+ndefinition opcode_table_HC08_34 ≝
+[
+  quadruple … SUB MODE_IMM1 (Byte 〈xA,x0〉) 〈x0,x2〉
+; quadruple … SUB MODE_DIR1 (Byte 〈xB,x0〉) 〈x0,x3〉
+; quadruple … SUB MODE_DIR2 (Byte 〈xC,x0〉) 〈x0,x4〉
+; quadruple … SUB MODE_IX2  (Byte 〈xD,x0〉) 〈x0,x4〉
+; quadruple … SUB MODE_IX1  (Byte 〈xE,x0〉) 〈x0,x3〉
+; quadruple … SUB MODE_IX0  (Byte 〈xF,x0〉) 〈x0,x2〉
+; quadruple … SUB MODE_SP2  (Word 〈〈x9,xE〉:〈xD,x0〉〉) 〈x0,x5〉
+; quadruple … SUB MODE_SP1  (Word 〈〈x9,xE〉:〈xE,x0〉〉) 〈x0,x4〉
+].
+
+ndefinition opcode_table_HC08_35 ≝
+[
+  quadruple … TST MODE_DIR1 (Byte 〈x3,xD〉) 〈x0,x3〉
+; quadruple … TST MODE_INHA (Byte 〈x4,xD〉) 〈x0,x1〉
+; quadruple … TST MODE_INHX (Byte 〈x5,xD〉) 〈x0,x1〉
+; quadruple … TST MODE_IX1  (Byte 〈x6,xD〉) 〈x0,x3〉
+; quadruple … TST MODE_IX0  (Byte 〈x7,xD〉) 〈x0,x2〉
+; quadruple … TST MODE_SP1  (Word 〈〈x9,xE〉:〈x6,xD〉〉) 〈x0,x4〉
+].
+
+ndefinition opcode_table_HC08 ≝
+opcode_table_HC08_1  @ opcode_table_HC08_2  @ opcode_table_HC08_3  @ opcode_table_HC08_4  @
+opcode_table_HC08_5  @ opcode_table_HC08_6  @ opcode_table_HC08_7  @ opcode_table_HC08_8  @
+opcode_table_HC08_9  @ opcode_table_HC08_10 @ opcode_table_HC08_11 @ opcode_table_HC08_12 @
+opcode_table_HC08_13 @ opcode_table_HC08_14 @ opcode_table_HC08_15 @ opcode_table_HC08_16 @
+opcode_table_HC08_17 @ opcode_table_HC08_18 @ opcode_table_HC08_19 @ opcode_table_HC08_20 @
+opcode_table_HC08_21 @ opcode_table_HC08_22 @ opcode_table_HC08_23 @ opcode_table_HC08_24 @
+opcode_table_HC08_25 @ opcode_table_HC08_26 @ opcode_table_HC08_27 @ opcode_table_HC08_28 @
+opcode_table_HC08_29 @ opcode_table_HC08_30 @ opcode_table_HC08_31 @ opcode_table_HC08_32 @
+opcode_table_HC08_33 @ opcode_table_HC08_34 @ opcode_table_HC08_35.
diff --git a/helm/software/matita/contribs/ng_assembly/opcodes/HC08_table_tests.ma b/helm/software/matita/contribs/ng_assembly/opcodes/HC08_table_tests.ma
new file mode 100755 (executable)
index 0000000..c52c6f3
--- /dev/null
@@ -0,0 +1,106 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||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 "opcodes/opcode.ma".
+
+(* ***************** *)
+(* TABELLA DELL'HC08 *)
+(* ***************** *)
+
+(* HC08: opcode non implementati come da manuale (byte) *)
+ndefinition HC08_not_impl_byte ≝
+ [〈x3,x2〉;〈x3,xE〉
+ ;〈x8,x2〉;〈x8,xD〉
+ ;〈x9,x6〉;〈x9,xE〉
+ ;〈xA,xC〉
+ ].
+
+(* test bytecode non implementati *)
+nlemma ok_byte_table_HC08 : forall_b8 (λb.
+ (test_not_impl_byte b HC08_not_impl_byte     ⊙ eq_w16 (get_byte_count HC08 b 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_HC08) 〈〈x0,x0〉:〈x0,x1〉〉) ⊗
+ (⊖ (test_not_impl_byte b HC08_not_impl_byte) ⊙ eq_w16 (get_byte_count HC08 b 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_HC08) 〈〈x0,x0〉:〈x0,x0〉〉))
+ = true.
+ napply refl_eq.
+nqed.
+
+(* HC08: opcode non implementati come da manuale (0x9E+byte) *)
+ndefinition HC08_not_impl_word ≝
+ [〈x0,x0〉;〈x0,x1〉;〈x0,x2〉;〈x0,x3〉;〈x0,x4〉;〈x0,x5〉;〈x0,x6〉;〈x0,x7〉
+ ;〈x0,x8〉;〈x0,x9〉;〈x0,xA〉;〈x0,xB〉;〈x0,xC〉;〈x0,xD〉;〈x0,xE〉;〈x0,xF〉
+ ;〈x1,x0〉;〈x1,x1〉;〈x1,x2〉;〈x1,x3〉;〈x1,x4〉;〈x1,x5〉;〈x1,x6〉;〈x1,x7〉
+ ;〈x1,x8〉;〈x1,x9〉;〈x1,xA〉;〈x1,xB〉;〈x1,xC〉;〈x1,xD〉;〈x1,xE〉;〈x1,xF〉
+ ;〈x2,x0〉;〈x2,x1〉;〈x2,x2〉;〈x2,x3〉;〈x2,x4〉;〈x2,x5〉;〈x2,x6〉;〈x2,x7〉
+ ;〈x2,x8〉;〈x2,x9〉;〈x2,xA〉;〈x2,xB〉;〈x2,xC〉;〈x2,xD〉;〈x2,xE〉;〈x2,xF〉
+ ;〈x3,x0〉;〈x3,x1〉;〈x3,x2〉;〈x3,x3〉;〈x3,x4〉;〈x3,x5〉;〈x3,x6〉;〈x3,x7〉
+ ;〈x3,x8〉;〈x3,x9〉;〈x3,xA〉;〈x3,xB〉;〈x3,xC〉;〈x3,xD〉;〈x3,xE〉;〈x3,xF〉
+ ;〈x4,x0〉;〈x4,x1〉;〈x4,x2〉;〈x4,x3〉;〈x4,x4〉;〈x4,x5〉;〈x4,x6〉;〈x4,x7〉
+ ;〈x4,x8〉;〈x4,x9〉;〈x4,xA〉;〈x4,xB〉;〈x4,xC〉;〈x4,xD〉;〈x4,xE〉;〈x4,xF〉
+ ;〈x5,x0〉;〈x5,x1〉;〈x5,x2〉;〈x5,x3〉;〈x5,x4〉;〈x5,x5〉;〈x5,x6〉;〈x5,x7〉
+ ;〈x5,x8〉;〈x5,x9〉;〈x5,xA〉;〈x5,xB〉;〈x5,xC〉;〈x5,xD〉;〈x5,xE〉;〈x5,xF〉
+ ;〈x6,x2〉;〈x6,x5〉;〈x6,xE〉
+ ;〈x7,x0〉;〈x7,x1〉;〈x7,x2〉;〈x7,x3〉;〈x7,x4〉;〈x7,x5〉;〈x7,x6〉;〈x7,x7〉
+ ;〈x7,x8〉;〈x7,x9〉;〈x7,xA〉;〈x7,xB〉;〈x7,xC〉;〈x7,xD〉;〈x7,xE〉;〈x7,xF〉
+ ;〈x8,x0〉;〈x8,x1〉;〈x8,x2〉;〈x8,x3〉;〈x8,x4〉;〈x8,x5〉;〈x8,x6〉;〈x8,x7〉
+ ;〈x8,x8〉;〈x8,x9〉;〈x8,xA〉;〈x8,xB〉;〈x8,xC〉;〈x8,xD〉;〈x8,xE〉;〈x8,xF〉
+ ;〈x9,x0〉;〈x9,x1〉;〈x9,x2〉;〈x9,x3〉;〈x9,x4〉;〈x9,x5〉;〈x9,x6〉;〈x9,x7〉
+ ;〈x9,x8〉;〈x9,x9〉;〈x9,xA〉;〈x9,xB〉;〈x9,xC〉;〈x9,xD〉;〈x9,xE〉;〈x9,xF〉
+ ;〈xA,x0〉;〈xA,x1〉;〈xA,x2〉;〈xA,x3〉;〈xA,x4〉;〈xA,x5〉;〈xA,x6〉;〈xA,x7〉
+ ;〈xA,x8〉;〈xA,x9〉;〈xA,xA〉;〈xA,xB〉;〈xA,xC〉;〈xA,xD〉;〈xA,xE〉;〈xA,xF〉
+ ;〈xB,x0〉;〈xB,x1〉;〈xB,x2〉;〈xB,x3〉;〈xB,x4〉;〈xB,x5〉;〈xB,x6〉;〈xB,x7〉
+ ;〈xB,x8〉;〈xB,x9〉;〈xB,xA〉;〈xB,xB〉;〈xB,xC〉;〈xB,xD〉;〈xB,xE〉;〈xB,xF〉
+ ;〈xC,x0〉;〈xC,x1〉;〈xC,x2〉;〈xC,x3〉;〈xC,x4〉;〈xC,x5〉;〈xC,x6〉;〈xC,x7〉
+ ;〈xC,x8〉;〈xC,x9〉;〈xC,xA〉;〈xC,xB〉;〈xC,xC〉;〈xC,xD〉;〈xC,xE〉;〈xC,xF〉
+ ;〈xD,xC〉;〈xD,xD〉
+ ;〈xE,xC〉;〈xE,xD〉
+ ;〈xF,x0〉;〈xF,x1〉;〈xF,x2〉;〈xF,x3〉;〈xF,x4〉;〈xF,x5〉;〈xF,x6〉;〈xF,x7〉
+ ;〈xF,x8〉;〈xF,x9〉;〈xF,xA〉;〈xF,xB〉;〈xF,xC〉;〈xF,xD〉;〈xF,xE〉;〈xF,xF〉
+ ].
+
+(* test bytecode non implementati *)
+nlemma ok_word_table_HC08 : forall_b8 (λb.
+ (test_not_impl_byte b HC08_not_impl_word     ⊙ eq_w16 (get_word_count HC08 b 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_HC08) 〈〈x0,x0〉:〈x0,x1〉〉) ⊗
+ (⊖ (test_not_impl_byte b HC08_not_impl_word) ⊙ eq_w16 (get_word_count HC08 b 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_HC08) 〈〈x0,x0〉:〈x0,x0〉〉))
+ = true.
+ napply refl_eq.
+nqed.
+
+(* tutti op implementati *)
+nlemma ok_pseudo_table_HC08 :
+ forall_op HC08 (λo.
+  le_w16 〈〈x0,x0〉:〈x0,x1〉〉 (get_pseudo_count HC08 o 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_HC08)) = true.
+ napply refl_eq.
+nqed.
+
+(* tutte im implementate *)
+nlemma ok_mode_table_HC08 :
+ forall_im HC08 (λi.
+  le_w16 〈〈x0,x0〉:〈x0,x1〉〉 (get_mode_count HC08 i 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_HC08)) = true.
+ napply refl_eq.
+nqed.
+
+(* nessuna ripetizione di combinazione op + imm *)
+nlemma ok_OpIm_table_HC08 :
+ forall_im HC08 (λi.
+  forall_op HC08 (λo.
+   le_w16 (get_OpIm_count HC08 o i 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_HC08) 〈〈x0,x0〉:〈x0,x1〉〉)) = true.
+ napply refl_eq.
+nqed.
diff --git a/helm/software/matita/contribs/ng_assembly/opcodes/HCS08_opcode_base.ma b/helm/software/matita/contribs/ng_assembly/opcodes/HCS08_opcode_base.ma
new file mode 100755 (executable)
index 0000000..b2962f6
--- /dev/null
@@ -0,0 +1,333 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||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".
+
+(* ********************************************** *)
+(* MATTONI BASE PER DEFINIRE LE TABELLE DELLE MCU *)
+(* ********************************************** *)
+
+(* enumerazione delle modalita' di indirizzamento = caricamento degli operandi *)
+ninductive HCS08_instr_mode: Type ≝
+  (* INHERENT = nessun operando *)
+  MODE_INH  : HCS08_instr_mode
+  (* INHERENT = nessun operando (A implicito) *)
+| MODE_INHA : HCS08_instr_mode
+  (* INHERENT = nessun operando (X implicito) *)
+| MODE_INHX : HCS08_instr_mode
+  (* INHERENT = nessun operando (H implicito) *)
+| MODE_INHH : HCS08_instr_mode
+
+  (* INHERENT_ADDRESS = nessun operando (HX implicito) *)
+| MODE_INHX0ADD : HCS08_instr_mode
+  (* INHERENT_ADDRESS = nessun operando (HX implicito+0x00bb) *)
+| MODE_INHX1ADD : HCS08_instr_mode
+  (* INHERENT_ADDRESS = nessun operando (HX implicito+0xwwww) *)
+| MODE_INHX2ADD : HCS08_instr_mode
+
+  (* IMMEDIATE = operando valore immediato byte = 0xbb *)
+| MODE_IMM1 : HCS08_instr_mode
+  (* IMMEDIATE_EXT = operando valore immediato byte = 0xbb -> esteso a word *)
+| MODE_IMM1EXT : HCS08_instr_mode
+  (* IMMEDIATE = operando valore immediato word = 0xwwww *)
+| MODE_IMM2 : HCS08_instr_mode
+  (* DIRECT = operando offset byte = [0x00bb] *)
+| MODE_DIR1 : HCS08_instr_mode
+  (* DIRECT = operando offset word = [0xwwww] *)
+| MODE_DIR2 : HCS08_instr_mode
+  (* INDEXED = nessun operando (implicito [X] *)
+| MODE_IX0  : HCS08_instr_mode
+  (* INDEXED = operando offset relativo byte = [X+0x00bb] *)
+| MODE_IX1  : HCS08_instr_mode
+  (* INDEXED = operando offset relativo word = [X+0xwwww] *)
+| MODE_IX2  : HCS08_instr_mode
+  (* INDEXED = operando offset relativo byte = [SP+0x00bb] *)
+| MODE_SP1  : HCS08_instr_mode
+  (* INDEXED = operando offset relativo word = [SP+0xwwww] *)
+| MODE_SP2  : HCS08_instr_mode
+
+  (* DIRECT → DIRECT = carica da diretto/scrive su diretto *)
+| MODE_DIR1_to_DIR1 : HCS08_instr_mode
+  (* IMMEDIATE → DIRECT = carica da immediato/scrive su diretto *)
+| MODE_IMM1_to_DIR1 : HCS08_instr_mode
+  (* INDEXED++ → DIRECT = carica da [X]/scrive su diretto/H:X++ *)
+| MODE_IX0p_to_DIR1 : HCS08_instr_mode
+  (* DIRECT → INDEXED++ = carica da diretto/scrive su [X]/H:X++ *)
+| MODE_DIR1_to_IX0p : HCS08_instr_mode
+
+  (* INHERENT(A) + IMMEDIATE *)
+| MODE_INHA_and_IMM1 : HCS08_instr_mode
+  (* INHERENT(X) + IMMEDIATE *)
+| MODE_INHX_and_IMM1 : HCS08_instr_mode
+  (* IMMEDIATE + IMMEDIATE *)
+| MODE_IMM1_and_IMM1 : HCS08_instr_mode
+  (* DIRECT + IMMEDIATE *)
+| MODE_DIR1_and_IMM1 : HCS08_instr_mode
+  (* INDEXED + IMMEDIATE *)
+| MODE_IX0_and_IMM1  : HCS08_instr_mode
+  (* INDEXED++ + IMMEDIATE *)
+| MODE_IX0p_and_IMM1 : HCS08_instr_mode
+  (* INDEXED + IMMEDIATE *)
+| MODE_IX1_and_IMM1  : HCS08_instr_mode
+  (* INDEXED++ + IMMEDIATE *)
+| MODE_IX1p_and_IMM1 : HCS08_instr_mode
+  (* INDEXED + IMMEDIATE *)
+| MODE_SP1_and_IMM1  : HCS08_instr_mode
+
+  (* DIRECT(mTNY) = operando offset byte(maschera scrittura implicita 3 bit) *)
+  (* ex: DIR3 e' carica b, scrivi b con n-simo bit modificato *)
+| MODE_DIRn          : oct → HCS08_instr_mode
+  (* DIRECT(mTNY) + IMMEDIATE = operando offset byte(maschera lettura implicita 3 bit) *)
+  (*                            + operando valore immediato byte  *)
+  (* ex: DIR2_and_IMM1 e' carica b, carica imm, restituisci n-simo bit di b + imm *)
+| MODE_DIRn_and_IMM1 : oct → HCS08_instr_mode
+.
+
+ndefinition eq_HCS08_im ≝
+λi1,i2:HCS08_instr_mode.
+ match i1 with
+  [ MODE_INH ⇒ match i2 with [ MODE_INH ⇒ true | _ ⇒ false ]
+  | MODE_INHA ⇒ match i2 with [ MODE_INHA ⇒ true | _ ⇒ false ]
+  | MODE_INHX ⇒ match i2 with [ MODE_INHX ⇒ true | _ ⇒ false ]
+  | MODE_INHH ⇒ match i2 with [ MODE_INHH ⇒ true | _ ⇒ false ]
+  | MODE_INHX0ADD ⇒ match i2 with [ MODE_INHX0ADD ⇒ true | _ ⇒ false ]
+  | MODE_INHX1ADD ⇒ match i2 with [ MODE_INHX1ADD ⇒ true | _ ⇒ false ]
+  | MODE_INHX2ADD ⇒ match i2 with [ MODE_INHX2ADD ⇒ true | _ ⇒ false ]
+  | MODE_IMM1 ⇒ match i2 with [ MODE_IMM1 ⇒ true | _ ⇒ false ]
+  | MODE_IMM1EXT ⇒ match i2 with [ MODE_IMM1EXT ⇒ true | _ ⇒ false ]
+  | MODE_IMM2 ⇒ match i2 with [ MODE_IMM2 ⇒ true | _ ⇒ false ]
+  | MODE_DIR1 ⇒ match i2 with [ MODE_DIR1 ⇒ true | _ ⇒ false ]
+  | MODE_DIR2 ⇒ match i2 with [ MODE_DIR2 ⇒ true | _ ⇒ false ]
+  | MODE_IX0 ⇒ match i2 with [ MODE_IX0 ⇒ true | _ ⇒ false ]
+  | MODE_IX1 ⇒ match i2 with [ MODE_IX1 ⇒ true | _ ⇒ false ]
+  | MODE_IX2 ⇒ match i2 with [ MODE_IX2 ⇒ true | _ ⇒ false ]
+  | MODE_SP1 ⇒ match i2 with [ MODE_SP1 ⇒ true | _ ⇒ false ]
+  | MODE_SP2 ⇒ match i2 with [ MODE_SP2 ⇒ true | _ ⇒ false ]  
+  | MODE_DIR1_to_DIR1 ⇒ match i2 with [ MODE_DIR1_to_DIR1 ⇒ true | _ ⇒ false ]
+  | MODE_IMM1_to_DIR1 ⇒ match i2 with [ MODE_IMM1_to_DIR1 ⇒ true | _ ⇒ false ]
+  | MODE_IX0p_to_DIR1 ⇒ match i2 with [ MODE_IX0p_to_DIR1 ⇒ true | _ ⇒ false ]
+  | MODE_DIR1_to_IX0p ⇒ match i2 with [ MODE_DIR1_to_IX0p ⇒ true | _ ⇒ false ]
+  | MODE_INHA_and_IMM1 ⇒ match i2 with [ MODE_INHA_and_IMM1 ⇒ true | _ ⇒ false ]
+  | MODE_INHX_and_IMM1 ⇒ match i2 with [ MODE_INHX_and_IMM1 ⇒ true | _ ⇒ false ]
+  | MODE_IMM1_and_IMM1 ⇒ match i2 with [ MODE_IMM1_and_IMM1 ⇒ true | _ ⇒ false ]  
+  | MODE_DIR1_and_IMM1 ⇒ match i2 with [ MODE_DIR1_and_IMM1 ⇒ true | _ ⇒ false ]  
+  | MODE_IX0_and_IMM1 ⇒ match i2 with [ MODE_IX0_and_IMM1 ⇒ true | _ ⇒ false ]  
+  | MODE_IX0p_and_IMM1 ⇒ match i2 with [ MODE_IX0p_and_IMM1 ⇒ true | _ ⇒ false ]  
+  | MODE_IX1_and_IMM1 ⇒ match i2 with [ MODE_IX1_and_IMM1 ⇒ true | _ ⇒ false ]  
+  | MODE_IX1p_and_IMM1 ⇒ match i2 with [ MODE_IX1p_and_IMM1 ⇒ true | _ ⇒ false ]
+  | MODE_SP1_and_IMM1 ⇒ match i2 with [ MODE_SP1_and_IMM1 ⇒ true | _ ⇒ false ]
+  | MODE_DIRn n1 ⇒ match i2 with [ MODE_DIRn n2 ⇒ eq_oct n1 n2 | _ ⇒ false ]  
+  | MODE_DIRn_and_IMM1 n1 ⇒ match i2 with [ MODE_DIRn_and_IMM1 n2  ⇒ eq_oct n1 n2 | _ ⇒ false ]
+  ].    
+
+(* iteratore sulle modalita' *)
+ndefinition forall_HCS08_im ≝ λP:HCS08_instr_mode → bool.
+  P MODE_INH
+⊗ P MODE_INHA
+⊗ P MODE_INHX
+⊗ P MODE_INHH
+⊗ P MODE_INHX0ADD
+⊗ P MODE_INHX1ADD
+⊗ P MODE_INHX2ADD
+⊗ P MODE_IMM1
+⊗ P MODE_IMM1EXT
+⊗ P MODE_IMM2
+⊗ P MODE_DIR1
+⊗ P MODE_DIR2
+⊗ P MODE_IX0
+⊗ P MODE_IX1
+⊗ P MODE_IX2
+⊗ P MODE_SP1
+⊗ P MODE_SP2
+⊗ P MODE_DIR1_to_DIR1
+⊗ P MODE_IMM1_to_DIR1
+⊗ P MODE_IX0p_to_DIR1
+⊗ P MODE_DIR1_to_IX0p
+⊗ P MODE_INHA_and_IMM1
+⊗ P MODE_INHX_and_IMM1
+⊗ P MODE_IMM1_and_IMM1
+⊗ P MODE_DIR1_and_IMM1
+⊗ P MODE_IX0_and_IMM1
+⊗ P MODE_IX0p_and_IMM1
+⊗ P MODE_IX1_and_IMM1
+⊗ P MODE_IX1p_and_IMM1
+⊗ P MODE_SP1_and_IMM1
+⊗ forall_oct (λo. P (MODE_DIRn o))
+⊗ forall_oct (λo. P (MODE_DIRn_and_IMM1 o)).
+
+(* enumerazione delle istruzioni *)
+ninductive HCS08_opcode: Type ≝
+  ADC    : HCS08_opcode (* add with carry *)
+| ADD    : HCS08_opcode (* add *)
+| AIS    : HCS08_opcode (* add immediate to SP *)
+| AIX    : HCS08_opcode (* add immediate to X *)
+| AND    : HCS08_opcode (* and *)
+| ASL    : HCS08_opcode (* aritmetic shift left *)
+| ASR    : HCS08_opcode (* aritmetic shift right *)
+| BCC    : HCS08_opcode (* branch if C=0 *)
+| BCLRn  : HCS08_opcode (* clear bit n *)
+| BCS    : HCS08_opcode (* branch if C=1 *)
+| BEQ    : HCS08_opcode (* branch if Z=1 *)
+| BGE    : HCS08_opcode (* branch if N⊙V=0 (great or equal) *)
+| BGND   : HCS08_opcode (* !!background mode!! *)
+| BGT    : HCS08_opcode (* branch if Z|N⊙V=0 clear (great) *)
+| BHCC   : HCS08_opcode (* branch if H=0 *)
+| BHCS   : HCS08_opcode (* branch if H=1 *)
+| BHI    : HCS08_opcode (* branch if C|Z=0, (higher) *)
+| BIH    : HCS08_opcode (* branch if nIRQ=1 *)
+| BIL    : HCS08_opcode (* branch if nIRQ=0 *)
+| BIT    : HCS08_opcode (* flag = and (bit test) *)
+| BLE    : HCS08_opcode (* branch if Z|N⊙V=1 (less or equal) *)
+| BLS    : HCS08_opcode (* branch if C|Z=1 (lower or same) *)
+| BLT    : HCS08_opcode (* branch if N⊙1=1 (less) *)
+| BMC    : HCS08_opcode (* branch if I=0 (interrupt mask clear) *)
+| BMI    : HCS08_opcode (* branch if N=1 (minus) *)
+| BMS    : HCS08_opcode (* branch if I=1 (interrupt mask set) *)
+| BNE    : HCS08_opcode (* branch if Z=0 *)
+| BPL    : HCS08_opcode (* branch if N=0 (plus) *)
+| BRA    : HCS08_opcode (* branch always *)
+| BRCLRn : HCS08_opcode (* branch if bit n clear *)
+| BRN    : HCS08_opcode (* branch never (nop) *)
+| BRSETn : HCS08_opcode (* branch if bit n set *)
+| BSETn  : HCS08_opcode (* set bit n *)
+| BSR    : HCS08_opcode (* branch to subroutine *)
+| CBEQA  : HCS08_opcode (* compare (A) and BEQ *)
+| CBEQX  : HCS08_opcode (* compare (X) and BEQ *)
+| CLC    : HCS08_opcode (* C=0 *)
+| CLI    : HCS08_opcode (* I=0 *)
+| CLR    : HCS08_opcode (* operand=0 *)
+| CMP    : HCS08_opcode (* flag = sub (compare A) *)
+| COM    : HCS08_opcode (* not (1 complement) *)
+| CPHX   : HCS08_opcode (* flag = sub (compare H:X) *)
+| CPX    : HCS08_opcode (* flag = sub (compare X) *)
+| DAA    : HCS08_opcode (* decimal adjust A *)
+| DBNZ   : HCS08_opcode (* dec and BNE *)
+| DEC    : HCS08_opcode (* operand=operand-1 (decrement) *)
+| DIV    : HCS08_opcode (* div *)
+| EOR    : HCS08_opcode (* xor *)
+| INC    : HCS08_opcode (* operand=operand+1 (increment) *)
+| JMP    : HCS08_opcode (* jmp word [operand] *)
+| JSR    : HCS08_opcode (* jmp to subroutine *)
+| LDA    : HCS08_opcode (* load in A *)
+| LDHX   : HCS08_opcode (* load in H:X *)
+| LDX    : HCS08_opcode (* load in X *)
+| LSR    : HCS08_opcode (* logical shift right *)
+| MOV    : HCS08_opcode (* move *)
+| MUL    : HCS08_opcode (* mul *)
+| NEG    : HCS08_opcode (* neg (2 complement) *)
+| NOP    : HCS08_opcode (* nop *)
+| NSA    : HCS08_opcode (* nibble swap A (al:ah <- ah:al) *)
+| ORA    : HCS08_opcode (* or *)
+| PSHA   : HCS08_opcode (* push A *)
+| PSHH   : HCS08_opcode (* push H *)
+| PSHX   : HCS08_opcode (* push X *)
+| PULA   : HCS08_opcode (* pop A *)
+| PULH   : HCS08_opcode (* pop H *)
+| PULX   : HCS08_opcode (* pop X *)
+| ROL    : HCS08_opcode (* rotate left *)
+| ROR    : HCS08_opcode (* rotate right *)
+| RSP    : HCS08_opcode (* reset SP (0x00FF) *)
+| RTI    : HCS08_opcode (* return from interrupt *)
+| RTS    : HCS08_opcode (* return from subroutine *)
+| SBC    : HCS08_opcode (* sub with carry*)
+| SEC    : HCS08_opcode (* C=1 *)
+| SEI    : HCS08_opcode (* I=1 *)
+| STA    : HCS08_opcode (* store from A *)
+| STHX   : HCS08_opcode (* store from H:X *)
+| STOP   : HCS08_opcode (* !!stop mode!! *)
+| STX    : HCS08_opcode (* store from X *)
+| SUB    : HCS08_opcode (* sub *)
+| SWI    : HCS08_opcode (* software interrupt *)
+| TAP    : HCS08_opcode (* flag=A (transfer A to process status byte *)
+| TAX    : HCS08_opcode (* X=A (transfer A to X) *)
+| TPA    : HCS08_opcode (* A=flag (transfer process status byte to A) *)
+| TST    : HCS08_opcode (* flag = sub (test) *)
+| TSX    : HCS08_opcode (* X:H=SP (transfer SP to H:X) *)
+| TXA    : HCS08_opcode (* A=X (transfer X to A) *)
+| TXS    : HCS08_opcode (* SP=X:H (transfer H:X to SP) *)
+| WAIT   : HCS08_opcode (* !!wait mode!! *)
+.
+
+ndefinition eq_HCS08_op ≝
+λop1,op2:HCS08_opcode.
+ match op1 with
+  [ ADC ⇒ match op2 with [ ADC ⇒ true | _ ⇒ false ]     | ADD ⇒ match op2 with [ ADD ⇒ true | _ ⇒ false ]
+  | AIS ⇒ match op2 with [ AIS ⇒ true | _ ⇒ false ]     | AIX ⇒ match op2 with [ AIX ⇒ true | _ ⇒ false ]
+  | AND ⇒ match op2 with [ AND ⇒ true | _ ⇒ false ]     | ASL ⇒ match op2 with [ ASL ⇒ true | _ ⇒ false ]
+  | ASR ⇒ match op2 with [ ASR ⇒ true | _ ⇒ false ]     | BCC ⇒ match op2 with [ BCC ⇒ true | _ ⇒ false ]
+  | BCLRn ⇒ match op2 with [ BCLRn ⇒ true | _ ⇒ false ] | BCS ⇒ match op2 with [ BCS ⇒ true | _ ⇒ false ]
+  | BEQ ⇒ match op2 with [ BEQ ⇒ true | _ ⇒ false ]     | BGE ⇒ match op2 with [ BGE ⇒ true | _ ⇒ false ]
+  | BGND ⇒ match op2 with [ BGND ⇒ true | _ ⇒ false ]   | BGT ⇒ match op2 with [ BGT ⇒ true | _ ⇒ false ]
+  | BHCC ⇒ match op2 with [ BHCC ⇒ true | _ ⇒ false ]   | BHCS ⇒ match op2 with [ BHCS ⇒ true | _ ⇒ false ]
+  | BHI ⇒ match op2 with [ BHI ⇒ true | _ ⇒ false ]     | BIH ⇒ match op2 with [ BIH ⇒ true | _ ⇒ false ]
+  | BIL ⇒ match op2 with [ BIL ⇒ true | _ ⇒ false ]     | BIT ⇒ match op2 with [ BIT ⇒ true | _ ⇒ false ]
+  | BLE ⇒ match op2 with [ BLE ⇒ true | _ ⇒ false ]     | BLS ⇒ match op2 with [ BLS ⇒ true | _ ⇒ false ]
+  | BLT ⇒ match op2 with [ BLT ⇒ true | _ ⇒ false ]     | BMC ⇒ match op2 with [ BMC ⇒ true | _ ⇒ false ]
+  | BMI ⇒ match op2 with [ BMI ⇒ true | _ ⇒ false ]     | BMS ⇒ match op2 with [ BMS ⇒ true | _ ⇒ false ]
+  | BNE ⇒ match op2 with [ BNE ⇒ true | _ ⇒ false ]     | BPL ⇒ match op2 with [ BPL ⇒ true | _ ⇒ false ]
+  | BRA ⇒ match op2 with [ BRA ⇒ true | _ ⇒ false ]     | BRCLRn ⇒ match op2 with [ BRCLRn ⇒ true | _ ⇒ false ]
+  | BRN ⇒ match op2 with [ BRN ⇒ true | _ ⇒ false ]     | BRSETn ⇒ match op2 with [ BRSETn ⇒ true | _ ⇒ false ]
+  | BSETn ⇒ match op2 with [ BSETn ⇒ true | _ ⇒ false ] | BSR ⇒ match op2 with [ BSR ⇒ true | _ ⇒ false ]
+  | CBEQA ⇒ match op2 with [ CBEQA ⇒ true | _ ⇒ false ] | CBEQX ⇒ match op2 with [ CBEQX ⇒ true | _ ⇒ false ]
+  | CLC ⇒ match op2 with [ CLC ⇒ true | _ ⇒ false ]     | CLI ⇒ match op2 with [ CLI ⇒ true | _ ⇒ false ]
+  | CLR ⇒ match op2 with [ CLR ⇒ true | _ ⇒ false ]     | CMP ⇒ match op2 with [ CMP ⇒ true | _ ⇒ false ]
+  | COM ⇒ match op2 with [ COM ⇒ true | _ ⇒ false ]     | CPHX ⇒ match op2 with [ CPHX ⇒ true | _ ⇒ false ]
+  | CPX ⇒ match op2 with [ CPX ⇒ true | _ ⇒ false ]     | DAA ⇒ match op2 with [ DAA ⇒ true | _ ⇒ false ]
+  | DBNZ ⇒ match op2 with [ DBNZ ⇒ true | _ ⇒ false ]   | DEC ⇒ match op2 with [ DEC ⇒ true | _ ⇒ false ]
+  | DIV ⇒ match op2 with [ DIV ⇒ true | _ ⇒ false ]     | EOR ⇒ match op2 with [ EOR ⇒ true | _ ⇒ false ]
+  | INC ⇒ match op2 with [ INC ⇒ true | _ ⇒ false ]     | JMP ⇒ match op2 with [ JMP ⇒ true | _ ⇒ false ]
+  | JSR ⇒ match op2 with [ JSR ⇒ true | _ ⇒ false ]     | LDA ⇒ match op2 with [ LDA ⇒ true | _ ⇒ false ]
+  | LDHX ⇒ match op2 with [ LDHX ⇒ true | _ ⇒ false ]   | LDX ⇒ match op2 with [ LDX ⇒ true | _ ⇒ false ]
+  | LSR ⇒ match op2 with [ LSR ⇒ true | _ ⇒ false ]     | MOV ⇒ match op2 with [ MOV ⇒ true | _ ⇒ false ]
+  | MUL ⇒ match op2 with [ MUL ⇒ true | _ ⇒ false ]     | NEG ⇒ match op2 with [ NEG ⇒ true | _ ⇒ false ]
+  | NOP ⇒ match op2 with [ NOP ⇒ true | _ ⇒ false ]     | NSA ⇒ match op2 with [ NSA ⇒ true | _ ⇒ false ]
+  | ORA ⇒ match op2 with [ ORA ⇒ true | _ ⇒ false ]     | PSHA ⇒ match op2 with [ PSHA ⇒ true | _ ⇒ false ]
+  | PSHH ⇒ match op2 with [ PSHH ⇒ true | _ ⇒ false ]   | PSHX ⇒ match op2 with [ PSHX ⇒ true | _ ⇒ false ]
+  | PULA ⇒ match op2 with [ PULA ⇒ true | _ ⇒ false ]   | PULH ⇒ match op2 with [ PULH ⇒ true | _ ⇒ false ]
+  | PULX ⇒ match op2 with [ PULX ⇒ true | _ ⇒ false ]   | ROL ⇒ match op2 with [ ROL ⇒ true | _ ⇒ false ]
+  | ROR ⇒ match op2 with [ ROR ⇒ true | _ ⇒ false ]     | RSP ⇒ match op2 with [ RSP ⇒ true | _ ⇒ false ]
+  | RTI ⇒ match op2 with [ RTI ⇒ true | _ ⇒ false ]     | RTS ⇒ match op2 with [ RTS ⇒ true | _ ⇒ false ]
+  | SBC ⇒ match op2 with [ SBC ⇒ true | _ ⇒ false ]     | SEC ⇒ match op2 with [ SEC ⇒ true | _ ⇒ false ]
+  | SEI ⇒ match op2 with [ SEI ⇒ true | _ ⇒ false ]     | STA ⇒ match op2 with [ STA ⇒ true | _ ⇒ false ]
+  | STHX ⇒ match op2 with [ STHX ⇒ true | _ ⇒ false ]   | STOP ⇒ match op2 with [ STOP ⇒ true | _ ⇒ false ]
+  | STX ⇒ match op2 with [ STX ⇒ true | _ ⇒ false ]     | SUB ⇒ match op2 with [ SUB ⇒ true | _ ⇒ false ]
+  | SWI ⇒ match op2 with [ SWI ⇒ true | _ ⇒ false ]     | TAP ⇒ match op2 with [ TAP ⇒ true | _ ⇒ false ]
+  | TAX ⇒ match op2 with [ TAX ⇒ true | _ ⇒ false ]     | TPA ⇒ match op2 with [ TPA ⇒ true | _ ⇒ false ]
+  | TST ⇒ match op2 with [ TST ⇒ true | _ ⇒ false ]     | TSX ⇒ match op2 with [ TSX ⇒ true | _ ⇒ false ]
+  | TXA ⇒ match op2 with [ TXA ⇒ true | _ ⇒ false ]     | TXS ⇒ match op2 with [ TXS ⇒ true | _ ⇒ false ]
+  | WAIT ⇒ match op2 with [ WAIT ⇒ true | _ ⇒ false ]
+  ].
+
+(* iteratore sugli opcode *)
+ndefinition forall_HCS08_op ≝ λP:HCS08_opcode → bool.
+ P ADC    ⊗ P ADD    ⊗ P AIS    ⊗ P AIX    ⊗ P AND    ⊗ P ASL    ⊗ P ASR    ⊗ P BCC    ⊗
+ P BCLRn  ⊗ P BCS    ⊗ P BEQ    ⊗ P BGE    ⊗ P BGND   ⊗ P BGT    ⊗ P BHCC   ⊗ P BHCS   ⊗
+ P BHI    ⊗ P BIH    ⊗ P BIL    ⊗ P BIT    ⊗ P BLE    ⊗ P BLS    ⊗ P BLT    ⊗ P BMC    ⊗
+ P BMI    ⊗ P BMS    ⊗ P BNE    ⊗ P BPL    ⊗ P BRA    ⊗ P BRCLRn ⊗ P BRN    ⊗ P BRSETn ⊗
+ P BSETn  ⊗ P BSR    ⊗ P CBEQA  ⊗ P CBEQX  ⊗ P CLC    ⊗ P CLI    ⊗ P CLR    ⊗ P CMP    ⊗
+ P COM    ⊗ P CPHX   ⊗ P CPX    ⊗ P DAA    ⊗ P DBNZ   ⊗ P DEC    ⊗ P DIV    ⊗ P EOR    ⊗
+ P INC    ⊗ P JMP    ⊗ P JSR    ⊗ P LDA    ⊗ P LDHX   ⊗ P LDX    ⊗ P LSR    ⊗ P MOV    ⊗
+ P MUL    ⊗ P NEG    ⊗ P NOP    ⊗ P NSA    ⊗ P ORA    ⊗ P PSHA   ⊗ P PSHH   ⊗ P PSHX   ⊗
+ P PULA   ⊗ P PULH   ⊗ P PULX   ⊗ P ROL    ⊗ P ROR    ⊗ P RSP    ⊗ P RTI    ⊗ P RTS    ⊗
+ P SBC    ⊗ P SEC    ⊗ P SEI    ⊗ P STA    ⊗ P STHX   ⊗ P STOP   ⊗ P STX    ⊗ P SUB    ⊗
+ P SWI    ⊗ P TAP    ⊗ P TAX    ⊗ P TPA    ⊗ P TST    ⊗ P TSX    ⊗ P TXA    ⊗ P TXS    ⊗
+ P WAIT.
diff --git a/helm/software/matita/contribs/ng_assembly/opcodes/HCS08_table.ma b/helm/software/matita/contribs/ng_assembly/opcodes/HCS08_table.ma
new file mode 100755 (executable)
index 0000000..41ba5d7
--- /dev/null
@@ -0,0 +1,487 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||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 "opcodes/HCS08_opcode_base.ma".
+include "opcodes/byte_or_word.ma".
+include "common/list.ma".
+
+(* ****************** *)
+(* TABELLA DELL'HCS08 *)
+(* ****************** *)
+
+(* definizione come concatenazione finale di liste per velocizzare il parsing *)
+(* ogni riga e' (any_opcode m) (instr_mode) (opcode esadecimale) (#cicli esecuzione) *)
+(* NB: l'uso di any_opcode m + concatenazione finale tutte liste
+       impedisce di introdurre opcode disomogenei (per mcu) *)
+
+ndefinition opcode_table_HCS08_1 ≝
+[
+  quadruple … ADC MODE_IMM1 (Byte 〈xA,x9〉) 〈x0,x2〉
+; quadruple … ADC MODE_DIR1 (Byte 〈xB,x9〉) 〈x0,x3〉
+; quadruple … ADC MODE_DIR2 (Byte 〈xC,x9〉) 〈x0,x4〉
+; quadruple … ADC MODE_IX2  (Byte 〈xD,x9〉) 〈x0,x4〉
+; quadruple … ADC MODE_IX1  (Byte 〈xE,x9〉) 〈x0,x3〉
+; quadruple … ADC MODE_IX0  (Byte 〈xF,x9〉) 〈x0,x3〉
+; quadruple … ADC MODE_SP2  (Word 〈〈x9,xE〉:〈xD,x9〉〉) 〈x0,x5〉
+; quadruple … ADC MODE_SP1  (Word 〈〈x9,xE〉:〈xE,x9〉〉) 〈x0,x4〉
+].
+
+ndefinition opcode_table_HCS08_2 ≝
+[
+  quadruple … ADD MODE_IMM1 (Byte 〈xA,xB〉) 〈x0,x2〉
+; quadruple … ADD MODE_DIR1 (Byte 〈xB,xB〉) 〈x0,x3〉
+; quadruple … ADD MODE_DIR2 (Byte 〈xC,xB〉) 〈x0,x4〉
+; quadruple … ADD MODE_IX2  (Byte 〈xD,xB〉) 〈x0,x4〉
+; quadruple … ADD MODE_IX1  (Byte 〈xE,xB〉) 〈x0,x3〉
+; quadruple … ADD MODE_IX0  (Byte 〈xF,xB〉) 〈x0,x3〉
+; quadruple … ADD MODE_SP2  (Word 〈〈x9,xE〉:〈xD,xB〉〉) 〈x0,x5〉
+; quadruple … ADD MODE_SP1  (Word 〈〈x9,xE〉:〈xE,xB〉〉) 〈x0,x4〉
+].
+
+ndefinition opcode_table_HCS08_3 ≝
+[
+  quadruple … AND MODE_IMM1 (Byte 〈xA,x4〉) 〈x0,x2〉
+; quadruple … AND MODE_DIR1 (Byte 〈xB,x4〉) 〈x0,x3〉
+; quadruple … AND MODE_DIR2 (Byte 〈xC,x4〉) 〈x0,x4〉
+; quadruple … AND MODE_IX2  (Byte 〈xD,x4〉) 〈x0,x4〉
+; quadruple … AND MODE_IX1  (Byte 〈xE,x4〉) 〈x0,x3〉
+; quadruple … AND MODE_IX0  (Byte 〈xF,x4〉) 〈x0,x3〉
+; quadruple … AND MODE_SP2  (Word 〈〈x9,xE〉:〈xD,x4〉〉) 〈x0,x5〉
+; quadruple … AND MODE_SP1  (Word 〈〈x9,xE〉:〈xE,x4〉〉) 〈x0,x4〉
+].
+
+ndefinition opcode_table_HCS08_4 ≝
+[
+  quadruple … ASL MODE_DIR1 (Byte 〈x3,x8〉) 〈x0,x5〉
+; quadruple … ASL MODE_INHA (Byte 〈x4,x8〉) 〈x0,x1〉
+; quadruple … ASL MODE_INHX (Byte 〈x5,x8〉) 〈x0,x1〉
+; quadruple … ASL MODE_IX1  (Byte 〈x6,x8〉) 〈x0,x5〉
+; quadruple … ASL MODE_IX0  (Byte 〈x7,x8〉) 〈x0,x4〉
+; quadruple … ASL MODE_SP1  (Word 〈〈x9,xE〉:〈x6,x8〉〉) 〈x0,x6〉
+].
+
+ndefinition opcode_table_HCS08_5 ≝
+[
+  quadruple … ASR MODE_DIR1 (Byte 〈x3,x7〉) 〈x0,x5〉
+; quadruple … ASR MODE_INHA (Byte 〈x4,x7〉) 〈x0,x1〉
+; quadruple … ASR MODE_INHX (Byte 〈x5,x7〉) 〈x0,x1〉
+; quadruple … ASR MODE_IX1  (Byte 〈x6,x7〉) 〈x0,x5〉
+; quadruple … ASR MODE_IX0  (Byte 〈x7,x7〉) 〈x0,x4〉
+; quadruple … ASR MODE_SP1  (Word 〈〈x9,xE〉:〈x6,x7〉〉) 〈x0,x6〉
+].
+
+ndefinition opcode_table_HCS08_6 ≝
+[
+  quadruple … BRA  MODE_IMM1 (Byte 〈x2,x0〉) 〈x0,x3〉
+; quadruple … BRN  MODE_IMM1 (Byte 〈x2,x1〉) 〈x0,x3〉
+; quadruple … BHI  MODE_IMM1 (Byte 〈x2,x2〉) 〈x0,x3〉
+; quadruple … BLS  MODE_IMM1 (Byte 〈x2,x3〉) 〈x0,x3〉
+; quadruple … BCC  MODE_IMM1 (Byte 〈x2,x4〉) 〈x0,x3〉
+; quadruple … BCS  MODE_IMM1 (Byte 〈x2,x5〉) 〈x0,x3〉
+; quadruple … BNE  MODE_IMM1 (Byte 〈x2,x6〉) 〈x0,x3〉
+; quadruple … BEQ  MODE_IMM1 (Byte 〈x2,x7〉) 〈x0,x3〉
+; quadruple … BHCC MODE_IMM1 (Byte 〈x2,x8〉) 〈x0,x3〉
+; quadruple … BHCS MODE_IMM1 (Byte 〈x2,x9〉) 〈x0,x3〉
+; quadruple … BPL  MODE_IMM1 (Byte 〈x2,xA〉) 〈x0,x3〉
+; quadruple … BMI  MODE_IMM1 (Byte 〈x2,xB〉) 〈x0,x3〉
+; quadruple … BMC  MODE_IMM1 (Byte 〈x2,xC〉) 〈x0,x3〉
+; quadruple … BMS  MODE_IMM1 (Byte 〈x2,xD〉) 〈x0,x3〉
+; quadruple … BIL  MODE_IMM1 (Byte 〈x2,xE〉) 〈x0,x3〉
+; quadruple … BIH  MODE_IMM1 (Byte 〈x2,xF〉) 〈x0,x3〉
+; quadruple … BGE  MODE_IMM1 (Byte 〈x9,x0〉) 〈x0,x3〉
+; quadruple … BLT  MODE_IMM1 (Byte 〈x9,x1〉) 〈x0,x3〉
+; quadruple … BGT  MODE_IMM1 (Byte 〈x9,x2〉) 〈x0,x3〉
+; quadruple … BLE  MODE_IMM1 (Byte 〈x9,x3〉) 〈x0,x3〉
+].
+
+ndefinition opcode_table_HCS08_7 ≝
+[
+  quadruple … BSETn (MODE_DIRn o0) (Byte 〈x1,x0〉) 〈x0,x5〉
+; quadruple … BCLRn (MODE_DIRn o0) (Byte 〈x1,x1〉) 〈x0,x5〉
+; quadruple … BSETn (MODE_DIRn o1) (Byte 〈x1,x2〉) 〈x0,x5〉
+; quadruple … BCLRn (MODE_DIRn o1) (Byte 〈x1,x3〉) 〈x0,x5〉
+; quadruple … BSETn (MODE_DIRn o2) (Byte 〈x1,x4〉) 〈x0,x5〉
+; quadruple … BCLRn (MODE_DIRn o2) (Byte 〈x1,x5〉) 〈x0,x5〉
+; quadruple … BSETn (MODE_DIRn o3) (Byte 〈x1,x6〉) 〈x0,x5〉
+; quadruple … BCLRn (MODE_DIRn o3) (Byte 〈x1,x7〉) 〈x0,x5〉
+; quadruple … BSETn (MODE_DIRn o4) (Byte 〈x1,x8〉) 〈x0,x5〉
+; quadruple … BCLRn (MODE_DIRn o4) (Byte 〈x1,x9〉) 〈x0,x5〉
+; quadruple … BSETn (MODE_DIRn o5) (Byte 〈x1,xA〉) 〈x0,x5〉
+; quadruple … BCLRn (MODE_DIRn o5) (Byte 〈x1,xB〉) 〈x0,x5〉
+; quadruple … BSETn (MODE_DIRn o6) (Byte 〈x1,xC〉) 〈x0,x5〉
+; quadruple … BCLRn (MODE_DIRn o6) (Byte 〈x1,xD〉) 〈x0,x5〉
+; quadruple … BSETn (MODE_DIRn o7) (Byte 〈x1,xE〉) 〈x0,x5〉
+; quadruple … BCLRn (MODE_DIRn o7) (Byte 〈x1,xF〉) 〈x0,x5〉
+].
+
+ndefinition opcode_table_HCS08_8 ≝
+[
+  quadruple … BRSETn (MODE_DIRn_and_IMM1 o0) (Byte 〈x0,x0〉) 〈x0,x5〉
+; quadruple … BRCLRn (MODE_DIRn_and_IMM1 o0) (Byte 〈x0,x1〉) 〈x0,x5〉
+; quadruple … BRSETn (MODE_DIRn_and_IMM1 o1) (Byte 〈x0,x2〉) 〈x0,x5〉
+; quadruple … BRCLRn (MODE_DIRn_and_IMM1 o1) (Byte 〈x0,x3〉) 〈x0,x5〉
+; quadruple … BRSETn (MODE_DIRn_and_IMM1 o2) (Byte 〈x0,x4〉) 〈x0,x5〉
+; quadruple … BRCLRn (MODE_DIRn_and_IMM1 o2) (Byte 〈x0,x5〉) 〈x0,x5〉
+; quadruple … BRSETn (MODE_DIRn_and_IMM1 o3) (Byte 〈x0,x6〉) 〈x0,x5〉
+; quadruple … BRCLRn (MODE_DIRn_and_IMM1 o3) (Byte 〈x0,x7〉) 〈x0,x5〉
+; quadruple … BRSETn (MODE_DIRn_and_IMM1 o4) (Byte 〈x0,x8〉) 〈x0,x5〉
+; quadruple … BRCLRn (MODE_DIRn_and_IMM1 o4) (Byte 〈x0,x9〉) 〈x0,x5〉
+; quadruple … BRSETn (MODE_DIRn_and_IMM1 o5) (Byte 〈x0,xA〉) 〈x0,x5〉
+; quadruple … BRCLRn (MODE_DIRn_and_IMM1 o5) (Byte 〈x0,xB〉) 〈x0,x5〉
+; quadruple … BRSETn (MODE_DIRn_and_IMM1 o6) (Byte 〈x0,xC〉) 〈x0,x5〉
+; quadruple … BRCLRn (MODE_DIRn_and_IMM1 o6) (Byte 〈x0,xD〉) 〈x0,x5〉
+; quadruple … BRSETn (MODE_DIRn_and_IMM1 o7) (Byte 〈x0,xE〉) 〈x0,x5〉
+; quadruple … BRCLRn (MODE_DIRn_and_IMM1 o7) (Byte 〈x0,xF〉) 〈x0,x5〉
+].
+
+ndefinition opcode_table_HCS08_9 ≝
+[
+  quadruple … BIT MODE_IMM1 (Byte 〈xA,x5〉) 〈x0,x2〉
+; quadruple … BIT MODE_DIR1 (Byte 〈xB,x5〉) 〈x0,x3〉
+; quadruple … BIT MODE_DIR2 (Byte 〈xC,x5〉) 〈x0,x4〉
+; quadruple … BIT MODE_IX2  (Byte 〈xD,x5〉) 〈x0,x4〉
+; quadruple … BIT MODE_IX1  (Byte 〈xE,x5〉) 〈x0,x3〉
+; quadruple … BIT MODE_IX0  (Byte 〈xF,x5〉) 〈x0,x3〉
+; quadruple … BIT MODE_SP2  (Word 〈〈x9,xE〉:〈xD,x5〉〉) 〈x0,x5〉
+; quadruple … BIT MODE_SP1  (Word 〈〈x9,xE〉:〈xE,x5〉〉) 〈x0,x4〉
+].
+
+ndefinition opcode_table_HCS08_10 ≝
+[
+  quadruple … MUL  MODE_INH  (Byte 〈x4,x2〉) 〈x0,x5〉
+; quadruple … DIV  MODE_INH  (Byte 〈x5,x2〉) 〈x0,x6〉
+; quadruple … NSA  MODE_INH  (Byte 〈x6,x2〉) 〈x0,x1〉
+; quadruple … DAA  MODE_INH  (Byte 〈x7,x2〉) 〈x0,x1〉
+; quadruple … RTI  MODE_INH  (Byte 〈x8,x0〉) 〈x0,x9〉
+; quadruple … RTS  MODE_INH  (Byte 〈x8,x1〉) 〈x0,x6〉
+; quadruple … SWI  MODE_INH  (Byte 〈x8,x3〉) 〈x0,xB〉
+; quadruple … BGND MODE_INH  (Byte 〈x8,x2〉) 〈x0,x5〉
+; quadruple … TAP  MODE_INH  (Byte 〈x8,x4〉) 〈x0,x1〉
+; quadruple … TPA  MODE_INH  (Byte 〈x8,x5〉) 〈x0,x1〉
+; quadruple … PULA MODE_INH  (Byte 〈x8,x6〉) 〈x0,x3〉
+; quadruple … PSHA MODE_INH  (Byte 〈x8,x7〉) 〈x0,x2〉
+; quadruple … PULX MODE_INH  (Byte 〈x8,x8〉) 〈x0,x3〉
+; quadruple … PSHX MODE_INH  (Byte 〈x8,x9〉) 〈x0,x2〉
+; quadruple … PULH MODE_INH  (Byte 〈x8,xA〉) 〈x0,x3〉
+; quadruple … PSHH MODE_INH  (Byte 〈x8,xB〉) 〈x0,x2〉
+; quadruple … STOP MODE_INH  (Byte 〈x8,xE〉) 〈x0,x2〉
+; quadruple … WAIT MODE_INH  (Byte 〈x8,xF〉) 〈x0,x2〉
+; quadruple … TXS  MODE_INH  (Byte 〈x9,x4〉) 〈x0,x2〉
+; quadruple … TSX  MODE_INH  (Byte 〈x9,x5〉) 〈x0,x2〉
+; quadruple … TAX  MODE_INH  (Byte 〈x9,x7〉) 〈x0,x1〉
+; quadruple … CLC  MODE_INH  (Byte 〈x9,x8〉) 〈x0,x1〉
+; quadruple … SEC  MODE_INH  (Byte 〈x9,x9〉) 〈x0,x1〉
+; quadruple … CLI  MODE_INH  (Byte 〈x9,xA〉) 〈x0,x1〉
+; quadruple … SEI  MODE_INH  (Byte 〈x9,xB〉) 〈x0,x1〉
+; quadruple … RSP  MODE_INH  (Byte 〈x9,xC〉) 〈x0,x1〉
+; quadruple … NOP  MODE_INH  (Byte 〈x9,xD〉) 〈x0,x1〉
+; quadruple … TXA  MODE_INH  (Byte 〈x9,xF〉) 〈x0,x1〉
+; quadruple … AIS  MODE_IMM1 (Byte 〈xA,x7〉) 〈x0,x2〉
+; quadruple … AIX  MODE_IMM1 (Byte 〈xA,xF〉) 〈x0,x2〉
+].
+
+ndefinition opcode_table_HCS08_11 ≝
+[
+  quadruple … CBEQA MODE_DIR1_and_IMM1 (Byte 〈x3,x1〉) 〈x0,x5〉
+; quadruple … CBEQA MODE_IMM1_and_IMM1 (Byte 〈x4,x1〉) 〈x0,x4〉
+; quadruple … CBEQX MODE_IMM1_and_IMM1 (Byte 〈x5,x1〉) 〈x0,x4〉
+; quadruple … CBEQA MODE_IX1p_and_IMM1 (Byte 〈x6,x1〉) 〈x0,x5〉
+; quadruple … CBEQA MODE_IX0p_and_IMM1 (Byte 〈x7,x1〉) 〈x0,x5〉
+; quadruple … CBEQA MODE_SP1_and_IMM1  (Word 〈〈x9,xE〉:〈x6,x1〉〉) 〈x0,x6〉
+].
+
+ndefinition opcode_table_HCS08_12 ≝
+[
+  quadruple … CLR MODE_DIR1 (Byte 〈x3,xF〉) 〈x0,x5〉
+; quadruple … CLR MODE_INHA (Byte 〈x4,xF〉) 〈x0,x1〉
+; quadruple … CLR MODE_INHX (Byte 〈x5,xF〉) 〈x0,x1〉
+; quadruple … CLR MODE_IX1  (Byte 〈x6,xF〉) 〈x0,x5〉
+; quadruple … CLR MODE_IX0  (Byte 〈x7,xF〉) 〈x0,x4〉
+; quadruple … CLR MODE_INHH (Byte 〈x8,xC〉) 〈x0,x1〉
+; quadruple … CLR MODE_SP1  (Word 〈〈x9,xE〉:〈x6,xF〉〉) 〈x0,x6〉
+].
+
+ndefinition opcode_table_HCS08_13 ≝
+[
+  quadruple … CMP MODE_IMM1 (Byte 〈xA,x1〉) 〈x0,x2〉
+; quadruple … CMP MODE_DIR1 (Byte 〈xB,x1〉) 〈x0,x3〉
+; quadruple … CMP MODE_DIR2 (Byte 〈xC,x1〉) 〈x0,x4〉
+; quadruple … CMP MODE_IX2  (Byte 〈xD,x1〉) 〈x0,x4〉
+; quadruple … CMP MODE_IX1  (Byte 〈xE,x1〉) 〈x0,x3〉
+; quadruple … CMP MODE_IX0  (Byte 〈xF,x1〉) 〈x0,x3〉
+; quadruple … CMP MODE_SP2  (Word 〈〈x9,xE〉:〈xD,x1〉〉) 〈x0,x5〉
+; quadruple … CMP MODE_SP1  (Word 〈〈x9,xE〉:〈xE,x1〉〉) 〈x0,x4〉
+].
+
+ndefinition opcode_table_HCS08_14 ≝
+[
+  quadruple … COM MODE_DIR1 (Byte 〈x3,x3〉) 〈x0,x5〉
+; quadruple … COM MODE_INHA (Byte 〈x4,x3〉) 〈x0,x1〉
+; quadruple … COM MODE_INHX (Byte 〈x5,x3〉) 〈x0,x1〉
+; quadruple … COM MODE_IX1  (Byte 〈x6,x3〉) 〈x0,x5〉
+; quadruple … COM MODE_IX0  (Byte 〈x7,x3〉) 〈x0,x4〉
+; quadruple … COM MODE_SP1  (Word 〈〈x9,xE〉:〈x6,x3〉〉) 〈x0,x6〉
+].
+
+ndefinition opcode_table_HCS08_15 ≝
+[
+  quadruple … CPHX MODE_DIR2 (Byte 〈x3,xE〉) 〈x0,x6〉
+; quadruple … CPHX MODE_IMM2 (Byte 〈x6,x5〉) 〈x0,x3〉
+; quadruple … CPHX MODE_DIR1 (Byte 〈x7,x5〉) 〈x0,x5〉
+; quadruple … CPHX MODE_SP1  (Word 〈〈x9,xE〉:〈xF,x3〉〉) 〈x0,x6〉
+
+; quadruple … LDHX MODE_DIR2 (Byte 〈x3,x2〉) 〈x0,x5〉
+; quadruple … LDHX MODE_IMM2 (Byte 〈x4,x5〉) 〈x0,x3〉
+; quadruple … LDHX MODE_DIR1 (Byte 〈x5,x5〉) 〈x0,x4〉
+; quadruple … LDHX MODE_IX0  (Word 〈〈x9,xE〉:〈xA,xE〉〉) 〈x0,x5〉
+; quadruple … LDHX MODE_IX2  (Word 〈〈x9,xE〉:〈xB,xE〉〉) 〈x0,x6〉
+; quadruple … LDHX MODE_IX1  (Word 〈〈x9,xE〉:〈xC,xE〉〉) 〈x0,x5〉
+; quadruple … LDHX MODE_SP1  (Word 〈〈x9,xE〉:〈xF,xE〉〉) 〈x0,x5〉
+
+; quadruple … STHX MODE_DIR1 (Byte 〈x3,x5〉) 〈x0,x4〉
+; quadruple … STHX MODE_DIR2 (Byte 〈x9,x6〉) 〈x0,x5〉
+; quadruple … STHX MODE_SP1  (Word 〈〈x9,xE〉:〈xF,xF〉〉) 〈x0,x5〉
+].
+
+ndefinition opcode_table_HCS08_16 ≝
+[
+  quadruple … CPX MODE_IMM1 (Byte 〈xA,x3〉) 〈x0,x2〉
+; quadruple … CPX MODE_DIR1 (Byte 〈xB,x3〉) 〈x0,x3〉
+; quadruple … CPX MODE_DIR2 (Byte 〈xC,x3〉) 〈x0,x4〉
+; quadruple … CPX MODE_IX2  (Byte 〈xD,x3〉) 〈x0,x4〉
+; quadruple … CPX MODE_IX1  (Byte 〈xE,x3〉) 〈x0,x3〉
+; quadruple … CPX MODE_IX0  (Byte 〈xF,x3〉) 〈x0,x3〉
+; quadruple … CPX MODE_SP2  (Word 〈〈x9,xE〉:〈xD,x3〉〉) 〈x0,x5〉
+; quadruple … CPX MODE_SP1  (Word 〈〈x9,xE〉:〈xE,x3〉〉) 〈x0,x4〉
+].
+
+ndefinition opcode_table_HCS08_17 ≝
+[
+  quadruple … DBNZ MODE_DIR1_and_IMM1 (Byte 〈x3,xB〉) 〈x0,x7〉
+; quadruple … DBNZ MODE_INHA_and_IMM1 (Byte 〈x4,xB〉) 〈x0,x4〉
+; quadruple … DBNZ MODE_INHX_and_IMM1 (Byte 〈x5,xB〉) 〈x0,x4〉
+; quadruple … DBNZ MODE_IX1_and_IMM1  (Byte 〈x6,xB〉) 〈x0,x7〉
+; quadruple … DBNZ MODE_IX0_and_IMM1  (Byte 〈x7,xB〉) 〈x0,x6〉
+; quadruple … DBNZ MODE_SP1_and_IMM1  (Word 〈〈x9,xE〉:〈x6,xB〉〉) 〈x0,x8〉
+].
+
+ndefinition opcode_table_HCS08_18 ≝
+[
+  quadruple … DEC MODE_DIR1 (Byte 〈x3,xA〉) 〈x0,x5〉
+; quadruple … DEC MODE_INHA (Byte 〈x4,xA〉) 〈x0,x1〉
+; quadruple … DEC MODE_INHX (Byte 〈x5,xA〉) 〈x0,x1〉
+; quadruple … DEC MODE_IX1  (Byte 〈x6,xA〉) 〈x0,x5〉
+; quadruple … DEC MODE_IX0  (Byte 〈x7,xA〉) 〈x0,x4〉
+; quadruple … DEC MODE_SP1  (Word 〈〈x9,xE〉:〈x6,xA〉〉) 〈x0,x6〉
+].
+
+ndefinition opcode_table_HCS08_19 ≝
+[
+  quadruple … EOR MODE_IMM1 (Byte 〈xA,x8〉) 〈x0,x2〉
+; quadruple … EOR MODE_DIR1 (Byte 〈xB,x8〉) 〈x0,x3〉
+; quadruple … EOR MODE_DIR2 (Byte 〈xC,x8〉) 〈x0,x4〉
+; quadruple … EOR MODE_IX2  (Byte 〈xD,x8〉) 〈x0,x4〉
+; quadruple … EOR MODE_IX1  (Byte 〈xE,x8〉) 〈x0,x3〉
+; quadruple … EOR MODE_IX0  (Byte 〈xF,x8〉) 〈x0,x3〉
+; quadruple … EOR MODE_SP2  (Word 〈〈x9,xE〉:〈xD,x8〉〉) 〈x0,x5〉
+; quadruple … EOR MODE_SP1  (Word 〈〈x9,xE〉:〈xE,x8〉〉) 〈x0,x4〉
+].
+
+ndefinition opcode_table_HCS08_20 ≝
+[
+  quadruple … INC MODE_DIR1 (Byte 〈x3,xC〉) 〈x0,x5〉
+; quadruple … INC MODE_INHA (Byte 〈x4,xC〉) 〈x0,x1〉
+; quadruple … INC MODE_INHX (Byte 〈x5,xC〉) 〈x0,x1〉
+; quadruple … INC MODE_IX1  (Byte 〈x6,xC〉) 〈x0,x5〉
+; quadruple … INC MODE_IX0  (Byte 〈x7,xC〉) 〈x0,x4〉
+; quadruple … INC MODE_SP1  (Word 〈〈x9,xE〉:〈x6,xC〉〉) 〈x0,x6〉
+].
+
+ndefinition opcode_table_HCS08_21 ≝
+[
+  quadruple … JMP MODE_IMM1EXT  (Byte 〈xB,xC〉) 〈x0,x3〉
+; quadruple … JMP MODE_IMM2     (Byte 〈xC,xC〉) 〈x0,x4〉
+; quadruple … JMP MODE_INHX2ADD (Byte 〈xD,xC〉) 〈x0,x4〉
+; quadruple … JMP MODE_INHX1ADD (Byte 〈xE,xC〉) 〈x0,x3〉
+; quadruple … JMP MODE_INHX0ADD (Byte 〈xF,xC〉) 〈x0,x3〉
+].
+
+ndefinition opcode_table_HCS08_22 ≝
+[
+  quadruple … BSR MODE_IMM1     (Byte 〈xA,xD〉) 〈x0,x5〉
+; quadruple … JSR MODE_IMM1EXT  (Byte 〈xB,xD〉) 〈x0,x5〉
+; quadruple … JSR MODE_IMM2     (Byte 〈xC,xD〉) 〈x0,x6〉
+; quadruple … JSR MODE_INHX2ADD (Byte 〈xD,xD〉) 〈x0,x6〉
+; quadruple … JSR MODE_INHX1ADD (Byte 〈xE,xD〉) 〈x0,x5〉
+; quadruple … JSR MODE_INHX0ADD (Byte 〈xF,xD〉) 〈x0,x5〉
+].
+
+ndefinition opcode_table_HCS08_23 ≝
+[
+  quadruple … LDA MODE_IMM1 (Byte 〈xA,x6〉) 〈x0,x2〉
+; quadruple … LDA MODE_DIR1 (Byte 〈xB,x6〉) 〈x0,x3〉
+; quadruple … LDA MODE_DIR2 (Byte 〈xC,x6〉) 〈x0,x4〉
+; quadruple … LDA MODE_IX2  (Byte 〈xD,x6〉) 〈x0,x4〉
+; quadruple … LDA MODE_IX1  (Byte 〈xE,x6〉) 〈x0,x3〉
+; quadruple … LDA MODE_IX0  (Byte 〈xF,x6〉) 〈x0,x3〉
+; quadruple … LDA MODE_SP2  (Word 〈〈x9,xE〉:〈xD,x6〉〉) 〈x0,x5〉
+; quadruple … LDA MODE_SP1  (Word 〈〈x9,xE〉:〈xE,x6〉〉) 〈x0,x4〉
+].
+
+ndefinition opcode_table_HCS08_24 ≝
+[
+  quadruple … LDX MODE_IMM1 (Byte 〈xA,xE〉) 〈x0,x2〉
+; quadruple … LDX MODE_DIR1 (Byte 〈xB,xE〉) 〈x0,x3〉
+; quadruple … LDX MODE_DIR2 (Byte 〈xC,xE〉) 〈x0,x4〉
+; quadruple … LDX MODE_IX2  (Byte 〈xD,xE〉) 〈x0,x4〉
+; quadruple … LDX MODE_IX1  (Byte 〈xE,xE〉) 〈x0,x3〉
+; quadruple … LDX MODE_IX0  (Byte 〈xF,xE〉) 〈x0,x3〉
+; quadruple … LDX MODE_SP2  (Word 〈〈x9,xE〉:〈xD,xE〉〉) 〈x0,x5〉
+; quadruple … LDX MODE_SP1  (Word 〈〈x9,xE〉:〈xE,xE〉〉) 〈x0,x4〉
+].
+
+ndefinition opcode_table_HCS08_25 ≝
+[
+  quadruple … LSR MODE_DIR1 (Byte 〈x3,x4〉) 〈x0,x5〉
+; quadruple … LSR MODE_INHA (Byte 〈x4,x4〉) 〈x0,x1〉
+; quadruple … LSR MODE_INHX (Byte 〈x5,x4〉) 〈x0,x1〉
+; quadruple … LSR MODE_IX1  (Byte 〈x6,x4〉) 〈x0,x5〉
+; quadruple … LSR MODE_IX0  (Byte 〈x7,x4〉) 〈x0,x4〉
+; quadruple … LSR MODE_SP1  (Word 〈〈x9,xE〉:〈x6,x4〉〉) 〈x0,x6〉
+].
+
+ndefinition opcode_table_HCS08_26 ≝
+[
+  quadruple … MOV MODE_DIR1_to_DIR1 (Byte 〈x4,xE〉) 〈x0,x5〉
+; quadruple … MOV MODE_DIR1_to_IX0p (Byte 〈x5,xE〉) 〈x0,x5〉
+; quadruple … MOV MODE_IMM1_to_DIR1 (Byte 〈x6,xE〉) 〈x0,x4〉
+; quadruple … MOV MODE_IX0p_to_DIR1 (Byte 〈x7,xE〉) 〈x0,x5〉
+].
+
+ndefinition opcode_table_HCS08_27 ≝
+[
+  quadruple … NEG MODE_DIR1 (Byte 〈x3,x0〉) 〈x0,x5〉
+; quadruple … NEG MODE_INHA (Byte 〈x4,x0〉) 〈x0,x1〉
+; quadruple … NEG MODE_INHX (Byte 〈x5,x0〉) 〈x0,x1〉
+; quadruple … NEG MODE_IX1  (Byte 〈x6,x0〉) 〈x0,x5〉
+; quadruple … NEG MODE_IX0  (Byte 〈x7,x0〉) 〈x0,x4〉
+; quadruple … NEG MODE_SP1  (Word 〈〈x9,xE〉:〈x6,x0〉〉) 〈x0,x6〉
+].
+
+ndefinition opcode_table_HCS08_28 ≝
+[
+  quadruple … ORA MODE_IMM1 (Byte 〈xA,xA〉) 〈x0,x2〉
+; quadruple … ORA MODE_DIR1 (Byte 〈xB,xA〉) 〈x0,x3〉
+; quadruple … ORA MODE_DIR2 (Byte 〈xC,xA〉) 〈x0,x4〉
+; quadruple … ORA MODE_IX2  (Byte 〈xD,xA〉) 〈x0,x4〉
+; quadruple … ORA MODE_IX1  (Byte 〈xE,xA〉) 〈x0,x3〉
+; quadruple … ORA MODE_IX0  (Byte 〈xF,xA〉) 〈x0,x3〉
+; quadruple … ORA MODE_SP2  (Word 〈〈x9,xE〉:〈xD,xA〉〉) 〈x0,x5〉
+; quadruple … ORA MODE_SP1  (Word 〈〈x9,xE〉:〈xE,xA〉〉) 〈x0,x4〉
+].
+
+ndefinition opcode_table_HCS08_29 ≝
+[
+  quadruple … ROL MODE_DIR1 (Byte 〈x3,x9〉) 〈x0,x5〉
+; quadruple … ROL MODE_INHA (Byte 〈x4,x9〉) 〈x0,x1〉
+; quadruple … ROL MODE_INHX (Byte 〈x5,x9〉) 〈x0,x1〉
+; quadruple … ROL MODE_IX1  (Byte 〈x6,x9〉) 〈x0,x5〉
+; quadruple … ROL MODE_IX0  (Byte 〈x7,x9〉) 〈x0,x4〉
+; quadruple … ROL MODE_SP1  (Word 〈〈x9,xE〉:〈x6,x9〉〉) 〈x0,x6〉
+].
+
+ndefinition opcode_table_HCS08_30 ≝
+[
+  quadruple … ROR MODE_DIR1 (Byte 〈x3,x6〉) 〈x0,x5〉
+; quadruple … ROR MODE_INHA (Byte 〈x4,x6〉) 〈x0,x1〉
+; quadruple … ROR MODE_INHX (Byte 〈x5,x6〉) 〈x0,x1〉
+; quadruple … ROR MODE_IX1  (Byte 〈x6,x6〉) 〈x0,x5〉
+; quadruple … ROR MODE_IX0  (Byte 〈x7,x6〉) 〈x0,x4〉
+; quadruple … ROR MODE_SP1  (Word 〈〈x9,xE〉:〈x6,x6〉〉) 〈x0,x6〉
+].
+
+ndefinition opcode_table_HCS08_31 ≝
+[
+  quadruple … SBC MODE_IMM1 (Byte 〈xA,x2〉) 〈x0,x2〉
+; quadruple … SBC MODE_DIR1 (Byte 〈xB,x2〉) 〈x0,x3〉
+; quadruple … SBC MODE_DIR2 (Byte 〈xC,x2〉) 〈x0,x4〉
+; quadruple … SBC MODE_IX2  (Byte 〈xD,x2〉) 〈x0,x4〉
+; quadruple … SBC MODE_IX1  (Byte 〈xE,x2〉) 〈x0,x3〉
+; quadruple … SBC MODE_IX0  (Byte 〈xF,x2〉) 〈x0,x3〉
+; quadruple … SBC MODE_SP2  (Word 〈〈x9,xE〉:〈xD,x2〉〉) 〈x0,x5〉
+; quadruple … SBC MODE_SP1  (Word 〈〈x9,xE〉:〈xE,x2〉〉) 〈x0,x4〉
+].
+
+ndefinition opcode_table_HCS08_32 ≝
+[
+  quadruple … STA MODE_DIR1 (Byte 〈xB,x7〉) 〈x0,x3〉
+; quadruple … STA MODE_DIR2 (Byte 〈xC,x7〉) 〈x0,x4〉
+; quadruple … STA MODE_IX2  (Byte 〈xD,x7〉) 〈x0,x4〉
+; quadruple … STA MODE_IX1  (Byte 〈xE,x7〉) 〈x0,x3〉
+; quadruple … STA MODE_IX0  (Byte 〈xF,x7〉) 〈x0,x2〉
+; quadruple … STA MODE_SP2  (Word 〈〈x9,xE〉:〈xD,x7〉〉) 〈x0,x5〉
+; quadruple … STA MODE_SP1  (Word 〈〈x9,xE〉:〈xE,x7〉〉) 〈x0,x4〉
+].
+
+ndefinition opcode_table_HCS08_33 ≝
+[
+  quadruple … STX MODE_DIR1 (Byte 〈xB,xF〉) 〈x0,x3〉
+; quadruple … STX MODE_DIR2 (Byte 〈xC,xF〉) 〈x0,x4〉
+; quadruple … STX MODE_IX2  (Byte 〈xD,xF〉) 〈x0,x4〉
+; quadruple … STX MODE_IX1  (Byte 〈xE,xF〉) 〈x0,x3〉
+; quadruple … STX MODE_IX0  (Byte 〈xF,xF〉) 〈x0,x2〉
+; quadruple … STX MODE_SP2  (Word 〈〈x9,xE〉:〈xD,xF〉〉) 〈x0,x5〉
+; quadruple … STX MODE_SP1  (Word 〈〈x9,xE〉:〈xE,xF〉〉) 〈x0,x4〉
+].
+
+ndefinition opcode_table_HCS08_34 ≝
+[
+  quadruple … SUB MODE_IMM1 (Byte 〈xA,x0〉) 〈x0,x2〉
+; quadruple … SUB MODE_DIR1 (Byte 〈xB,x0〉) 〈x0,x3〉
+; quadruple … SUB MODE_DIR2 (Byte 〈xC,x0〉) 〈x0,x4〉
+; quadruple … SUB MODE_IX2  (Byte 〈xD,x0〉) 〈x0,x4〉
+; quadruple … SUB MODE_IX1  (Byte 〈xE,x0〉) 〈x0,x3〉
+; quadruple … SUB MODE_IX0  (Byte 〈xF,x0〉) 〈x0,x3〉
+; quadruple … SUB MODE_SP2  (Word 〈〈x9,xE〉:〈xD,x0〉〉) 〈x0,x5〉
+; quadruple … SUB MODE_SP1  (Word 〈〈x9,xE〉:〈xE,x0〉〉) 〈x0,x4〉
+].
+
+ndefinition opcode_table_HCS08_35 ≝
+[
+  quadruple … TST MODE_DIR1 (Byte 〈x3,xD〉) 〈x0,x4〉
+; quadruple … TST MODE_INHA (Byte 〈x4,xD〉) 〈x0,x1〉
+; quadruple … TST MODE_INHX (Byte 〈x5,xD〉) 〈x0,x1〉
+; quadruple … TST MODE_IX1  (Byte 〈x6,xD〉) 〈x0,x4〉
+; quadruple … TST MODE_IX0  (Byte 〈x7,xD〉) 〈x0,x3〉
+; quadruple … TST MODE_SP1  (Word 〈〈x9,xE〉:〈x6,xD〉〉) 〈x0,x5〉
+].
+
+ndefinition opcode_table_HCS08 ≝
+opcode_table_HCS08_1  @ opcode_table_HCS08_2  @ opcode_table_HCS08_3  @ opcode_table_HCS08_4  @
+opcode_table_HCS08_5  @ opcode_table_HCS08_6  @ opcode_table_HCS08_7  @ opcode_table_HCS08_8  @
+opcode_table_HCS08_9  @ opcode_table_HCS08_10 @ opcode_table_HCS08_11 @ opcode_table_HCS08_12 @
+opcode_table_HCS08_13 @ opcode_table_HCS08_14 @ opcode_table_HCS08_15 @ opcode_table_HCS08_16 @
+opcode_table_HCS08_17 @ opcode_table_HCS08_18 @ opcode_table_HCS08_19 @ opcode_table_HCS08_20 @
+opcode_table_HCS08_21 @ opcode_table_HCS08_22 @ opcode_table_HCS08_23 @ opcode_table_HCS08_24 @
+opcode_table_HCS08_25 @ opcode_table_HCS08_26 @ opcode_table_HCS08_27 @ opcode_table_HCS08_28 @
+opcode_table_HCS08_29 @ opcode_table_HCS08_30 @ opcode_table_HCS08_31 @ opcode_table_HCS08_32 @
+opcode_table_HCS08_33 @ opcode_table_HCS08_34 @ opcode_table_HCS08_35.
diff --git a/helm/software/matita/contribs/ng_assembly/opcodes/HCS08_table_tests.ma b/helm/software/matita/contribs/ng_assembly/opcodes/HCS08_table_tests.ma
new file mode 100755 (executable)
index 0000000..862c9c5
--- /dev/null
@@ -0,0 +1,101 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||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 "freescale/opcode.ma".
+
+(* ****************** *)
+(* TABELLA DELL'HCS08 *)
+(* ****************** *)
+
+(* HCS08: opcode non implementati come da manuale (byte) *)
+ndefinition HCS08_not_impl_byte ≝
+ [〈x8,xD〉
+ ;〈x9,xE〉
+ ;〈xA,xC〉
+ ].
+
+(* test bytecode non implementati *)
+nlemma ok_byte_table_HCS08 : forall_b8 (λb.
+ (test_not_impl_byte b HCS08_not_impl_byte     ⊙ eq_w16 (get_byte_count HCS08 b 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_HCS08) 〈〈x0,x0〉:〈x0,x1〉〉) ⊗
+ (⊖ (test_not_impl_byte b HCS08_not_impl_byte) ⊙ eq_w16 (get_byte_count HCS08 b 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_HCS08) 〈〈x0,x0〉:〈x0,x0〉〉))
+ = true.
+ napply refl_eq.
+nqed.
+
+(* HCS08: opcode non implementati come da manuale (0x9E+byte) *)
+ndefinition HCS08_not_impl_word ≝
+ [〈x0,x0〉;〈x0,x1〉;〈x0,x2〉;〈x0,x3〉;〈x0,x4〉;〈x0,x5〉;〈x0,x6〉;〈x0,x7〉
+ ;〈x0,x8〉;〈x0,x9〉;〈x0,xA〉;〈x0,xB〉;〈x0,xC〉;〈x0,xD〉;〈x0,xE〉;〈x0,xF〉
+ ;〈x1,x0〉;〈x1,x1〉;〈x1,x2〉;〈x1,x3〉;〈x1,x4〉;〈x1,x5〉;〈x1,x6〉;〈x1,x7〉
+ ;〈x1,x8〉;〈x1,x9〉;〈x1,xA〉;〈x1,xB〉;〈x1,xC〉;〈x1,xD〉;〈x1,xE〉;〈x1,xF〉
+ ;〈x2,x0〉;〈x2,x1〉;〈x2,x2〉;〈x2,x3〉;〈x2,x4〉;〈x2,x5〉;〈x2,x6〉;〈x2,x7〉
+ ;〈x2,x8〉;〈x2,x9〉;〈x2,xA〉;〈x2,xB〉;〈x2,xC〉;〈x2,xD〉;〈x2,xE〉;〈x2,xF〉
+ ;〈x3,x0〉;〈x3,x1〉;〈x3,x2〉;〈x3,x3〉;〈x3,x4〉;〈x3,x5〉;〈x3,x6〉;〈x3,x7〉
+ ;〈x3,x8〉;〈x3,x9〉;〈x3,xA〉;〈x3,xB〉;〈x3,xC〉;〈x3,xD〉;〈x3,xE〉;〈x3,xF〉
+ ;〈x4,x0〉;〈x4,x1〉;〈x4,x2〉;〈x4,x3〉;〈x4,x4〉;〈x4,x5〉;〈x4,x6〉;〈x4,x7〉
+ ;〈x4,x8〉;〈x4,x9〉;〈x4,xA〉;〈x4,xB〉;〈x4,xC〉;〈x4,xD〉;〈x4,xE〉;〈x4,xF〉
+ ;〈x5,x0〉;〈x5,x1〉;〈x5,x2〉;〈x5,x3〉;〈x5,x4〉;〈x5,x5〉;〈x5,x6〉;〈x5,x7〉
+ ;〈x5,x8〉;〈x5,x9〉;〈x5,xA〉;〈x5,xB〉;〈x5,xC〉;〈x5,xD〉;〈x5,xE〉;〈x5,xF〉
+ ;〈x6,x2〉;〈x6,x5〉;〈x6,xE〉
+ ;〈x7,x0〉;〈x7,x1〉;〈x7,x2〉;〈x7,x3〉;〈x7,x4〉;〈x7,x5〉;〈x7,x6〉;〈x7,x7〉
+ ;〈x7,x8〉;〈x7,x9〉;〈x7,xA〉;〈x7,xB〉;〈x7,xC〉;〈x7,xD〉;〈x7,xE〉;〈x7,xF〉
+ ;〈x8,x0〉;〈x8,x1〉;〈x8,x2〉;〈x8,x3〉;〈x8,x4〉;〈x8,x5〉;〈x8,x6〉;〈x8,x7〉
+ ;〈x8,x8〉;〈x8,x9〉;〈x8,xA〉;〈x8,xB〉;〈x8,xC〉;〈x8,xD〉;〈x8,xE〉;〈x8,xF〉
+ ;〈x9,x0〉;〈x9,x1〉;〈x9,x2〉;〈x9,x3〉;〈x9,x4〉;〈x9,x5〉;〈x9,x6〉;〈x9,x7〉
+ ;〈x9,x8〉;〈x9,x9〉;〈x9,xA〉;〈x9,xB〉;〈x9,xC〉;〈x9,xD〉;〈x9,xE〉;〈x9,xF〉
+ ;〈xA,x0〉;〈xA,x1〉;〈xA,x2〉;〈xA,x3〉;〈xA,x4〉;〈xA,x5〉;〈xA,x6〉;〈xA,x7〉;〈xA,x8〉;〈xA,x9〉;〈xA,xA〉;〈xA,xB〉;〈xA,xC〉;〈xA,xD〉;〈xA,xF〉
+ ;〈xB,x0〉;〈xB,x1〉;〈xB,x2〉;〈xB,x3〉;〈xB,x4〉;〈xB,x5〉;〈xB,x6〉;〈xB,x7〉;〈xB,x8〉;〈xB,x9〉;〈xB,xA〉;〈xB,xB〉;〈xB,xC〉;〈xB,xD〉;〈xB,xF〉
+ ;〈xC,x0〉;〈xC,x1〉;〈xC,x2〉;〈xC,x3〉;〈xC,x4〉;〈xC,x5〉;〈xC,x6〉;〈xC,x7〉;〈xC,x8〉;〈xC,x9〉;〈xC,xA〉;〈xC,xB〉;〈xC,xC〉;〈xC,xD〉;〈xC,xF〉
+ ;〈xD,xC〉;〈xD,xD〉
+ ;〈xE,xC〉;〈xE,xD〉
+ ;〈xF,x0〉;〈xF,x1〉;〈xF,x2〉;〈xF,x4〉;〈xF,x5〉;〈xF,x6〉;〈xF,x7〉;〈xF,x8〉;〈xF,x9〉;〈xF,xA〉;〈xF,xB〉;〈xF,xC〉;〈xF,xD〉
+ ].
+
+(* test bytecode non implementati *)
+nlemma ok_word_table_HCS08 : forall_b8 (λb.
+ (test_not_impl_byte b HCS08_not_impl_word     ⊙ eq_w16 (get_word_count HCS08 b 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_HCS08) 〈〈x0,x0〉:〈x0,x1〉〉) ⊗
+ (⊖ (test_not_impl_byte b HCS08_not_impl_word) ⊙ eq_w16 (get_word_count HCS08 b 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_HCS08) 〈〈x0,x0〉:〈x0,x0〉〉))
+ = true.
+ napply refl_eq.
+nqed.
+
+(* tutti op implementati *)
+nlemma ok_pseudo_table_HCS08 :
+ forall_op HCS08 (λo.
+  le_w16 〈〈x0,x0〉:〈x0,x1〉〉 (get_pseudo_count HCS08 o 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_HCS08)) = true.
+ napply refl_eq.
+nqed.
+
+(* tutte im implementate *)
+nlemma ok_mode_table_HCS08 :
+ forall_im HCS08 (λi.
+  le_w16 〈〈x0,x0〉:〈x0,x1〉〉 (get_mode_count HCS08 i 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_HCS08)) = true.
+ napply refl_eq.
+nqed.
+
+(* nessuna ripetizione di combinazione op + imm *)
+nlemma ok_OpIm_table_HCS08 :
+ forall_im HCS08 (λi.
+  forall_op HCS08 (λo.
+   le_w16 (get_OpIm_count HCS08 o i 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_HCS08) 〈〈x0,x0〉:〈x0,x1〉〉)) = true.
+ napply refl_eq.
+nqed.
diff --git a/helm/software/matita/contribs/ng_assembly/opcodes/RS08_opcode_base.ma b/helm/software/matita/contribs/ng_assembly/opcodes/RS08_opcode_base.ma
new file mode 100755 (executable)
index 0000000..1c98619
--- /dev/null
@@ -0,0 +1,183 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||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".
+
+(* ********************************************** *)
+(* MATTONI BASE PER DEFINIRE LE TABELLE DELLE MCU *)
+(* ********************************************** *)
+
+(* enumerazione delle modalita' di indirizzamento = caricamento degli operandi *)
+ninductive RS08_instr_mode: Type ≝
+  (* INHERENT = nessun operando *)
+  MODE_INH  : RS08_instr_mode
+  (* INHERENT = nessun operando (A implicito) *)
+| MODE_INHA : RS08_instr_mode
+
+  (* IMMEDIATE = operando valore immediato byte = 0xbb *)
+| MODE_IMM1 : RS08_instr_mode
+  (* IMMEDIATE = operando valore immediato word = 0xwwww *)
+| MODE_IMM2 : RS08_instr_mode
+  (* DIRECT = operando offset byte = [0x00bb] *)
+| MODE_DIR1 : RS08_instr_mode
+
+  (* DIRECT → DIRECT = carica da diretto/scrive su diretto *)
+| MODE_DIR1_to_DIR1 : RS08_instr_mode
+  (* IMMEDIATE → DIRECT = carica da immediato/scrive su diretto *)
+| MODE_IMM1_to_DIR1 : RS08_instr_mode
+
+  (* INHERENT(A) + IMMEDIATE *)
+| MODE_INHA_and_IMM1 : RS08_instr_mode
+  (* IMMEDIATE + IMMEDIATE *)
+| MODE_IMM1_and_IMM1 : RS08_instr_mode
+  (* DIRECT + IMMEDIATE *)
+| MODE_DIR1_and_IMM1 : RS08_instr_mode
+
+  (* DIRECT(mTNY) = operando offset byte(maschera scrittura implicita 3 bit) *)
+  (* ex: DIR3 e' carica b, scrivi b con n-simo bit modificato *)
+| MODE_DIRn          : oct → RS08_instr_mode
+  (* DIRECT(mTNY) + IMMEDIATE = operando offset byte(maschera lettura implicita 3 bit) *)
+  (*                            + operando valore immediato byte  *)
+  (* ex: DIR2_and_IMM1 e' carica b, carica imm, restituisci n-simo bit di b + imm *)
+| MODE_DIRn_and_IMM1 : oct → RS08_instr_mode
+  (* TINY = nessun operando (diretto implicito 4bit = [0x00000000:0000iiii]) *)
+| MODE_TNY           : exadecim → RS08_instr_mode
+  (* SHORT = nessun operando (diretto implicito 5bit = [0x00000000:000iiiii]) *)
+| MODE_SRT           : bitrigesim → RS08_instr_mode
+.
+
+ndefinition eq_RS08_im ≝
+λi1,i2:RS08_instr_mode.
+ match i1 with
+  [ MODE_INH ⇒ match i2 with [ MODE_INH ⇒ true | _ ⇒ false ]
+  | MODE_INHA ⇒ match i2 with [ MODE_INHA ⇒ true | _ ⇒ false ]
+  | MODE_IMM1 ⇒ match i2 with [ MODE_IMM1 ⇒ true | _ ⇒ false ]
+  | MODE_IMM2 ⇒ match i2 with [ MODE_IMM2 ⇒ true | _ ⇒ false ]
+  | MODE_DIR1 ⇒ match i2 with [ MODE_DIR1 ⇒ true | _ ⇒ false ]
+  | MODE_DIR1_to_DIR1 ⇒ match i2 with [ MODE_DIR1_to_DIR1 ⇒ true | _ ⇒ false ]
+  | MODE_IMM1_to_DIR1 ⇒ match i2 with [ MODE_IMM1_to_DIR1 ⇒ true | _ ⇒ false ]
+  | MODE_INHA_and_IMM1 ⇒ match i2 with [ MODE_INHA_and_IMM1 ⇒ true | _ ⇒ false ]
+  | MODE_IMM1_and_IMM1 ⇒ match i2 with [ MODE_IMM1_and_IMM1 ⇒ true | _ ⇒ false ]  
+  | MODE_DIR1_and_IMM1 ⇒ match i2 with [ MODE_DIR1_and_IMM1 ⇒ true | _ ⇒ false ]  
+  | MODE_DIRn n1 ⇒ match i2 with [ MODE_DIRn n2 ⇒ eq_oct n1 n2 | _ ⇒ false ]  
+  | MODE_DIRn_and_IMM1 n1 ⇒ match i2 with [ MODE_DIRn_and_IMM1 n2  ⇒ eq_oct n1 n2 | _ ⇒ false ]
+  | MODE_TNY e1 ⇒ match i2 with [ MODE_TNY e2 ⇒ eq_ex e1 e2 | _ ⇒ false ]  
+  | MODE_SRT t1 ⇒ match i2 with [ MODE_SRT t2 ⇒ eq_bit t1 t2 | _ ⇒ false ]  
+  ]. 
+
+(* iteratore sulle modalita' *)
+ndefinition forall_RS08_im ≝ λP:RS08_instr_mode → bool.
+  P MODE_INH
+⊗ P MODE_INHA
+⊗ P MODE_IMM1
+⊗ P MODE_IMM2
+⊗ P MODE_DIR1
+⊗ P MODE_DIR1_to_DIR1
+⊗ P MODE_IMM1_to_DIR1
+⊗ P MODE_INHA_and_IMM1
+⊗ P MODE_IMM1_and_IMM1
+⊗ P MODE_DIR1_and_IMM1
+⊗ forall_oct (λo. P (MODE_DIRn o))
+⊗ forall_oct (λo. P (MODE_DIRn_and_IMM1 o))
+⊗ forall_ex (λe. P (MODE_TNY e))
+⊗ forall_bit (λt. P (MODE_SRT t)).
+
+(* enumerazione delle istruzioni *)
+ninductive RS08_opcode: Type ≝
+  ADC    : RS08_opcode (* add with carry *)
+| ADD    : RS08_opcode (* add *)
+| AND    : RS08_opcode (* and *)
+| ASL    : RS08_opcode (* aritmetic shift left *)
+| BCC    : RS08_opcode (* branch if C=0 *)
+| BCLRn  : RS08_opcode (* clear bit n *)
+| BCS    : RS08_opcode (* branch if C=1 *)
+| BEQ    : RS08_opcode (* branch if Z=1 *)
+| BGND   : RS08_opcode (* !!background mode!! *)
+| BNE    : RS08_opcode (* branch if Z=0 *)
+| BRA    : RS08_opcode (* branch always *)
+| BRCLRn : RS08_opcode (* branch if bit n clear *)
+| BRSETn : RS08_opcode (* branch if bit n set *)
+| BSETn  : RS08_opcode (* set bit n *)
+| BSR    : RS08_opcode (* branch to subroutine *)
+| CBEQA  : RS08_opcode (* compare (A) and BEQ *)
+| CLC    : RS08_opcode (* C=0 *)
+| CLR    : RS08_opcode (* operand=0 *)
+| CMP    : RS08_opcode (* flag = sub (compare A) *)
+| COM    : RS08_opcode (* not (1 complement) *)
+| DBNZ   : RS08_opcode (* dec and BNE *)
+| DEC    : RS08_opcode (* operand=operand-1 (decrement) *)
+| EOR    : RS08_opcode (* xor *)
+| INC    : RS08_opcode (* operand=operand+1 (increment) *)
+| JMP    : RS08_opcode (* jmp word [operand] *)
+| JSR    : RS08_opcode (* jmp to subroutine *)
+| LDA    : RS08_opcode (* load in A *)
+| LSR    : RS08_opcode (* logical shift right *)
+| MOV    : RS08_opcode (* move *)
+| NOP    : RS08_opcode (* nop *)
+| ORA    : RS08_opcode (* or *)
+| ROL    : RS08_opcode (* rotate left *)
+| ROR    : RS08_opcode (* rotate right *)
+| RTS    : RS08_opcode (* return from subroutine *)
+| SBC    : RS08_opcode (* sub with carry*)
+| SEC    : RS08_opcode (* C=1 *)
+| SHA    : RS08_opcode (* swap spc_high,A *)
+| SLA    : RS08_opcode (* swap spc_low,A *)
+| STA    : RS08_opcode (* store from A *)
+| STOP   : RS08_opcode (* !!stop mode!! *)
+| SUB    : RS08_opcode (* sub *)
+| WAIT   : RS08_opcode (* !!wait mode!! *)
+.
+
+ndefinition eq_RS08_op ≝
+λop1,op2:RS08_opcode.
+ match op1 with
+  [ ADC ⇒ match op2 with [ ADC ⇒ true | _ ⇒ false ]       | ADD ⇒ match op2 with [ ADD ⇒ true | _ ⇒ false ]
+  | AND ⇒ match op2 with [ AND ⇒ true | _ ⇒ false ]       | ASL ⇒ match op2 with [ ASL ⇒ true | _ ⇒ false ]
+  | BCC ⇒ match op2 with [ BCC ⇒ true | _ ⇒ false ]       | BCLRn ⇒ match op2 with [ BCLRn ⇒ true | _ ⇒ false ]
+  | BCS ⇒ match op2 with [ BCS ⇒ true | _ ⇒ false ]       | BEQ ⇒ match op2 with [ BEQ ⇒ true | _ ⇒ false ] 
+  | BGND ⇒ match op2 with [ BGND ⇒ true | _ ⇒ false ]     | BNE ⇒ match op2 with [ BNE ⇒ true | _ ⇒ false ] 
+  | BRA ⇒ match op2 with [ BRA ⇒ true | _ ⇒ false ]       | BRCLRn ⇒ match op2 with [ BRCLRn ⇒ true | _ ⇒ false ]
+  | BRSETn ⇒ match op2 with [ BRSETn ⇒ true | _ ⇒ false ] | BSETn ⇒ match op2 with [ BSETn ⇒ true | _ ⇒ false ]
+  | BSR ⇒ match op2 with [ BSR ⇒ true | _ ⇒ false ]       | CBEQA ⇒ match op2 with [ CBEQA ⇒ true | _ ⇒ false ] 
+  | CLC ⇒ match op2 with [ CLC ⇒ true | _ ⇒ false ]       | CLR ⇒ match op2 with [ CLR ⇒ true | _ ⇒ false ]
+  | CMP ⇒ match op2 with [ CMP ⇒ true | _ ⇒ false ]       | COM ⇒ match op2 with [ COM ⇒ true | _ ⇒ false ] 
+  | DBNZ ⇒ match op2 with [ DBNZ ⇒ true | _ ⇒ false ]     | DEC ⇒ match op2 with [ DEC ⇒ true | _ ⇒ false ]
+  | EOR ⇒ match op2 with [ EOR ⇒ true | _ ⇒ false ]       | INC ⇒ match op2 with [ INC ⇒ true | _ ⇒ false ]
+  | JMP ⇒ match op2 with [ JMP ⇒ true | _ ⇒ false ]       | JSR ⇒ match op2 with [ JSR ⇒ true | _ ⇒ false ]
+  | LDA ⇒ match op2 with [ LDA ⇒ true | _ ⇒ false ]       | LSR ⇒ match op2 with [ LSR ⇒ true | _ ⇒ false ]
+  | MOV ⇒ match op2 with [ MOV ⇒ true | _ ⇒ false ]       | NOP ⇒ match op2 with [ NOP ⇒ true | _ ⇒ false ] 
+  | ORA ⇒ match op2 with [ ORA ⇒ true | _ ⇒ false ]       | ROL ⇒ match op2 with [ ROL ⇒ true | _ ⇒ false ]
+  | ROR ⇒ match op2 with [ ROR ⇒ true | _ ⇒ false ]       | RTS ⇒ match op2 with [ RTS ⇒ true | _ ⇒ false ]
+  | SBC ⇒ match op2 with [ SBC ⇒ true | _ ⇒ false ]       | SEC ⇒ match op2 with [ SEC ⇒ true | _ ⇒ false ]
+  | SHA ⇒ match op2 with [ SHA ⇒ true | _ ⇒ false ]       | SLA ⇒ match op2 with [ SLA ⇒ true | _ ⇒ false ]
+  | STA ⇒ match op2 with [ STA ⇒ true | _ ⇒ false ]       | STOP ⇒ match op2 with [ STOP ⇒ true | _ ⇒ false ]
+  | SUB ⇒ match op2 with [ SUB ⇒ true | _ ⇒ false ]       | WAIT ⇒ match op2 with [ WAIT ⇒ true | _ ⇒ false ]
+  ].
+
+(* iteratore sugli opcode *)
+ndefinition forall_RS08_op ≝ λP:RS08_opcode → bool.
+ P ADC    ⊗ P ADD    ⊗ P AND    ⊗ P ASL    ⊗ P BCC    ⊗ P BCLRn  ⊗ P BCS    ⊗ P BEQ    ⊗
+ P BGND   ⊗ P BNE    ⊗ P BRA    ⊗ P BRCLRn ⊗ P BRSETn ⊗ P BSETn  ⊗ P BSR    ⊗ P CBEQA  ⊗
+ P CLC    ⊗ P CLR    ⊗ P CMP    ⊗ P COM    ⊗ P DBNZ   ⊗ P DEC    ⊗ P EOR    ⊗ P INC    ⊗
+ P JMP    ⊗ P JSR    ⊗ P LDA    ⊗ P LSR    ⊗ P MOV    ⊗ P NOP    ⊗ P ORA    ⊗ P ROL    ⊗
+ P ROR    ⊗ P RTS    ⊗ P SBC    ⊗ P SEC    ⊗ P SHA    ⊗ P SLA    ⊗ P STA    ⊗ P STOP   ⊗
+ P SUB    ⊗ P WAIT.
diff --git a/helm/software/matita/contribs/ng_assembly/opcodes/RS08_table.ma b/helm/software/matita/contribs/ng_assembly/opcodes/RS08_table.ma
new file mode 100755 (executable)
index 0000000..b24232b
--- /dev/null
@@ -0,0 +1,396 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||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 "opcodes/RS08_opcode_base.ma".
+include "opcodes/byte_or_word.ma".
+include "common/list.ma".
+
+(* ***************** *)
+(* TABELLA DELL'RS08 *)
+(* ***************** *)
+
+(* definizione come concatenazione finale di liste per velocizzare il parsing *)
+(* ogni riga e' (any_opcode m) (instr_mode) (opcode esadecimale) (#cicli esecuzione) *)
+(* NB: l'uso di any_opcode m + concatenazione finale tutte liste
+       impedisce di introdurre opcode disomogenei (per mcu) *)
+
+ndefinition opcode_table_RS08_1 ≝
+[ 
+  quadruple … ADC MODE_IMM1 (Byte 〈xA,x9〉) 〈x0,x2〉
+; quadruple … ADC MODE_DIR1 (Byte 〈xB,x9〉) 〈x0,x3〉
+].
+
+ndefinition opcode_table_RS08_2 ≝
+[ 
+  quadruple … ADD MODE_IMM1     (Byte 〈xA,xB〉) 〈x0,x2〉
+; quadruple … ADD MODE_DIR1     (Byte 〈xB,xB〉) 〈x0,x3〉
+; quadruple … ADD (MODE_TNY x0) (Byte 〈x6,x0〉) 〈x0,x3〉
+; quadruple … ADD (MODE_TNY x1) (Byte 〈x6,x1〉) 〈x0,x3〉
+; quadruple … ADD (MODE_TNY x2) (Byte 〈x6,x2〉) 〈x0,x3〉
+; quadruple … ADD (MODE_TNY x3) (Byte 〈x6,x3〉) 〈x0,x3〉
+; quadruple … ADD (MODE_TNY x4) (Byte 〈x6,x4〉) 〈x0,x3〉
+; quadruple … ADD (MODE_TNY x5) (Byte 〈x6,x5〉) 〈x0,x3〉
+; quadruple … ADD (MODE_TNY x6) (Byte 〈x6,x6〉) 〈x0,x3〉
+; quadruple … ADD (MODE_TNY x7) (Byte 〈x6,x7〉) 〈x0,x3〉
+; quadruple … ADD (MODE_TNY x8) (Byte 〈x6,x8〉) 〈x0,x3〉
+; quadruple … ADD (MODE_TNY x9) (Byte 〈x6,x9〉) 〈x0,x3〉
+; quadruple … ADD (MODE_TNY xA) (Byte 〈x6,xA〉) 〈x0,x3〉
+; quadruple … ADD (MODE_TNY xB) (Byte 〈x6,xB〉) 〈x0,x3〉
+; quadruple … ADD (MODE_TNY xC) (Byte 〈x6,xC〉) 〈x0,x3〉
+; quadruple … ADD (MODE_TNY xD) (Byte 〈x6,xD〉) 〈x0,x3〉
+; quadruple … ADD (MODE_TNY xE) (Byte 〈x6,xE〉) 〈x0,x3〉
+; quadruple … ADD (MODE_TNY xF) (Byte 〈x6,xF〉) 〈x0,x3〉
+].
+
+ndefinition opcode_table_RS08_3 ≝
+[ 
+  quadruple … AND MODE_IMM1 (Byte 〈xA,x4〉) 〈x0,x2〉
+; quadruple … AND MODE_DIR1 (Byte 〈xB,x4〉) 〈x0,x3〉
+].
+
+ndefinition opcode_table_RS08_4 ≝
+[
+  quadruple … ASL MODE_INHA (Byte 〈x4,x8〉) 〈x0,x1〉
+].
+
+ndefinition opcode_table_RS08_5 ≝
+[
+  quadruple … BRA MODE_IMM1 (Byte 〈x3,x0〉) 〈x0,x3〉
+; quadruple … BCC MODE_IMM1 (Byte 〈x3,x4〉) 〈x0,x3〉
+; quadruple … BCS MODE_IMM1 (Byte 〈x3,x5〉) 〈x0,x3〉
+; quadruple … BNE MODE_IMM1 (Byte 〈x3,x6〉) 〈x0,x3〉
+; quadruple … BEQ MODE_IMM1 (Byte 〈x3,x7〉) 〈x0,x3〉
+].
+
+ndefinition opcode_table_RS08_6 ≝
+[
+  quadruple … BSETn (MODE_DIRn o0) (Byte 〈x1,x0〉) 〈x0,x5〉
+; quadruple … BCLRn (MODE_DIRn o0) (Byte 〈x1,x1〉) 〈x0,x5〉
+; quadruple … BSETn (MODE_DIRn o1) (Byte 〈x1,x2〉) 〈x0,x5〉
+; quadruple … BCLRn (MODE_DIRn o1) (Byte 〈x1,x3〉) 〈x0,x5〉
+; quadruple … BSETn (MODE_DIRn o2) (Byte 〈x1,x4〉) 〈x0,x5〉
+; quadruple … BCLRn (MODE_DIRn o2) (Byte 〈x1,x5〉) 〈x0,x5〉
+; quadruple … BSETn (MODE_DIRn o3) (Byte 〈x1,x6〉) 〈x0,x5〉
+; quadruple … BCLRn (MODE_DIRn o3) (Byte 〈x1,x7〉) 〈x0,x5〉
+; quadruple … BSETn (MODE_DIRn o4) (Byte 〈x1,x8〉) 〈x0,x5〉
+; quadruple … BCLRn (MODE_DIRn o4) (Byte 〈x1,x9〉) 〈x0,x5〉
+; quadruple … BSETn (MODE_DIRn o5) (Byte 〈x1,xA〉) 〈x0,x5〉
+; quadruple … BCLRn (MODE_DIRn o5) (Byte 〈x1,xB〉) 〈x0,x5〉
+; quadruple … BSETn (MODE_DIRn o6) (Byte 〈x1,xC〉) 〈x0,x5〉
+; quadruple … BCLRn (MODE_DIRn o6) (Byte 〈x1,xD〉) 〈x0,x5〉
+; quadruple … BSETn (MODE_DIRn o7) (Byte 〈x1,xE〉) 〈x0,x5〉
+; quadruple … BCLRn (MODE_DIRn o7) (Byte 〈x1,xF〉) 〈x0,x5〉
+].
+
+ndefinition opcode_table_RS08_7 ≝
+[
+  quadruple … BRSETn (MODE_DIRn_and_IMM1 o0) (Byte 〈x0,x0〉) 〈x0,x5〉
+; quadruple … BRCLRn (MODE_DIRn_and_IMM1 o0) (Byte 〈x0,x1〉) 〈x0,x5〉
+; quadruple … BRSETn (MODE_DIRn_and_IMM1 o1) (Byte 〈x0,x2〉) 〈x0,x5〉
+; quadruple … BRCLRn (MODE_DIRn_and_IMM1 o1) (Byte 〈x0,x3〉) 〈x0,x5〉
+; quadruple … BRSETn (MODE_DIRn_and_IMM1 o2) (Byte 〈x0,x4〉) 〈x0,x5〉
+; quadruple … BRCLRn (MODE_DIRn_and_IMM1 o2) (Byte 〈x0,x5〉) 〈x0,x5〉
+; quadruple … BRSETn (MODE_DIRn_and_IMM1 o3) (Byte 〈x0,x6〉) 〈x0,x5〉
+; quadruple … BRCLRn (MODE_DIRn_and_IMM1 o3) (Byte 〈x0,x7〉) 〈x0,x5〉
+; quadruple … BRSETn (MODE_DIRn_and_IMM1 o4) (Byte 〈x0,x8〉) 〈x0,x5〉
+; quadruple … BRCLRn (MODE_DIRn_and_IMM1 o4) (Byte 〈x0,x9〉) 〈x0,x5〉
+; quadruple … BRSETn (MODE_DIRn_and_IMM1 o5) (Byte 〈x0,xA〉) 〈x0,x5〉
+; quadruple … BRCLRn (MODE_DIRn_and_IMM1 o5) (Byte 〈x0,xB〉) 〈x0,x5〉
+; quadruple … BRSETn (MODE_DIRn_and_IMM1 o6) (Byte 〈x0,xC〉) 〈x0,x5〉
+; quadruple … BRCLRn (MODE_DIRn_and_IMM1 o6) (Byte 〈x0,xD〉) 〈x0,x5〉
+; quadruple … BRSETn (MODE_DIRn_and_IMM1 o7) (Byte 〈x0,xE〉) 〈x0,x5〉
+; quadruple … BRCLRn (MODE_DIRn_and_IMM1 o7) (Byte 〈x0,xF〉) 〈x0,x5〉
+].
+
+ndefinition opcode_table_RS08_8 ≝
+[
+  quadruple … CLC  MODE_INH (Byte 〈x3,x8〉) 〈x0,x1〉
+; quadruple … SEC  MODE_INH (Byte 〈x3,x9〉) 〈x0,x1〉
+; quadruple … SLA  MODE_INH (Byte 〈x4,x2〉) 〈x0,x1〉
+; quadruple … SHA  MODE_INH (Byte 〈x4,x5〉) 〈x0,x1〉
+; quadruple … NOP  MODE_INH (Byte 〈xA,xC〉) 〈x0,x1〉
+; quadruple … STOP MODE_INH (Byte 〈xA,xE〉) 〈x0,x2〉
+; quadruple … WAIT MODE_INH (Byte 〈xA,xF〉) 〈x0,x2〉
+; quadruple … RTS  MODE_INH (Byte 〈xB,xE〉) 〈x0,x3〉
+; quadruple … BGND MODE_INH (Byte 〈xB,xF〉) 〈x0,x5〉
+].
+
+ndefinition opcode_table_RS08_9 ≝
+[
+  quadruple … CBEQA MODE_DIR1_and_IMM1 (Byte 〈x3,x1〉) 〈x0,x5〉
+; quadruple … CBEQA MODE_IMM1_and_IMM1 (Byte 〈x4,x1〉) 〈x0,x4〉
+].
+
+ndefinition opcode_table_RS08_10 ≝
+[
+  quadruple … CLR MODE_DIR1      (Byte 〈x3,xF〉) 〈x0,x3〉
+; quadruple … CLR MODE_INHA      (Byte 〈x4,xF〉) 〈x0,x1〉
+; quadruple … CLR (MODE_SRT t00) (Byte 〈x8,x0〉) 〈x0,x2〉
+; quadruple … CLR (MODE_SRT t01) (Byte 〈x8,x1〉) 〈x0,x2〉
+; quadruple … CLR (MODE_SRT t02) (Byte 〈x8,x2〉) 〈x0,x2〉
+; quadruple … CLR (MODE_SRT t03) (Byte 〈x8,x3〉) 〈x0,x2〉
+; quadruple … CLR (MODE_SRT t04) (Byte 〈x8,x4〉) 〈x0,x2〉
+; quadruple … CLR (MODE_SRT t05) (Byte 〈x8,x5〉) 〈x0,x2〉
+; quadruple … CLR (MODE_SRT t06) (Byte 〈x8,x6〉) 〈x0,x2〉
+; quadruple … CLR (MODE_SRT t07) (Byte 〈x8,x7〉) 〈x0,x2〉
+; quadruple … CLR (MODE_SRT t08) (Byte 〈x8,x8〉) 〈x0,x2〉
+; quadruple … CLR (MODE_SRT t09) (Byte 〈x8,x9〉) 〈x0,x2〉
+; quadruple … CLR (MODE_SRT t0A) (Byte 〈x8,xA〉) 〈x0,x2〉
+; quadruple … CLR (MODE_SRT t0B) (Byte 〈x8,xB〉) 〈x0,x2〉
+; quadruple … CLR (MODE_SRT t0C) (Byte 〈x8,xC〉) 〈x0,x2〉
+; quadruple … CLR (MODE_SRT t0D) (Byte 〈x8,xD〉) 〈x0,x2〉
+; quadruple … CLR (MODE_SRT t0E) (Byte 〈x8,xE〉) 〈x0,x2〉
+; quadruple … CLR (MODE_SRT t0F) (Byte 〈x8,xF〉) 〈x0,x2〉
+; quadruple … CLR (MODE_SRT t10) (Byte 〈x9,x0〉) 〈x0,x2〉
+; quadruple … CLR (MODE_SRT t11) (Byte 〈x9,x1〉) 〈x0,x2〉
+; quadruple … CLR (MODE_SRT t12) (Byte 〈x9,x2〉) 〈x0,x2〉
+; quadruple … CLR (MODE_SRT t13) (Byte 〈x9,x3〉) 〈x0,x2〉
+; quadruple … CLR (MODE_SRT t14) (Byte 〈x9,x4〉) 〈x0,x2〉
+; quadruple … CLR (MODE_SRT t15) (Byte 〈x9,x5〉) 〈x0,x2〉
+; quadruple … CLR (MODE_SRT t16) (Byte 〈x9,x6〉) 〈x0,x2〉
+; quadruple … CLR (MODE_SRT t17) (Byte 〈x9,x7〉) 〈x0,x2〉
+; quadruple … CLR (MODE_SRT t18) (Byte 〈x9,x8〉) 〈x0,x2〉
+; quadruple … CLR (MODE_SRT t19) (Byte 〈x9,x9〉) 〈x0,x2〉
+; quadruple … CLR (MODE_SRT t1A) (Byte 〈x9,xA〉) 〈x0,x2〉
+; quadruple … CLR (MODE_SRT t1B) (Byte 〈x9,xB〉) 〈x0,x2〉
+; quadruple … CLR (MODE_SRT t1C) (Byte 〈x9,xC〉) 〈x0,x2〉
+; quadruple … CLR (MODE_SRT t1D) (Byte 〈x9,xD〉) 〈x0,x2〉
+; quadruple … CLR (MODE_SRT t1E) (Byte 〈x9,xE〉) 〈x0,x2〉
+; quadruple … CLR (MODE_SRT t1F) (Byte 〈x9,xF〉) 〈x0,x2〉
+].
+
+ndefinition opcode_table_RS08_11 ≝
+[
+  quadruple … CMP MODE_IMM1 (Byte 〈xA,x1〉) 〈x0,x2〉
+; quadruple … CMP MODE_DIR1 (Byte 〈xB,x1〉) 〈x0,x3〉
+].
+
+ndefinition opcode_table_RS08_12 ≝
+[
+  quadruple … COM MODE_INHA (Byte 〈x4,x3〉) 〈x0,x1〉
+].
+
+ndefinition opcode_table_RS08_13 ≝
+[
+  quadruple … DBNZ MODE_DIR1_and_IMM1 (Byte 〈x3,xB〉) 〈x0,x7〉
+; quadruple … DBNZ MODE_INHA_and_IMM1 (Byte 〈x4,xB〉) 〈x0,x4〉
+].
+
+ndefinition opcode_table_RS08_14 ≝
+[
+  quadruple … DEC MODE_DIR1     (Byte 〈x3,xA〉) 〈x0,x5〉
+; quadruple … DEC MODE_INHA     (Byte 〈x4,xA〉) 〈x0,x1〉
+; quadruple … DEC (MODE_TNY x0) (Byte 〈x5,x0〉) 〈x0,x4〉
+; quadruple … DEC (MODE_TNY x1) (Byte 〈x5,x1〉) 〈x0,x4〉
+; quadruple … DEC (MODE_TNY x2) (Byte 〈x5,x2〉) 〈x0,x4〉
+; quadruple … DEC (MODE_TNY x3) (Byte 〈x5,x3〉) 〈x0,x4〉
+; quadruple … DEC (MODE_TNY x4) (Byte 〈x5,x4〉) 〈x0,x4〉
+; quadruple … DEC (MODE_TNY x5) (Byte 〈x5,x5〉) 〈x0,x4〉
+; quadruple … DEC (MODE_TNY x6) (Byte 〈x5,x6〉) 〈x0,x4〉
+; quadruple … DEC (MODE_TNY x7) (Byte 〈x5,x7〉) 〈x0,x4〉
+; quadruple … DEC (MODE_TNY x8) (Byte 〈x5,x8〉) 〈x0,x4〉
+; quadruple … DEC (MODE_TNY x9) (Byte 〈x5,x9〉) 〈x0,x4〉
+; quadruple … DEC (MODE_TNY xA) (Byte 〈x5,xA〉) 〈x0,x4〉
+; quadruple … DEC (MODE_TNY xB) (Byte 〈x5,xB〉) 〈x0,x4〉
+; quadruple … DEC (MODE_TNY xC) (Byte 〈x5,xC〉) 〈x0,x4〉
+; quadruple … DEC (MODE_TNY xD) (Byte 〈x5,xD〉) 〈x0,x4〉
+; quadruple … DEC (MODE_TNY xE) (Byte 〈x5,xE〉) 〈x0,x4〉
+; quadruple … DEC (MODE_TNY xF) (Byte 〈x5,xF〉) 〈x0,x4〉
+].
+
+ndefinition opcode_table_RS08_15 ≝
+[ 
+  quadruple … EOR MODE_IMM1 (Byte 〈xA,x8〉) 〈x0,x2〉
+; quadruple … EOR MODE_DIR1 (Byte 〈xB,x8〉) 〈x0,x3〉
+].
+
+ndefinition opcode_table_RS08_16 ≝
+[
+  quadruple … INC MODE_DIR1     (Byte 〈x3,xC〉) 〈x0,x5〉
+; quadruple … INC MODE_INHA     (Byte 〈x4,xC〉) 〈x0,x1〉
+; quadruple … INC (MODE_TNY x0) (Byte 〈x2,x0〉) 〈x0,x4〉
+; quadruple … INC (MODE_TNY x1) (Byte 〈x2,x1〉) 〈x0,x4〉
+; quadruple … INC (MODE_TNY x2) (Byte 〈x2,x2〉) 〈x0,x4〉
+; quadruple … INC (MODE_TNY x3) (Byte 〈x2,x3〉) 〈x0,x4〉
+; quadruple … INC (MODE_TNY x4) (Byte 〈x2,x4〉) 〈x0,x4〉
+; quadruple … INC (MODE_TNY x5) (Byte 〈x2,x5〉) 〈x0,x4〉
+; quadruple … INC (MODE_TNY x6) (Byte 〈x2,x6〉) 〈x0,x4〉
+; quadruple … INC (MODE_TNY x7) (Byte 〈x2,x7〉) 〈x0,x4〉
+; quadruple … INC (MODE_TNY x8) (Byte 〈x2,x8〉) 〈x0,x4〉
+; quadruple … INC (MODE_TNY x9) (Byte 〈x2,x9〉) 〈x0,x4〉
+; quadruple … INC (MODE_TNY xA) (Byte 〈x2,xA〉) 〈x0,x4〉
+; quadruple … INC (MODE_TNY xB) (Byte 〈x2,xB〉) 〈x0,x4〉
+; quadruple … INC (MODE_TNY xC) (Byte 〈x2,xC〉) 〈x0,x4〉
+; quadruple … INC (MODE_TNY xD) (Byte 〈x2,xD〉) 〈x0,x4〉
+; quadruple … INC (MODE_TNY xE) (Byte 〈x2,xE〉) 〈x0,x4〉
+; quadruple … INC (MODE_TNY xF) (Byte 〈x2,xF〉) 〈x0,x4〉
+].
+
+ndefinition opcode_table_RS08_17 ≝
+[
+  quadruple … JMP MODE_IMM2 (Byte 〈xB,xC〉) 〈x0,x4〉
+].
+
+ndefinition opcode_table_RS08_18 ≝
+[
+  quadruple … BSR MODE_IMM1 (Byte 〈xA,xD〉) 〈x0,x3〉
+; quadruple … JSR MODE_IMM2 (Byte 〈xB,xD〉) 〈x0,x4〉
+].
+
+ndefinition opcode_table_RS08_19 ≝
+[
+  quadruple … LDA MODE_IMM1      (Byte 〈xA,x6〉) 〈x0,x2〉
+; quadruple … LDA MODE_DIR1      (Byte 〈xB,x6〉) 〈x0,x3〉
+; quadruple … LDA (MODE_SRT t00) (Byte 〈xC,x0〉) 〈x0,x3〉
+; quadruple … LDA (MODE_SRT t01) (Byte 〈xC,x1〉) 〈x0,x3〉
+; quadruple … LDA (MODE_SRT t02) (Byte 〈xC,x2〉) 〈x0,x3〉
+; quadruple … LDA (MODE_SRT t03) (Byte 〈xC,x3〉) 〈x0,x3〉
+; quadruple … LDA (MODE_SRT t04) (Byte 〈xC,x4〉) 〈x0,x3〉
+; quadruple … LDA (MODE_SRT t05) (Byte 〈xC,x5〉) 〈x0,x3〉
+; quadruple … LDA (MODE_SRT t06) (Byte 〈xC,x6〉) 〈x0,x3〉
+; quadruple … LDA (MODE_SRT t07) (Byte 〈xC,x7〉) 〈x0,x3〉
+; quadruple … LDA (MODE_SRT t08) (Byte 〈xC,x8〉) 〈x0,x3〉
+; quadruple … LDA (MODE_SRT t09) (Byte 〈xC,x9〉) 〈x0,x3〉
+; quadruple … LDA (MODE_SRT t0A) (Byte 〈xC,xA〉) 〈x0,x3〉
+; quadruple … LDA (MODE_SRT t0B) (Byte 〈xC,xB〉) 〈x0,x3〉
+; quadruple … LDA (MODE_SRT t0C) (Byte 〈xC,xC〉) 〈x0,x3〉
+; quadruple … LDA (MODE_SRT t0D) (Byte 〈xC,xD〉) 〈x0,x3〉
+; quadruple … LDA (MODE_SRT t0E) (Byte 〈xC,xE〉) 〈x0,x3〉
+; quadruple … LDA (MODE_SRT t0F) (Byte 〈xC,xF〉) 〈x0,x3〉
+; quadruple … LDA (MODE_SRT t10) (Byte 〈xD,x0〉) 〈x0,x3〉
+; quadruple … LDA (MODE_SRT t11) (Byte 〈xD,x1〉) 〈x0,x3〉
+; quadruple … LDA (MODE_SRT t12) (Byte 〈xD,x2〉) 〈x0,x3〉
+; quadruple … LDA (MODE_SRT t13) (Byte 〈xD,x3〉) 〈x0,x3〉
+; quadruple … LDA (MODE_SRT t14) (Byte 〈xD,x4〉) 〈x0,x3〉
+; quadruple … LDA (MODE_SRT t15) (Byte 〈xD,x5〉) 〈x0,x3〉
+; quadruple … LDA (MODE_SRT t16) (Byte 〈xD,x6〉) 〈x0,x3〉
+; quadruple … LDA (MODE_SRT t17) (Byte 〈xD,x7〉) 〈x0,x3〉
+; quadruple … LDA (MODE_SRT t18) (Byte 〈xD,x8〉) 〈x0,x3〉
+; quadruple … LDA (MODE_SRT t19) (Byte 〈xD,x9〉) 〈x0,x3〉
+; quadruple … LDA (MODE_SRT t1A) (Byte 〈xD,xA〉) 〈x0,x3〉
+; quadruple … LDA (MODE_SRT t1B) (Byte 〈xD,xB〉) 〈x0,x3〉
+; quadruple … LDA (MODE_SRT t1C) (Byte 〈xD,xC〉) 〈x0,x3〉
+; quadruple … LDA (MODE_SRT t1D) (Byte 〈xD,xD〉) 〈x0,x3〉
+; quadruple … LDA (MODE_SRT t1E) (Byte 〈xD,xE〉) 〈x0,x3〉
+; quadruple … LDA (MODE_SRT t1F) (Byte 〈xD,xF〉) 〈x0,x3〉
+].
+
+ndefinition opcode_table_RS08_20 ≝
+[
+  quadruple … LSR MODE_INHA (Byte 〈x4,x4〉) 〈x0,x1〉
+].
+
+ndefinition opcode_table_RS08_21 ≝
+[
+  quadruple … MOV MODE_IMM1_to_DIR1 (Byte 〈x3,xE〉) 〈x0,x4〉
+; quadruple … MOV MODE_DIR1_to_DIR1 (Byte 〈x4,xE〉) 〈x0,x5〉
+].
+
+ndefinition opcode_table_RS08_22 ≝
+[ 
+  quadruple … ORA MODE_IMM1 (Byte 〈xA,xA〉) 〈x0,x2〉
+; quadruple … ORA MODE_DIR1 (Byte 〈xB,xA〉) 〈x0,x3〉
+].
+
+ndefinition opcode_table_RS08_23 ≝
+[
+  quadruple … ROL MODE_INHA (Byte 〈x4,x9〉) 〈x0,x1〉
+].
+
+ndefinition opcode_table_RS08_24 ≝
+[
+  quadruple … ROR MODE_INHA (Byte 〈x4,x6〉) 〈x0,x1〉
+].
+
+ndefinition opcode_table_RS08_25 ≝
+[
+  quadruple … SBC MODE_IMM1 (Byte 〈xA,x2〉) 〈x0,x2〉
+; quadruple … SBC MODE_DIR1 (Byte 〈xB,x2〉) 〈x0,x3〉
+].
+
+ndefinition opcode_table_RS08_26 ≝
+[
+  quadruple … STA MODE_DIR1      (Byte 〈xB,x7〉) 〈x0,x3〉
+; quadruple … STA (MODE_SRT t00) (Byte 〈xE,x0〉) 〈x0,x2〉
+; quadruple … STA (MODE_SRT t01) (Byte 〈xE,x1〉) 〈x0,x2〉
+; quadruple … STA (MODE_SRT t02) (Byte 〈xE,x2〉) 〈x0,x2〉
+; quadruple … STA (MODE_SRT t03) (Byte 〈xE,x3〉) 〈x0,x2〉
+; quadruple … STA (MODE_SRT t04) (Byte 〈xE,x4〉) 〈x0,x2〉
+; quadruple … STA (MODE_SRT t05) (Byte 〈xE,x5〉) 〈x0,x2〉
+; quadruple … STA (MODE_SRT t06) (Byte 〈xE,x6〉) 〈x0,x2〉
+; quadruple … STA (MODE_SRT t07) (Byte 〈xE,x7〉) 〈x0,x2〉
+; quadruple … STA (MODE_SRT t08) (Byte 〈xE,x8〉) 〈x0,x2〉
+; quadruple … STA (MODE_SRT t09) (Byte 〈xE,x9〉) 〈x0,x2〉
+; quadruple … STA (MODE_SRT t0A) (Byte 〈xE,xA〉) 〈x0,x2〉
+; quadruple … STA (MODE_SRT t0B) (Byte 〈xE,xB〉) 〈x0,x2〉
+; quadruple … STA (MODE_SRT t0C) (Byte 〈xE,xC〉) 〈x0,x2〉
+; quadruple … STA (MODE_SRT t0D) (Byte 〈xE,xD〉) 〈x0,x2〉
+; quadruple … STA (MODE_SRT t0E) (Byte 〈xE,xE〉) 〈x0,x2〉
+; quadruple … STA (MODE_SRT t0F) (Byte 〈xE,xF〉) 〈x0,x2〉
+; quadruple … STA (MODE_SRT t10) (Byte 〈xF,x0〉) 〈x0,x2〉
+; quadruple … STA (MODE_SRT t11) (Byte 〈xF,x1〉) 〈x0,x2〉
+; quadruple … STA (MODE_SRT t12) (Byte 〈xF,x2〉) 〈x0,x2〉
+; quadruple … STA (MODE_SRT t13) (Byte 〈xF,x3〉) 〈x0,x2〉
+; quadruple … STA (MODE_SRT t14) (Byte 〈xF,x4〉) 〈x0,x2〉
+; quadruple … STA (MODE_SRT t15) (Byte 〈xF,x5〉) 〈x0,x2〉
+; quadruple … STA (MODE_SRT t16) (Byte 〈xF,x6〉) 〈x0,x2〉
+; quadruple … STA (MODE_SRT t17) (Byte 〈xF,x7〉) 〈x0,x2〉
+; quadruple … STA (MODE_SRT t18) (Byte 〈xF,x8〉) 〈x0,x2〉
+; quadruple … STA (MODE_SRT t19) (Byte 〈xF,x9〉) 〈x0,x2〉
+; quadruple … STA (MODE_SRT t1A) (Byte 〈xF,xA〉) 〈x0,x2〉
+; quadruple … STA (MODE_SRT t1B) (Byte 〈xF,xB〉) 〈x0,x2〉
+; quadruple … STA (MODE_SRT t1C) (Byte 〈xF,xC〉) 〈x0,x2〉
+; quadruple … STA (MODE_SRT t1D) (Byte 〈xF,xD〉) 〈x0,x2〉
+; quadruple … STA (MODE_SRT t1E) (Byte 〈xF,xE〉) 〈x0,x2〉
+; quadruple … STA (MODE_SRT t1F) (Byte 〈xF,xF〉) 〈x0,x2〉
+].
+
+ndefinition opcode_table_RS08_27 ≝
+[ 
+  quadruple … SUB MODE_IMM1     (Byte 〈xA,x0〉) 〈x0,x2〉
+; quadruple … SUB MODE_DIR1     (Byte 〈xB,x0〉) 〈x0,x3〉
+; quadruple … SUB (MODE_TNY x0) (Byte 〈x7,x0〉) 〈x0,x3〉
+; quadruple … SUB (MODE_TNY x1) (Byte 〈x7,x1〉) 〈x0,x3〉
+; quadruple … SUB (MODE_TNY x2) (Byte 〈x7,x2〉) 〈x0,x3〉
+; quadruple … SUB (MODE_TNY x3) (Byte 〈x7,x3〉) 〈x0,x3〉
+; quadruple … SUB (MODE_TNY x4) (Byte 〈x7,x4〉) 〈x0,x3〉
+; quadruple … SUB (MODE_TNY x5) (Byte 〈x7,x5〉) 〈x0,x3〉
+; quadruple … SUB (MODE_TNY x6) (Byte 〈x7,x6〉) 〈x0,x3〉
+; quadruple … SUB (MODE_TNY x7) (Byte 〈x7,x7〉) 〈x0,x3〉
+; quadruple … SUB (MODE_TNY x8) (Byte 〈x7,x8〉) 〈x0,x3〉
+; quadruple … SUB (MODE_TNY x9) (Byte 〈x7,x9〉) 〈x0,x3〉
+; quadruple … SUB (MODE_TNY xA) (Byte 〈x7,xA〉) 〈x0,x3〉
+; quadruple … SUB (MODE_TNY xB) (Byte 〈x7,xB〉) 〈x0,x3〉
+; quadruple … SUB (MODE_TNY xC) (Byte 〈x7,xC〉) 〈x0,x3〉
+; quadruple … SUB (MODE_TNY xD) (Byte 〈x7,xD〉) 〈x0,x3〉
+; quadruple … SUB (MODE_TNY xE) (Byte 〈x7,xE〉) 〈x0,x3〉
+; quadruple … SUB (MODE_TNY xF) (Byte 〈x7,xF〉) 〈x0,x3〉
+].
+
+ndefinition opcode_table_RS08 ≝
+opcode_table_RS08_1  @ opcode_table_RS08_2  @ opcode_table_RS08_3  @ opcode_table_RS08_4  @
+opcode_table_RS08_5  @ opcode_table_RS08_6  @ opcode_table_RS08_7  @ opcode_table_RS08_8  @
+opcode_table_RS08_9  @ opcode_table_RS08_10 @ opcode_table_RS08_11 @ opcode_table_RS08_12 @
+opcode_table_RS08_13 @ opcode_table_RS08_14 @ opcode_table_RS08_15 @ opcode_table_RS08_16 @
+opcode_table_RS08_17 @ opcode_table_RS08_18 @ opcode_table_RS08_19 @ opcode_table_RS08_20 @
+opcode_table_RS08_21 @ opcode_table_RS08_22 @ opcode_table_RS08_23 @ opcode_table_RS08_24 @
+opcode_table_RS08_25 @ opcode_table_RS08_26 @ opcode_table_RS08_27.
diff --git a/helm/software/matita/contribs/ng_assembly/opcodes/RS08_table_tests.ma b/helm/software/matita/contribs/ng_assembly/opcodes/RS08_table_tests.ma
new file mode 100755 (executable)
index 0000000..c831f12
--- /dev/null
@@ -0,0 +1,65 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||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 "freescale/opcode.ma".
+
+(* ***************** *)
+(* TABELLA DELL'RS08 *)
+(* ***************** *)
+
+(* RS08: opcode non implementati come da manuale *)
+ndefinition RS08_not_impl_byte ≝
+ [〈x3,x2〉;〈x3,x3〉;〈x3,xD〉
+ ;〈x4,x0〉;〈x4,x7〉;〈x4,xD〉
+ ;〈xA,x3〉;〈xA,x5〉;〈xA,x7〉
+ ;〈xB,x3〉;〈xB,x5〉
+ ].
+
+(* test bytecode non implementati *)
+nlemma ok_byte_table_RS08 : forall_b8 (λb.
+ (test_not_impl_byte b RS08_not_impl_byte     ⊙ eq_w16 (get_byte_count RS08 b 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_RS08) 〈〈x0,x0〉:〈x0,x1〉〉) ⊗
+ (⊖ (test_not_impl_byte b RS08_not_impl_byte) ⊙ eq_w16 (get_byte_count RS08 b 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_RS08) 〈〈x0,x0〉:〈x0,x0〉〉))
+ = true.
+ napply refl_eq.
+nqed.
+
+(* tutti op implementati *)
+nlemma ok_pseudo_table_RS08 :
+ forall_op RS08 (λo.
+  le_w16 〈〈x0,x0〉:〈x0,x1〉〉 (get_pseudo_count RS08 o 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_RS08)) = true.
+ napply refl_eq.
+nqed.
+
+(* tutte im implementate *)
+nlemma ok_mode_table_RS08 :
+ forall_im RS08 (λi.
+  le_w16 〈〈x0,x0〉:〈x0,x1〉〉 (get_mode_count RS08 i 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_RS08)) = true.
+ napply refl_eq.
+nqed.
+
+(* nessuna ripetizione di combinazione op + imm *)
+nlemma ok_OpIm_table_RS08 :
+ forall_im RS08 (λi.
+  forall_op RS08 (λo.
+   le_w16 (get_OpIm_count RS08 o i 〈〈x0,x0〉:〈x0,x0〉〉 opcode_table_RS08) 〈〈x0,x0〉:〈x0,x1〉〉)) = true.
+ napply refl_eq.
+nqed.
diff --git a/helm/software/matita/contribs/ng_assembly/opcodes/byte_or_word.ma b/helm/software/matita/contribs/ng_assembly/opcodes/byte_or_word.ma
new file mode 100755 (executable)
index 0000000..7c20eb1
--- /dev/null
@@ -0,0 +1,35 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||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".
+
+(* raggruppamento di byte e word in un tipo unico *)
+ninductive byte8_or_word16 : Type ≝
+  Byte: byte8  → byte8_or_word16
+| Word: word16 → byte8_or_word16.
+
+ndefinition eq_b8w16 ≝
+λbw1,bw2:byte8_or_word16.
+ match bw1 with
+  [ Byte b1 ⇒ match bw2 with [ Byte b2 ⇒ eq_b8 b1 b2 | Word _ ⇒ false ]
+  | Word w1 ⇒ match bw2 with [ Byte _ ⇒ false | Word w2 ⇒ eq_w16 w1 w2 ]
+  ].
diff --git a/helm/software/matita/contribs/ng_assembly/opcodes/opcode.ma b/helm/software/matita/contribs/ng_assembly/opcodes/opcode.ma
new file mode 100755 (executable)
index 0000000..3aaed8f
--- /dev/null
@@ -0,0 +1,202 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||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 "opcodes/HC05_opcode_base.ma".
+include "opcodes/HC08_opcode_base.ma".
+include "opcodes/HCS08_opcode_base.ma".
+include "opcodes/RS08_opcode_base.ma".
+include "opcodes/byte_or_word.ma".
+include "common/list.ma".
+
+(* ********************************************** *)
+(* MATTONI BASE PER DEFINIRE LE TABELLE DELLE MCU *)
+(* ********************************************** *)
+
+(* enumerazione delle ALU *)
+ninductive mcu_type: Type ≝
+  HC05  : mcu_type
+| HC08  : mcu_type
+| HCS08 : mcu_type
+| RS08  : mcu_type.
+
+ndefinition eq_mcutype ≝
+λm1,m2:mcu_type.
+ match m1 with
+  [ HC05 ⇒ match m2 with [ HC05 ⇒ true | _ ⇒ false ]
+  | HC08 ⇒ match m2 with [ HC08 ⇒ true | _ ⇒ false ]
+  | HCS08 ⇒ match m2 with [ HCS08 ⇒ true | _ ⇒ false ]
+  | RS08 ⇒ match m2 with [ RS08 ⇒ true | _ ⇒ false ]
+  ].
+
+ndefinition aux_op_type ≝
+λmcu:mcu_type.match mcu with
+ [ HC05 ⇒ HC05_opcode
+ | HC08 ⇒ HC08_opcode
+ | HCS08 ⇒ HCS08_opcode
+ | RS08 ⇒ RS08_opcode
+ ].
+
+ndefinition aux_im_type ≝
+λmcu:mcu_type.match mcu with
+ [ HC05 ⇒ HC05_instr_mode
+ | HC08 ⇒ HC08_instr_mode
+ | HCS08 ⇒ HCS08_instr_mode
+ | RS08 ⇒ RS08_instr_mode
+ ].
+
+ndefinition eq_op ≝
+λmcu:mcu_type.
+ match mcu
+  return λm.aux_op_type m → aux_op_type m → bool
+ with
+  [ HC05 ⇒ eq_HC05_op
+  | HC08 ⇒ eq_HC08_op
+  | HCS08 ⇒ eq_HCS08_op
+  | RS08 ⇒ eq_RS08_op
+  ].
+
+ndefinition eq_im ≝
+λmcu:mcu_type.
+ match mcu
+  return λm.aux_im_type m → aux_im_type m → bool
+ with
+  [ HC05 ⇒ eq_HC05_im
+  | HC08 ⇒ eq_HC08_im
+  | HCS08 ⇒ eq_HCS08_im
+  | RS08 ⇒ eq_RS08_im
+  ].
+
+ndefinition forall_op ≝
+λmcu:mcu_type.
+ match mcu
+  return λm.(aux_op_type m → bool) → bool
+ with
+  [ HC05 ⇒ forall_HC05_op
+  | HC08 ⇒ forall_HC08_op
+  | HCS08 ⇒ forall_HCS08_op
+  | RS08 ⇒ forall_RS08_op
+  ].
+
+ndefinition forall_im ≝
+λmcu:mcu_type.
+ match mcu
+  return λm.(aux_im_type m → bool) → bool
+ with
+  [ HC05 ⇒ forall_HC05_im
+  | HC08 ⇒ forall_HC08_im
+  | HCS08 ⇒ forall_HCS08_im
+  | RS08 ⇒ forall_RS08_im
+  ].
+
+(* ********************************************* *)
+(* STRUMENTI PER LE DIMOSTRAZIONI DI CORRETTEZZA *)
+(* ********************************************* *)
+
+ndefinition aux_table_type ≝ λmcu:mcu_type.Prod4T (aux_op_type mcu) (aux_im_type mcu) byte8_or_word16 byte8.
+
+(* su tutta la lista quante volte compare il byte *)
+nlet rec get_byte_count (m:mcu_type) (b:byte8) (c:word16) (l:list (aux_table_type m)) on l ≝
+ match l with
+  [ nil ⇒ c
+  | cons hd tl ⇒ match thd4T … hd with
+   [ Byte b' ⇒ match eq_b8 b b' with
+    [ true ⇒ get_byte_count m b (succ_w16 c) tl
+    | false ⇒ get_byte_count m b c tl
+    ]
+   | Word _ ⇒ get_byte_count m b c tl
+   ]
+  ].
+
+(* su tutta la lista quante volte compare la word (0x9E+byte) *)
+nlet rec get_word_count (m:mcu_type) (b:byte8) (c:word16) (l:list (aux_table_type m)) on l ≝
+ match l with
+  [ nil ⇒ c
+  | cons hd tl ⇒ match thd4T … hd with
+   [ Byte _ ⇒ get_word_count m b c tl
+   | Word w ⇒ match eq_w16 〈〈x9,xE〉:b〉 w with
+    [ true ⇒ get_word_count m b (succ_w16 c) tl
+    | false ⇒ get_word_count m b c tl
+    ]
+   ]
+  ].
+
+(* su tutta la lista quante volte compare lo pseudocodice *)
+nlet rec get_pseudo_count (m:mcu_type) (o:aux_op_type m) (c:word16) (l:list (aux_table_type m)) on l ≝
+ match l with
+  [ nil ⇒ c
+  | cons hd tl ⇒ match eq_op m o (fst4T … hd) with
+   [ true ⇒ get_pseudo_count m o (succ_w16 c) tl
+   | false ⇒ get_pseudo_count m o c tl
+   ]
+  ].
+
+(* su tutta la lista quante volte compare la modalita' *)
+nlet rec get_mode_count (m:mcu_type) (i:aux_im_type m) (c:word16) (l:list (aux_table_type m)) on l ≝
+ match l with
+  [ nil ⇒ c
+  | cons hd tl ⇒ match eq_im m i (snd4T … hd) with
+   [ true ⇒ get_mode_count m i (succ_w16 c) tl
+   | false ⇒ get_mode_count m i c tl
+   ]
+  ].
+
+(* b e' non implementato? *)
+nlet rec test_not_impl_byte (b:byte8) (l:list byte8) on l ≝
+ match l with
+  [ nil ⇒ false
+  | cons hd tl ⇒ match eq_b8 b hd with
+   [ true ⇒ true
+   | false ⇒ test_not_impl_byte b tl
+   ]
+  ].
+
+(* o e' non implementato? *)
+nlet rec test_not_impl_pseudo (m:mcu_type) (o:aux_op_type m) (l:list (aux_op_type m)) on l ≝
+ match l with
+  [ nil ⇒ false
+  | cons hd tl ⇒ match eq_op m o hd with
+   [ true ⇒ true
+   | false ⇒ test_not_impl_pseudo m o tl
+   ]
+  ].
+
+(* i e' non implementato? *)
+nlet rec test_not_impl_mode (m:mcu_type) (i:aux_im_type m) (l:list (aux_im_type m)) on l ≝
+ match l with
+  [ nil ⇒ false
+  | cons hd tl ⇒ match eq_im m i hd with
+   [ true ⇒ true
+   | false ⇒ test_not_impl_mode m i tl
+   ]
+  ].
+
+(* su tutta la lista quante volte compare la coppia opcode,instr_mode *)
+nlet rec get_OpIm_count (m:mcu_type) (o:aux_op_type m) (i:aux_im_type m) (c:word16) (l:list (aux_table_type m)) on l ≝
+ match l with
+  [ nil ⇒ c
+  | cons hd tl ⇒
+   match (eq_op m o (fst4T … hd)) ⊗
+         (eq_im m i (snd4T … hd)) with
+    [ true ⇒ get_OpIm_count m o i (succ_w16 c) tl
+    | false ⇒ get_OpIm_count m o i c tl
+    ] 
+  ].