Exemplo n.º 1
0
        public void setMemoryValue(int memPos, int signifDigit, int loverDigit)
        {
            int index1 = memPos;

            this.memory[index1].signifBit = (byte)signifDigit;
            this.memory[index1].lowerBit  = (byte)loverDigit;
            int val = signifDigit << 4 | loverDigit;

            if (index1 == 0x01)//port 0x01 //251
            {
                CDigitValue = val;
                string bit = CMemory.IntToBit((long)val);
                for (int index2 = 0; index2 < 8; ++index2)
                {
                    this.PPI.setLamp(7 - index2, index2 < bit.Length && (int)bit[bit.Length - index2 - 1] == 49);
                }
            }
            if (index1 == 0xF9) //port 0xF9
            {
                CDigitValue = val;
                string bit = CMemory.IntToBit((long)val);
                for (int index2 = 0; index2 < 8; ++index2)
                {
                    this.PPI.setLamp(7 - index2, index2 < bit.Length && (int)bit[bit.Length - index2 - 1] == 49);
                }
            }
            if (index1 != 0x02) // 252
            {
                return;
            }
            this.PPI.setCword(val);
        }
Exemplo n.º 2
0
        public void setMemoryValue(string memPos, int signifDigit, int loverDigit)
        {
            int index1 = CMemory.HexToInt(memPos);

            this.memory[index1].signifBit = (byte)signifDigit;
            this.memory[index1].lowerBit  = (byte)loverDigit;
            int val = signifDigit << 4 | loverDigit;

            if (index1 == 251)
            {
                string bit = CMemory.IntToBit((long)val);
                for (int index2 = 0; index2 < 8; ++index2)
                {
                    this.PPI.setLamp(7 - index2, index2 < bit.Length && (int)bit[bit.Length - index2 - 1] == 49);
                }
            }
            if (index1 != 252)
            {
                return;
            }
            this.PPI.setCword(val);
        }