htcc-0.0.0.1: The full scratch implementation of tiny C compiler (x86_64)
Copyright(c) roki 2019
LicenseMIT
Maintainerfalgon53@yahoo.co.jp
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Htcc.Asm.Intrinsic.Structure.Internal

Description

The modules of intrinsic (x86_64) assembly

Synopsis

Documentation

newtype Asm ctx e a Source #

A monad that represents the context of the assembly code

Constructors

Asm 

Fields

  • unAsm :: AsmInfo e -> IO a

    Function that determines the structure of assembly code

Instances

Instances details
Monad (Asm ctx e) Source # 
Instance details

Defined in Htcc.Asm.Intrinsic.Structure.Internal

Methods

(>>=) :: Asm ctx e a -> (a -> Asm ctx e b) -> Asm ctx e b #

(>>) :: Asm ctx e a -> Asm ctx e b -> Asm ctx e b #

return :: a -> Asm ctx e a #

Functor (Asm ctx e) Source # 
Instance details

Defined in Htcc.Asm.Intrinsic.Structure.Internal

Methods

fmap :: (a -> b) -> Asm ctx e a -> Asm ctx e b #

(<$) :: a -> Asm ctx e b -> Asm ctx e a #

Applicative (Asm ctx e) Source # 
Instance details

Defined in Htcc.Asm.Intrinsic.Structure.Internal

Methods

pure :: a -> Asm ctx e a #

(<*>) :: Asm ctx e (a -> b) -> Asm ctx e a -> Asm ctx e b #

liftA2 :: (a -> b -> c) -> Asm ctx e a -> Asm ctx e b -> Asm ctx e c #

(*>) :: Asm ctx e a -> Asm ctx e b -> Asm ctx e b #

(<*) :: Asm ctx e a -> Asm ctx e b -> Asm ctx e a #

MonadFinally (Asm ctx e) Source # 
Instance details

Defined in Htcc.Asm.Intrinsic.Structure.Internal

Methods

finally' :: Asm ctx e α -> (Maybe α -> Asm ctx e β) -> Asm ctx e (α, β) #

finally :: Asm ctx e α -> Asm ctx e β -> Asm ctx e α #

bracket' :: Asm ctx e r -> (r -> Maybe α -> Asm ctx e β) -> (r -> Asm ctx e α) -> Asm ctx e (α, β) #

bracket :: Asm ctx e r -> (r -> Asm ctx e β) -> (r -> Asm ctx e α) -> Asm ctx e α #

Semigroup (Asm ctx e a) Source # 
Instance details

Defined in Htcc.Asm.Intrinsic.Structure.Internal

Methods

(<>) :: Asm ctx e a -> Asm ctx e a -> Asm ctx e a #

sconcat :: NonEmpty (Asm ctx e a) -> Asm ctx e a #

stimes :: Integral b => b -> Asm ctx e a -> Asm ctx e a #

Monoid a => Monoid (Asm ctx e a) Source # 
Instance details

Defined in Htcc.Asm.Intrinsic.Structure.Internal

Methods

mempty :: Asm ctx e a #

mappend :: Asm ctx e a -> Asm ctx e a -> Asm ctx e a #

mconcat :: [Asm ctx e a] -> Asm ctx e a #

data AsmInfo e Source #

Counter and label information used when generating assembly code

Constructors

AsmInfo 

Fields

data AsmCodeCtx Source #

Type representing assembly code

unCtx :: Asm ctx e a -> Asm ctx' e a Source #

the function to switch context

runAsm :: (Num e, Enum e) => Asm AsmCodeCtx e a -> IO a Source #

the executor that outputs assembly code

putStrWithIndent :: Text -> Asm ctx e () Source #

print a string with indentation

putStrLnWithIndent :: Text -> Asm ctx e () Source #

print a string with indentation, output is broken on a new line

errCtx :: Text -> Asm ctx e () Source #

The error context. when this is executed, it will exit the application immediately with exitFailure after printing the message.

writeCurFn :: Maybe Text -> Asm ctx e () Source #

rewriting functions during processing

section :: Text -> Asm ctx e a -> Asm AsmCodeCtx e a Source #

represents a section of assembly code

labeled :: Asm ctx e a -> Asm ctx e a Source #

switch to process in label