public void ConstantJnz() { Test(new Dictionary <string, int> { { "a", 0 }, { "b", -20 }, { "c", -2 } }, SimpleAssembler.Interpret(new[] { "mov a -10", "mov b a", "mov c -2", "inc a", "dec b", "jnz a c" })); }
public void ExtremeCase() { Test(new Dictionary <string, int> { { "ab", 5 }, { "bb", 5 } }, SimpleAssembler.Interpret(new[] { "mov ab 5", "mov bb ab", "jnz cb 2", "dec ab", "jnz ab 15" })); }
public void ExamplePrograms() { Test(new Dictionary <string, int> { { "a", 1 } }, SimpleAssembler.Interpret(new[] { "mov a 5", "inc a", "dec a", "dec a", "jnz a -1", "inc a" })); Test(new Dictionary <string, int> { { "a", 0 }, { "b", -20 } }, SimpleAssembler.Interpret(new[] { "mov a -10", "mov b a", "inc a", "dec b", "jnz a -2" })); }