| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Wrench.Translator.Parser.Misc
Synopsis
- literal :: Parser Integer
- byteLiteral :: Parser Word8
- intLiteral :: Parser Int
- wordLiteral :: IsWord w => Parser w
- name :: Parser Text
- labelRef :: Parser Text
- comment :: String -> Parser String
- comma :: Parser ()
- nothing :: Monad m => m a -> m (Maybe b)
- eol' :: String -> ParsecT Void String Identity ()
- label :: Parser Text
- reference :: IsWord w => Parser (Ref w)
- referenceWithDirective :: IsWord w => Parser (Ref w)
- referenceWithFn :: IsWord w => (w -> w) -> Parser (Ref w)
- constantRef :: IsWord w => Parser (Ref w)
- data SectionItem i
- orgDirective :: String -> Parser Int
- sectionItems :: [SectionItem i] -> [i]
- sectionOrg :: [SectionItem i] -> Maybe Int
Documentation
intLiteral :: Parser Int Source #
wordLiteral :: IsWord w => Parser w Source #
referenceWithDirective :: IsWord w => Parser (Ref w) Source #
A reference that may be wrapped in a %hi / %lo relocation directive.
The two directives are designed to be used as a pair:
lui rd, %hi(x) addi rd, rd, %lo(x)
%lo keeps the low 12 bits and sign-extends them from bit 11, because that is
what the instructions consuming the field do with it (see fitSigned):
%lo(0xFFFFFFFF) is -1, not 0xFFF. To compensate for that borrow, %hi
rounds the value up by half a field (+0x800) before taking its upper 20 bits,
so the pair reconstructs x exactly for every 32-bit x.
sectionItems :: [SectionItem i] -> [i] Source #
sectionOrg :: [SectionItem i] -> Maybe Int Source #