From: Bernhard Urban Date: Mon, 1 Nov 2010 00:06:03 +0000 (+0100) Subject: 3a_asm: relative jumps X-Git-Tag: bootrom_v1~202 X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=calu.git;a=commitdiff_plain;h=ec384cf9084dfa2fe29b12867b14e76d93ce8ef2 3a_asm: relative jumps ooops, I removed that in 0df70b557af :/ --- diff --git a/3a_asm/DT.hs b/3a_asm/DT.hs index e2727b4..713f177 100644 --- a/3a_asm/DT.hs +++ b/3a_asm/DT.hs @@ -32,6 +32,10 @@ testins input = comma = char ',' mnem m = string m +iLabel :: Dict -> Parser Word32 +-- TODO: save msb (=sign) correctly... +iLabel d@(aktadr,_) = do {i <- (iLit d); return $ (i - aktadr) .&. 0xffff} + iLit :: Dict -> Parser Word32 iLit (_,d) = do val <- expr d; @@ -101,7 +105,7 @@ infixl 1 <%> infixl 1 <@> ins m form e = do {mnem m; form e} -csv0i_p dict f = f<$>condition<*>branchpred<*>(iLit dict) +csv0i_p dict f = f<$>condition<*>branchpred<*>(iLabel dict) csv0i_p' f = f<$>condition<*>branchpred csv1 f = f<$>condition<%>reg csv1_p f = f<$>condition<%>reg