aboutsummaryrefslogtreecommitdiff
path: root/ARMeilleure/Decoders/OpCode32.cs
diff options
context:
space:
mode:
Diffstat (limited to 'ARMeilleure/Decoders/OpCode32.cs')
-rw-r--r--ARMeilleure/Decoders/OpCode32.cs21
1 files changed, 21 insertions, 0 deletions
diff --git a/ARMeilleure/Decoders/OpCode32.cs b/ARMeilleure/Decoders/OpCode32.cs
new file mode 100644
index 00000000..20927d5e
--- /dev/null
+++ b/ARMeilleure/Decoders/OpCode32.cs
@@ -0,0 +1,21 @@
+namespace ARMeilleure.Decoders
+{
+ class OpCode32 : OpCode
+ {
+ public Condition Cond { get; protected set; }
+
+ public OpCode32(InstDescriptor inst, ulong address, int opCode) : base(inst, address, opCode)
+ {
+ RegisterSize = RegisterSize.Int32;
+
+ Cond = (Condition)((uint)opCode >> 28);
+ }
+
+ public uint GetPc()
+ {
+ // Due to backwards compatibility and legacy behavior of ARMv4 CPUs pipeline,
+ // the PC actually points 2 instructions ahead.
+ return (uint)Address + (uint)OpCodeSizeInBytes * 2;
+ }
+ }
+} \ No newline at end of file