Skip to content

Commit

Permalink
adds two missing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hneemann committed Dec 2, 2020
1 parent b96965a commit ffed701
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/java/de/neemann/assembler/asm/Opcode.java
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ MnemonicArguments.DEST_BSOURCE_BCONST, new Flags()
.set(EnRegWrite.Yes)
.set(SourceToAluA.Yes)),

LPM("Loads the value at program address [Rs] to register Rd.",
LPM("Loads the value at program address [Rs] to register Rd. In a single cycle machine this requires dual ported program memory.",
MnemonicArguments.DEST_BSOURCE, new Flags()
.set(ALUBSel.Rom)
.set(ALUCmd.PassInB)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

public class TestGenerator implements Test {
private static final int DELTAY = 80;
private static final int DELTAX = 160;
private static final int DELTAX = 200;
private final ArrayList<Method> methodList;
private final Object testMethods;
private int maxCols = 10;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,22 +121,27 @@ public void testShift(Test test) throws ExpressionException, ParserException, In
test.add(new ProcessorTest("LSL")
.setRegister("R1", 8)
.run("lsl r1")
.checkCarry(false)
.checkRegister("R1", 16));
test.add(new ProcessorTest("LSR")
.setRegister("R1", 8)
.run("lsr r1")
.checkCarry(false)
.checkRegister("R1", 4));
test.add(new ProcessorTest("LSR")
.setRegister("R1", 0xffff)
.run("lsr r1")
.checkCarry(true)
.checkRegister("R1", 0x7fff));
test.add(new ProcessorTest("ASR")
.setRegister("R1", 8)
.run("asr r1")
.checkCarry(false)
.checkRegister("R1", 4));
test.add(new ProcessorTest("ASR")
.setRegister("R1", 0xffff)
.run("asr r1")
.checkCarry(true)
.checkRegister("R1", 0xffff));
}

Expand All @@ -145,21 +150,37 @@ public void testRotate(Test test) throws ExpressionException, ParserException, I
.setCarry(false)
.setRegister("R1", 8)
.run("ror r1")
.checkCarry(false)
.checkRegister("R1", 4));
test.add(new ProcessorTest("ROR")
.setCarry(false)
.setRegister("R1", 9)
.run("ror r1")
.checkCarry(true)
.checkRegister("R1", 4));
test.add(new ProcessorTest("ROR")
.setCarry(true)
.setRegister("R1", 8)
.run("ror r1")
.checkCarry(false)
.checkRegister("R1", 0x8004));
test.add(new ProcessorTest("ROL")
.setCarry(false)
.setRegister("R1", 8)
.run("rol r1")
.checkCarry(false)
.checkRegister("R1", 16));
test.add(new ProcessorTest("ROL")
.setCarry(false)
.setRegister("R1", 0x8008)
.run("rol r1")
.checkCarry(true)
.checkRegister("R1", 16));
test.add(new ProcessorTest("ROL")
.setCarry(true)
.setRegister("R1", 8)
.run("rol r1")
.checkCarry(false)
.checkRegister("R1", 17));
}

Expand Down

0 comments on commit ffed701

Please sign in to comment.