CCPU Class Reference

#include <ccpu.h>

List of all members.

Public Member Functions

 CCPU (const unsigned cnt)
 Default ctor.
 ~CCPU ()
 Default dtor.
const unsigned getRegisterCount () const
 get number of registers
CDatgetRegisters () const
 get pointer to registers array
void setMemory (CMem *memory)
 set memory of cpu
CMemgetMemory () const
 get pointer to memory
void setProgram (const CProgram *program)
 set program to execute
const CProgramgetProgram ()
 get pointer to program
const std::set
< CDisplay * > & 
getDisplays ()
 get set of pointers to displays
void setFlagZero (const bool value)
 set zero flag
const bool getFlagZero ()
 get value of zero flag
void setFlagSign (const bool value)
 set sign flag
const bool getFlagSign ()
 get value of sign flag
void run ()
 execute current program


Detailed Description

CPU implementation. Used as a container for memory and instructions. Implements a run method to execute the program (= the instructions).

Constructor & Destructor Documentation

CCPU::CCPU ( const unsigned  cnt  ) 

Default ctor.

Methodname:
CCPU
Parameters:
cnt number of registers to allocate for this cpu
Returns:
-
Global variables used:
none
Exceptions:
none 
Conditions:
none

CCPU::~CCPU (  ) 

Default dtor.

Methodname:
~CCPU
Parameters:
- 
Returns:
-
Global variables used:
none
Exceptions:
none 
Conditions:
none


Member Function Documentation

const unsigned CCPU::getRegisterCount (  )  const [inline]

get number of registers

Methodname:
getRegisterCount
Parameters:
- 
Returns:
number of registers
Global variables used:
none
Exceptions:
none 
Conditions:
none

CDat* CCPU::getRegisters (  )  const [inline]

get pointer to registers array

Methodname:
getRegisters
Parameters:
- 
Returns:
pointer to registers array
Global variables used:
none
Exceptions:
none 
Conditions:
none

void CCPU::setMemory ( CMem memory  )  [inline]

set memory of cpu

Methodname:
setMemory
Parameters:
memory pointer to memory
Returns:
-
Global variables used:
none
Exceptions:
none 
Conditions:
none

CMem* CCPU::getMemory (  )  const [inline]

get pointer to memory

Methodname:
getMemory
Parameters:
- 
Returns:
pointer to memory
Global variables used:
none
Exceptions:
none 
Conditions:
none

void CCPU::setProgram ( const CProgram program  )  [inline]

set program to execute

Methodname:
setProgram
Parameters:
program pointer to program
Returns:
-
Global variables used:
none
Exceptions:
none 
Conditions:
none

const CProgram* CCPU::getProgram (  )  [inline]

get pointer to program

Methodname:
getProgram
Parameters:
- 
Returns:
pointer to program
Global variables used:
none
Exceptions:
none 
Conditions:
none

const std::set<CDisplay *>& CCPU::getDisplays (  )  [inline]

get set of pointers to displays

Methodname:
getDisplays
Parameters:
- 
Returns:
reference to set of pointers to displays
Global variables used:
none
Exceptions:
none 
Conditions:
none

void CCPU::setFlagZero ( const bool  value  )  [inline]

set zero flag

Methodname:
setFlagZero
Parameters:
value new value of zero flag
Returns:
-
Global variables used:
none
Exceptions:
none 
Conditions:
none

const bool CCPU::getFlagZero (  )  [inline]

get value of zero flag

Methodname:
getFlagZero
Parameters:
- 
Returns:
value of zero flag
Global variables used:
none
Exceptions:
none 
Conditions:
none

void CCPU::setFlagSign ( const bool  value  )  [inline]

set sign flag

Methodname:
setFlagSign
Parameters:
value new value of sign flag
Returns:
-
Global variables used:
none
Exceptions:
none 
Conditions:
none

const bool CCPU::getFlagSign (  )  [inline]

get value of sign flag

Methodname:
getFlagSign
Parameters:
- 
Returns:
value of sign flag
Global variables used:
none
Exceptions:
none 
Conditions:
none

void CCPU::run (  ) 

execute current program

Methodname:
run
Parameters:
- 
Returns:
-
Global variables used:
none
Exceptions:
std::runtime_error 
Conditions:
none


The documentation for this class was generated from the following files:
Generated on Thu May 14 18:19:17 2009 for mycpu by  doxygen 1.5.3