diff options
author | Yifan Lu | 2016-11-03 23:34:15 -0700 |
---|---|---|
committer | Yifan Lu | 2016-11-03 23:34:15 -0700 |
commit | 158a0d4007fa8f92992f95607dc8f96a0ab4e472 (patch) | |
tree | f59816c6c5af270d7efd6df325ce1c98d4645a43 /lib/arm/assemble.h | |
parent | Implemented call rewrite support, fixes #3 (diff) | |
download | substitute-158a0d4007fa8f92992f95607dc8f96a0ab4e472.tar.gz |
Added ARM PUSH multi instruction assembly
Diffstat (limited to 'lib/arm/assemble.h')
-rw-r--r-- | lib/arm/assemble.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/arm/assemble.h b/lib/arm/assemble.h index e6a72d0..bf1ad03 100644 --- a/lib/arm/assemble.h +++ b/lib/arm/assemble.h @@ -15,6 +15,13 @@ static inline void PUSHone(struct assemble_ctx ctx, int Rt) { op32(ctx.codep, 0x052d0004 | Rt << 12 | ctx.cond << 28); } +static inline void PUSHmulti(struct assemble_ctx ctx, uint16_t mask) { + if (ctx.thumb) + op32(ctx.codep, 0x0000e8ad | mask << 16); + else + op32(ctx.codep, 0x092d0000 | mask | ctx.cond << 28); +} + static inline void POPone(struct assemble_ctx ctx, int Rt) { if (ctx.thumb) op32(ctx.codep, 0x0b04f85d | Rt << 28); |