From 158a0d4007fa8f92992f95607dc8f96a0ab4e472 Mon Sep 17 00:00:00 2001 From: Yifan Lu Date: Thu, 3 Nov 2016 23:34:15 -0700 Subject: Added ARM PUSH multi instruction assembly --- lib/arm/assemble.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/arm/assemble.h') 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); -- cgit v1.2.3