X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fmatita%2Fcontribs%2Fng_assembly%2Ffreescale%2Fmemory_func.ma;fp=helm%2Fsoftware%2Fmatita%2Fcontribs%2Fng_assembly%2Ffreescale%2Fmemory_func.ma;h=831c75a1aff6d78b9f7caab6ebeb6c5a918e8552;hb=bf0cc84dcef9ae3d2145e79754bb39feb3985574;hp=723ec0b841aa4aaf1abd6e626ee74a334ebb4b5c;hpb=c2b39b7ef14ab610cb2056fb6b75492c7068288e;p=helm.git diff --git a/helm/software/matita/contribs/ng_assembly/freescale/memory_func.ma b/helm/software/matita/contribs/ng_assembly/freescale/memory_func.ma index 723ec0b84..831c75a1a 100755 --- a/helm/software/matita/contribs/ng_assembly/freescale/memory_func.ma +++ b/helm/software/matita/contribs/ng_assembly/freescale/memory_func.ma @@ -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 ] - ] - ]. + ].