diff options
| author | Damien George <damien@micropython.org> | 2022-05-20 16:18:09 +1000 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2022-05-23 14:21:16 +1000 |
| commit | 8af5e2551fb2605c03e36400003feccb6d1acafd (patch) | |
| tree | 9ab757be4fc84583f60f4d7c329c1287e857214b /py/asmarm.c | |
| parent | 94ae0231367fe9a63aed10564084ac7d84089216 (diff) | |
py/asmarm: Add asm_arm_ldrh_reg_reg_offset() helper func.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'py/asmarm.c')
| -rw-r--r-- | py/asmarm.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/py/asmarm.c b/py/asmarm.c index 4ba93d080..42724e4d4 100644 --- a/py/asmarm.c +++ b/py/asmarm.c @@ -304,6 +304,11 @@ void asm_arm_ldrh_reg_reg(asm_arm_t *as, uint rd, uint rn) { emit_al(as, 0x1d000b0 | (rn << 16) | (rd << 12)); } +void asm_arm_ldrh_reg_reg_offset(asm_arm_t *as, uint rd, uint rn, uint byte_offset) { + // ldrh rd, [rn, #off] + emit_al(as, 0x1f000b0 | (rn << 16) | (rd << 12) | ((byte_offset & 0xf0) << 4) | (byte_offset & 0xf)); +} + void asm_arm_ldrb_reg_reg(asm_arm_t *as, uint rd, uint rn) { // ldrb rd, [rn] emit_al(as, 0x5d00000 | (rn << 16) | (rd << 12)); |
