Beispiel #1
0
        public static void Movmm(Cpu cpu, uint rX, uint rY)
        {
            var vAddr = cpu.Registers[rY];
            var value = cpu.Read(vAddr);

            vAddr = cpu.Registers[rX];
            cpu.Write(vAddr, value);
        }
Beispiel #2
0
        public static void Popm(Cpu cpu, uint rX)
        {
            var value = cpu.Pop();

            var vAddr = cpu.Registers[rX];

            cpu.Write(vAddr, value);
        }
Beispiel #3
0
        public static void MapShared(Cpu cpu, uint rX, uint rY)
        {
            var vAddr = cpu.Registers[rX];
            var count = cpu.Registers[rY];

            while (--count > 0)
            {
                cpu.Write(vAddr, 0);
                vAddr += 4;
            }
        }
Beispiel #4
0
        private static void WriteValue(Cpu cpu, OpCodeFlag flag, uint param, uint value)
        {
            switch (flag)
            {
            case OpCodeFlag.Register:
                cpu.Registers[param] = value;
                break;

            case OpCodeFlag.MemoryAddress:
                cpu.Write(cpu.Registers[param], value);
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(flag));
            }
        }
Beispiel #5
0
        public static void Movrm(Cpu cpu, uint rX, uint rY)
        {
            var vAddr = cpu.Registers[rX];

            cpu.Write(vAddr, cpu.Registers[rY]);
        }
Beispiel #6
0
        public static void Popm(Cpu cpu, uint rX)
        {
            var value = cpu.Pop();

            var vAddr = cpu.Registers[rX];
            cpu.Write(vAddr, value);
        }
Beispiel #7
0
 public static void Movrm(Cpu cpu, uint rX, uint rY)
 {
     var vAddr = cpu.Registers[rX];
     cpu.Write(vAddr, cpu.Registers[rY]);
 }
Beispiel #8
0
        public static void Movmm(Cpu cpu, uint rX, uint rY)
        {
            var vAddr = cpu.Registers[rY];
            var value = cpu.Read(vAddr);

            vAddr = cpu.Registers[rX];
            cpu.Write(vAddr, value);
        }
Beispiel #9
0
        public static void MapShared(Cpu cpu, uint rX, uint rY)
        {
            var vAddr = cpu.Registers[rX];
            var count = cpu.Registers[rY];

            while (--count > 0)
            {
                cpu.Write(vAddr, 0);
                vAddr += 4;
            }
        }
 private static void WriteValue(Cpu cpu, OpCodeFlag flag, uint param, uint value)
 {
     switch (flag)
     {
         case OpCodeFlag.Register:
             cpu.Registers[param] = value;
             break;
         case OpCodeFlag.MemoryAddress:
             cpu.Write(cpu.Registers[param], value);
             break;
         default:
             throw new ArgumentOutOfRangeException(nameof(flag));
     }
 }