Add Instructions for PIC Support #15
Labels
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: AbleOS/holey-bytes#15
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
Add the following instructions to the ISA, to support generation of PIC and PIE code. In all instructions
PC
is computed from the byte immediately following the last byte of the instruction| Instruction Name | Mode | Effects |
|==================|======|========================|
| LRA | BBD |
#1 <- #2 + imm #3 + PC
|| LDR | BBDH |
#0 <- imm #4 [#2 + imm #3 + PC]
|| STR | BBDH |
imm #4 [#2 + imm #3 + PC]
|| JMPR | D | Jumps tp
#1 + PC
|| JALR | BBD |
#0 <- PC
Jumps to#1 + imm #2 + PC
|| JEQR | BBD | If
#0 == #1
Jumps toimm #2 + PC
|| JNER | BBD | If
#0 != #1
Jumps toimm #2 + PC
|| JLTR | BBD | If
#0 < #1
(signed) Jumps toimm #2 + PC
|| JGTR | BBD | If
#0 > #1
(signed) Jumps toimm #2 + PC
|| JLTUR | BBD | If
#0 < #1
(unsigned) Jumps toimm #2 + PC
|| JGTUR | BBD | If
#0 > #1
(unsigned) Jumps toimm #2 + PC
|Also add relaxed 8-bit and 32-bit version replacing the D operand with B or W respectively, for more compact codegen in common cases. Suggested mnemonics:
_8
(IE.LRA8
) and_32
(IE.LRA32
)