projects
/
calu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0df70b5
)
3a_asm: introducing @hi and @lo for immediate
author
Bernhard Urban
<lewurm@gmail.com>
Sun, 31 Oct 2010 23:40:50 +0000
(
00:40
+0100)
committer
Bernhard Urban
<lewurm@gmail.com>
Sun, 31 Oct 2010 23:40:50 +0000
(
00:40
+0100)
3a_asm/DT.hs
patch
|
blob
|
history
diff --git
a/3a_asm/DT.hs
b/3a_asm/DT.hs
index 3b22543c770e189246d1b43b55db20a3bdf8a167..60565bfbbe1803d43d85196c09c81506690e6d27 100644
(file)
--- a/
3a_asm/DT.hs
+++ b/
3a_asm/DT.hs
@@
-33,7
+33,16
@@
comma = char ','
mnem m = string m
iLit :: Dict -> Parser Word32
-iLit (_,d) = expr d
+iLit (_,d) = do
+ val <- expr d;
+ try (do {
+ string "@hi";
+ return $ shiftR val 16
+ }) <|> do {
+ string "@lo";
+ return $ val .&. 0xffff
+ } <|> return val
+
iLit12 d = do i <- iLit d; return $ i .&. 0x0fff
iLit15 d = do i <- iLit d; return $ i .&. 0xefff