public String toString()
        {
            //Print the Process ID and process state (READY, RUNNING, BLOCKED)
            String result = "Process id " + processId + " ";
            if (isBlocked())
            {
                result = result + "is BLOCKED for ";
                //Print device, syscall and address that caused the BLOCKED state
                if (blockedForOperation == SYSCALL_OPEN)
                    result += "OPEN";
                else
                    result += "WRITE @" + blockedForAddr;
                
                for(DeviceInfo di : m_devices)
                {
                    if (di.getDevice() == blockedForDevice)
                    {
                        result += " on device #" + di.getId();
                        break;
                    }
                }
                result += ": ";
            }
            else if (this == m_currProcess)
                result += "is RUNNING: ";
            else
                result += "is READY: ";

            //Print the register values stored in this object.  These don't
            //necessarily match what's on the CPU for a Running process.
            if (registers == null)
                return result + "<never saved>";
            
            for(int i = 0; i < CPU.NUMGENREG; i++)
                result += ("r" + i + "=" + registers[i] + " ");

            //Print the starve time statistics for this process
            return result + ("PC=" + registers[CPU.PC] + " ") + ("SP=" + registers[CPU.SP] + " ") 
                    + ("BASE=" + registers[CPU.BASE] + " ") + ("LIM=" + registers[CPU.LIM] + " ") 
                    + "\n\t\t\t" + " Max Starve Time: " + maxStarve + " Avg Starve Time: " + avgStarve;
        }//toString