]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/matita/contribs/ng_assembly/freescale/memory_func.ma
freescale porting, work in progress
[helm.git] / helm / software / matita / contribs / ng_assembly / freescale / memory_func.ma
index 723ec0b841aa4aaf1abd6e626ee74a334ebb4b5c..831c75a1aff6d78b9f7caab6ebeb6c5a918e8552 100755 (executable)
@@ -31,8 +31,8 @@ include "common/list.ma".
 
 (* (mf_check_update_ranged chk inf sup mode) = setta tipo memoria *)
 ndefinition mf_check_update_ranged ≝
-λf:word16 → memory_type.λi.λs.λv.
- λx.match inrange_w16 x i s with
+λf:word16 → memory_type.λinf.λsup.λv.
+ λx.match inrange_w16 x inf sup with
   [ true ⇒ v
   | false ⇒ f x ].
 
@@ -73,19 +73,15 @@ ndefinition mf_mem_read ≝
 (* CARICAMENTO PROGRAMMA/DATI *)
 (* ************************** *)
 
-(* carica a paratire da addr, scartando source (pescando da old_mem) se si supera 0xFFFF... *)
-nlet rec mf_load_from_source_at (old_mem:word16 → byte8) (source:list byte8) (addr:word16) on source ≝
-match source with
- (* fine di source: carica da old_mem *)
- [ nil ⇒ old_mem
- | cons hd tl ⇒ λx:word16.match lt_w16 x addr with
-  (* e' prima di source: carica da old_mem *)
-  [ true ⇒ old_mem x
-  | false ⇒ match eq_w16 x addr with
+(* carica a paratire da addr, overflow se si supera 0xFFFF... *)
+nlet rec mf_load_from_source_at (old_mem:word16 → byte8) (src:list byte8) (addr:word16) on src ≝
+ match src with
+  (* fine di source: carica da old_mem *)
+  [ nil ⇒ old_mem
+  | cons hd tl ⇒ λx:word16.match eq_w16 addr x with
    (* la locazione corrisponde al punto corrente di source *)
    [ true ⇒ hd
-   (* la locazione e' piu' avanti: ricorsione *)
+   (* la locazione e' piu' avanti? ricorsione *)
    | false ⇒ (mf_load_from_source_at old_mem tl (plus_w16_d_d addr 〈〈x0,x0〉:〈x0,x1〉〉)) x
    ]
-  ]
- ].
+  ].