]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/matita/contribs/ng_assembly/emulator/read_write/fetch.ma
freescale porting
[helm.git] / helm / software / matita / contribs / ng_assembly / emulator / read_write / fetch.ma
index 1d51f2bcfe393af529ac85a6b97a56146948f18f..fbdafebe01415163c93c202535a65bf5d43de51f 100755 (executable)
@@ -31,23 +31,23 @@ ninductive error_type : Type ≝
 .
 
 (* - errore: interessa solo l'errore
-   - ok: interessa info, vecchio pc, nuovo pc *)
+   - ok: interessa info, nuovo pc *)
 ninductive fetch_result (A:Type) : Type ≝
   FetchERR : error_type → fetch_result A
-| FetchOK  : A → word16 → word16 → fetch_result A.
+| FetchOK  : A → word16 → fetch_result A.
 
 ndefinition fetch_byte_aux ≝
-λm:mcu_type.λpco,pcn:word16.λbh:byte8.
+λm:mcu_type.λcur_pc:word16.λbh:byte8.
  match full_info_of_word16 m (Byte bh) with
   [ None ⇒ FetchERR ? ILL_FETCH_AD
-  | Some info ⇒ FetchOK ? info pco pcn
+  | Some info ⇒ FetchOK ? info cur_pc
   ].
 
 ndefinition fetch_word_aux ≝
-λm:mcu_type.λpco,pcn:word16.λw:word16.
+λm:mcu_type.λcur_pc:word16.λw:word16.
  match full_info_of_word16 m (Word w) with
   [ None ⇒ FetchERR ? ILL_FETCH_AD
-  | Some info ⇒ FetchOK ? info pco pcn
+  | Some info ⇒ FetchOK ? info cur_pc
   ].
 
 (* opcode a byte : HC05 / RS08 *)
@@ -55,7 +55,7 @@ ndefinition fetch_byte ≝
 λm:mcu_type.λfR:word32 → option byte8.λpc:word16.
  match fR (extu_w32 pc) with
   [ None ⇒ FetchERR ? ILL_FETCH_AD
-  | Some bh ⇒ fetch_byte_aux m pc (succ_w16 pc) bh ].
+  | Some bh ⇒ fetch_byte_aux m (succ_w16 pc) bh ].
 
 (* opcode a byte o 0x9E + byte : HC08 / HCS08 *)
 ndefinition Freescale_fetch_byte_or_word ≝
@@ -65,9 +65,9 @@ ndefinition Freescale_fetch_byte_or_word ≝
   | Some bh ⇒ match eq_b8 bh 〈x9,xE〉 with
    [ true ⇒ match fR (extu_w32 (succ_w16 pc)) with
     [ None ⇒ FetchERR ? ILL_FETCH_AD
-    | Some bl ⇒ fetch_word_aux m pc (succ_w16 (succ_w16 pc)) 〈bh:bl〉
+    | Some bl ⇒ fetch_word_aux m (succ_w16 (succ_w16 pc)) 〈bh:bl〉
     ]
-   | false ⇒ fetch_byte_aux m pc (succ_w16 pc) bh
+   | false ⇒ fetch_byte_aux m (succ_w16 pc) bh
    ]
   ].
 
@@ -81,9 +81,9 @@ ndefinition IP2022_fetch_byte_or_word ≝
   | Some bh ⇒ match eq_b8 bh 〈x0,x0〉 with
    [ true ⇒ match fR (rol_w32 〈〈〈x8,x1〉:〈x0,x0〉〉.pc〉) with
     [ None ⇒ FetchERR ? ILL_FETCH_AD
-    | Some bl ⇒ fetch_word_aux m pc (succ_w16 pc) 〈bh:bl〉
+    | Some bl ⇒ fetch_word_aux m (succ_w16 pc) 〈bh:bl〉
     ]
-   | false ⇒ fetch_byte_aux m pc (succ_w16 pc) bh
+   | false ⇒ fetch_byte_aux m (succ_w16 pc) bh
    ]
   ].