Skip to content

CPU

INCLUDE FILE
#include "CPU.h"

class CPU

Represents a CPU, which defines its instruction sets, its syntax and encoding.

DEFINITION
class CPU;

method add_addressing_modeprivate

DEFINITION
void  add_addressing_mode ( Symbol  name,
AddressingMode  addressing_mode );
PARAMETERDESCRIPTION
name
addressing_mode

method add_argument_typeprivate

DEFINITION
void  add_argument_type ( Symbol  name,
std::unique_ptr< ArgumentType >  argument_type );
PARAMETERDESCRIPTION
name
argument_type

method add_punctuationprivate

DEFINITION
void  add_punctuation ( Symbol  name );
PARAMETERDESCRIPTION
name

method add_reserved_wordprivate

DEFINITION
void  add_reserved_word ( Symbol  word );
PARAMETERDESCRIPTION
word

method addressing_modeconst

DEFINITION
const AddressingMode * addressing_mode ( Symbol  name ) const;
PARAMETERDESCRIPTION
name
RETURNSDESCRIPTION
const AddressingMode *

method argument_typeconst

DEFINITION
const ArgumentType * argument_type ( Symbol  name ) const;
PARAMETERDESCRIPTION
name
RETURNSDESCRIPTION
const ArgumentType *

method getstatic

DEFINITION
static const CPU & get ( Symbol  name,
Symbol  base = {} );
PARAMETERDESCRIPTION
name
base
RETURNSDESCRIPTION
const CPU &

method instructionconst

DEFINITION
const Instruction * instruction ( Symbol  name ) const;
PARAMETERDESCRIPTION
name
RETURNSDESCRIPTION
const Instruction *

method is_compatible_withconst

DEFINITION
bool  is_compatible_with ( const CPU & other ) const;
PARAMETERDESCRIPTION
other
RETURNSDESCRIPTION
bool

method match_addressing_modesconst

DEFINITION
std::vector< AddressingModeMatcherResult >  match_addressing_modes ( const std::vector< std::shared_ptr< Node > > & arguments ) const;
PARAMETERDESCRIPTION
arguments
RETURNSDESCRIPTION
std::vector< AddressingModeMatcherResult >

method setupconst

DEFINITION
void  setup ( FileTokenizer & tokenizer ) const;
PARAMETERDESCRIPTION
tokenizer

method uses_bracesconst

DEFINITION
bool  uses_braces ( ) const;
RETURNSDESCRIPTION
bool

method uses_empty_mnemonicconst

DEFINITION
bool  uses_empty_mnemonic ( ) const;
RETURNSDESCRIPTION
bool

method uses_punctuationconst

DEFINITION
bool  uses_punctuation ( Symbol  symbol ) const;
PARAMETERDESCRIPTION
symbol
RETURNSDESCRIPTION
bool

member CPUParserprivate

DEFINITION
friend  CPUParser;

member addressing_mode_matcherprivate

DEFINITION
AddressingModeMatcher  addressing_mode_matcher;

member addressing_modesprivate

DEFINITION
std::unordered_map< Symbol, AddressingMode >  addressing_modes;

member argument_typesprivate

DEFINITION
std::unordered_map< Symbol, std::unique_ptr< ArgumentType > >  argument_types;

member byte_order

DEFINITION
uint64_t  byte_order;

member emptystatic

DEFINITION
static const CPU  empty;

member instructionsprivate

DEFINITION
std::unordered_map< Symbol, Instruction >  instructions;

member punctuationprivate

DEFINITION
std::unordered_set< Symbol >  punctuation;

member reserved_wordsprivate

DEFINITION
std::unordered_set< Symbol >  reserved_words;