Put _start and main call into builtins
This commit is contained in:
@ -148,7 +148,7 @@ data RelocationType
|
||||
deriving Eq
|
||||
|
||||
data Instruction
|
||||
= Instruction BaseOpcode Type
|
||||
= BaseInstruction BaseOpcode Type
|
||||
| RelocatableInstruction BaseOpcode RelocationType
|
||||
| CallInstruction Text
|
||||
deriving Eq
|
||||
@ -305,11 +305,11 @@ relocationType (Higher20 rd _) = type' $ U rd 0
|
||||
|
||||
instruction :: Instruction -> ByteString.Builder.Builder
|
||||
instruction = \case
|
||||
(Instruction base instructionType) -> go base $ type' instructionType
|
||||
(BaseInstruction 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
|
||||
[ BaseInstruction Auipc $ U RA 0
|
||||
, BaseInstruction Jalr $ I RA JALR RA 0
|
||||
]
|
||||
where
|
||||
go base instructionType
|
||||
|
Reference in New Issue
Block a user