summaryrefslogtreecommitdiff
path: root/lib/Language/Elna/Architecture
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Language/Elna/Architecture')
-rw-r--r--lib/Language/Elna/Architecture/RiscV.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Language/Elna/Architecture/RiscV.hs b/lib/Language/Elna/Architecture/RiscV.hs
index 9964911..4ee516d 100644
--- a/lib/Language/Elna/Architecture/RiscV.hs
+++ b/lib/Language/Elna/Architecture/RiscV.hs
@@ -150,6 +150,7 @@ data RelocationType
data Instruction
= Instruction BaseOpcode Type
| RelocatableInstruction BaseOpcode RelocationType
+ | CallInstruction Text
deriving Eq
xRegister :: XRegister -> Word8
@@ -306,6 +307,10 @@ instruction :: Instruction -> ByteString.Builder.Builder
instruction = \case
(Instruction base instructionType) -> go base $ type' instructionType
(RelocatableInstruction base instructionType) -> go base $ relocationType instructionType
+ (CallInstruction _) -> foldMap instruction
+ [ Instruction Auipc $ U RA 0
+ , Instruction Jalr $ I RA JALR RA 0
+ ]
where
go base instructionType
= ByteString.Builder.word32LE