aboutsummaryrefslogtreecommitdiff
path: root/lib/arm/assemble.h
diff options
context:
space:
mode:
authorcomex2015-03-01 23:07:15 -0500
committercomex2015-03-01 23:07:15 -0500
commit7f24621bec0b0a5b3cab9ec2dfc68929a2d49d25 (patch)
tree7c227bfa4d8010e23b726eed8efb6bc51746e3f5 /lib/arm/assemble.h
parentseems to work (diff)
downloadsubstitute-7f24621bec0b0a5b3cab9ec2dfc68929a2d49d25.tar.gz
A number of critical fixes painstakingly discovered in the slowest way possible.
Diffstat (limited to 'lib/arm/assemble.h')
-rw-r--r--lib/arm/assemble.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/arm/assemble.h b/lib/arm/assemble.h
index c0af020..2303a7a 100644
--- a/lib/arm/assemble.h
+++ b/lib/arm/assemble.h
@@ -3,6 +3,7 @@
struct assemble_ctx {
void **codep;
+ uint_tptr pc;
bool thumb;
int cond;
};
@@ -100,6 +101,8 @@ static inline void Bccrel(struct assemble_ctx ctx, int offset) {
}
static inline void LDR_PC(struct assemble_ctx ctx, uint32_t dpc) {
+ if (ctx.pc & 2)
+ op16(ctx.codep, 0xbf00);
if (ctx.thumb)
op32(ctx.codep, 0xf000f8df);
else