Add call pseudo instruction
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user