diff --git a/src/main/java/lysis/builder/MethodParser.java b/src/main/java/lysis/builder/MethodParser.java index df69445..ea15dca 100644 --- a/src/main/java/lysis/builder/MethodParser.java +++ b/src/main/java/lysis/builder/MethodParser.java @@ -72,7 +72,6 @@ import lysis.instructions.LZeroGlobal; import lysis.instructions.LZeroLocal; import lysis.instructions.SwitchCase; -import lysis.instructions.LAlign; import lysis.lstructure.Function; import lysis.lstructure.LBlock; import lysis.lstructure.LGraph; @@ -228,13 +227,6 @@ private LInstruction readInstruction(SPOpcode op) throws Exception { case idxaddr_b: return new LIndexAddress(readInt32()); - case align_pri: - case align_alt: - { - Register reg = (op == SPOpcode.addr_pri) ? Register.Pri : Register.Alt; - return new LAlign(reg); - } - case move_pri: case move_alt: { Register reg = (op == SPOpcode.move_pri) ? Register.Pri : Register.Alt; @@ -692,6 +684,13 @@ private LInstruction readInstruction(SPOpcode op) throws Exception { pc_ += num - 8; // skip dbgname return new LDebugBreak(); } + + case align_pri: + case align_alt: + { + Register reg = (op == SPOpcode.addr_pri) ? Register.Pri : Register.Alt; + return new LAlign(trackGlobal(readInt32()), reg); + } default: throw new Exception("Unrecognized opcode: " + op); diff --git a/src/main/java/lysis/instructions/LAlign.java b/src/main/java/lysis/instructions/LAlign.java index aef05bb..a56ef53 100644 --- a/src/main/java/lysis/instructions/LAlign.java +++ b/src/main/java/lysis/instructions/LAlign.java @@ -6,9 +6,15 @@ import lysis.lstructure.Register; public class LAlign extends LInstructionReg { + + private long offset_; - public LAlign(Register reg) { - super(reg); + public long offset() { + return offset_; + } + public LAlign(long offset, Register reg) { + super(reg); + offset_ = offset; } @Override @@ -19,6 +25,6 @@ public Opcode op() { @Override public void print(DataOutputStream tw) throws IOException { tw.writeBytes("align." + RegisterName(reg()) + ", " - + (reg() == Register.Pri ? RegisterName(Register.Alt) : RegisterName(Register.Pri))); + + (reg() == Register.Pri ? RegisterName(Register.Alt) : RegisterName(Register.Pri)) + offset()); } } \ No newline at end of file