Mano pdp8 SecondPass.cc
SecondPass.cc
// SecondPass Class #ifndef SECONDPASS_CC #define SECONDPASS_CC #ifndef MANO_H #include "mano.h" #endif #ifndef CHAR_STRING_CC #include "charString.cc" #endif class SecondPass { charString charString_mLabel; // Label charString charString_mCommand; // Command short s_mLocationCount; // Location Counter short s_mLineNumber; // Absolute line number public: SecondPass() { s_mLocationCount = 0; s_mLineNumber = 0; } ~SecondPass(){} SecondPass( const SecondPass& B) { charString_mCommand = B.charString_mCommand; charString_mLabel = B.charString_mLabel; s_mLocationCount = B.s_mLocationCount; s_mLineNumber = B.s_mLineNumber; } int operator != ( const SecondPass &B ) { if( DEBUG ) cout << "SecondPass: != 0" << endl; return ( charString_mLabel != B.charString_mLabel ); } int operator < ( const SecondPass &B ) { if( DEBUG ) cout << "SecondPass: < 0" << endl; return ( charString_mLabel < B.charString_mLabel ); } int operator > ( const SecondPass &B ) { if( DEBUG ) cout << "SecondPass: > 0" << endl; return ( charString_mLabel > B.charString_mLabel ); } SecondPass operator = ( const SecondPass &B ) { if( DEBUG ) cout << "SecondPass: = 0" << endl; charString_mCommand = B.charString_mCommand; charString_mLabel = B.charString_mLabel; s_mLocationCount = B.s_mLocationCount; return *this; } int operator == ( const SecondPass &B ) { if( DEBUG ) cout << "SecondPass: == 0" << endl; return ( charString_mLabel == B.charString_mLabel ); } void FillSecondPass( charString charString_A, charString charString_B, short s_Location, short s_linenumber ) { if( DEBUG ) cout << "SecondPass: FillSecondPass 0" << endl; charString_mLabel = charString_A; charString_mCommand = charString_B; s_mLocationCount = s_Location; s_mLineNumber = s_linenumber; } charString returnCommand() { if( DEBUG ) cout << "SecondPass: returnCommand 0" << endl; return charString_mCommand; } charString returnLabel() { if( DEBUG ) cout << "SecondPass: returnLabel 0" << endl; return charString_mLabel; } short returnLocation() { if( DEBUG ) cout << "SecondPass: returnLocation 0" << endl; return s_mLocationCount; } short returnLineNumber() { if( DEBUG ) cout << "SecondPass: returnLineNumber 0" << endl; return s_mLineNumber; } }; #endif // end SecondPass
Internal Links
Parent Article: Mano PDP-8 Simulation Project Source Code