Exemple #1
0
        private bool FileDeleteInterrupt()
        {
            int x = GetCurrentCommandSecondLastArgument();

            char[][] fileNameBlock = VirtualMemory.GetBlockValues(x * Utility.BLOCK_SIZE);
            if (!FileManager.DeleteFile(fileNameBlock))
            {
                return(false);
            }

            ResetSIRegister();
            return(false);
        }
Exemple #2
0
        private bool FileWriteBlockInterrupt()
        {
            int[]    xy          = GetCurrentCommandLastTwoArguments();
            char[][] blockToFile = VirtualMemory.GetBlockValues(xy[1] * Utility.BLOCK_SIZE);
            bool     result      = FileManager.WriteFile(xy[0], blockToFile);

            if (!result)
            {
                return(false);
            }

            ResetSIRegister();
            return(true);
        }
Exemple #3
0
        private bool FileOpenInterrupt()
        {
            int  x = GetCurrentCommandLastArgument();
            char r = GetCurrentCommandSecondLastArgumentChar();

            char[][] block = VirtualMemory.GetBlockValues(x * Utility.BLOCK_SIZE);

            int fileIndex = FileManager.OpenFile(block, r);

            if (fileIndex == -1)
            {
                return(false);
            }

            Processor.SetRegisterValue("R1", fileIndex.IntToHex());
            ResetSIRegister();
            return(true);
        }