/* SmArc VMachine - Simplified SPARC emulator Copyright (C) 2002 Michal Stochmialek This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* * $Id: psr.h,v 1.1 2002/12/28 16:28:11 misto Exp $ */ #ifndef SMARC_PROC_PSR_H #define SMARC_PROC_PSR_H // processor status register class PSR { private: // CWP - current window pointer unsigned int CWP : 5; // ET - traps enabled - NOT USED in SmArc unsigned int ET : 1; // PS - previous state (?) (user/supervisor mode) // NOT USED in SmArc unsigned int PS : 1; // S - state (?) (user/supervisor mode) // NOT USED in SmArc unsigned int S : 1; // PIL - interrupt mask - NOT USED in SmArc unsigned int PIL : 4; // EF - enable ftp - NOT USED in SmArc unsigned int EF : 1; // EC - enable coprocessor - NOT USED in SmArc unsigned int EC : 1; // C - carry flag unsigned int C : 1; // V - overflow flag unsigned int V : 1; // Z - zero flag unsigned int Z : 1; // N - negative flag unsigned int N : 1; // VER - version - NOT used in SmArc unsigned int VER : 4; // IMPL - implementation - NOT used in SmArc unsigned int IMPL : 4; public: PSR( void ) : // FIXME: is this right? CWP(0), // traps disabled ET(0), // supervisor mode on PS(1), S(1), // traps mask set to 0 PIL(0), // flp and coprocessor disabled EF(0), EC(0), // N, Z, V, C - cleared C(0),V(0),Z(0),N(0), // version and implementation set to 1 // FIXME: better ideas? VER(1), IMPL(1) {}; friend class vmachine; friend class alu; }; #endif