示例#1
0
        public void TestAlignFill()
        {
            var output = new Compilation();

            output.SetPC(0x4015);

            int foragoodtime = 0xffd220;      // for a good time jsr $ffd2

            output.Align(0x10, foragoodtime); // fill 11 bytes with 0xffd220...

            var bytes1 = output.GetCompilation();

            var expected1 = new byte[] { 0x20, 0xd2, 0xff,
                                         0x20, 0xd2, 0xff,
                                         0x20, 0xd2, 0xff,
                                         0x20, 0xd2 };

            Assert.IsTrue(expected1.SequenceEqual(bytes1));

            output.Reset();
            output.Fill(7, foragoodtime);

            Assert.AreEqual(0x0007, output.LogicalPC);

            var bytes2    = output.GetCompilation();
            var expected2 = new byte[] { 0x20, 0xd2, 0xff,
                                         0x20, 0xd2, 0xff, 0x20 };

            Assert.IsTrue(expected2.SequenceEqual(bytes2));

            output.Reset();
        }