📄 instruction.h
字号:
void printJumpCall(FILE* f) const; /** * Print the instruction as a JumpSS or CallSS instruction. */ void printJumpCallSS(FILE* f, bool isJump) const; /** * Print the instruction as a JumpSS instruction. */ void printJumpSS(FILE* f) const; /** * Print the instruction as a CallSS instruction. */ void printCallSS(FILE* f) const; /** * Print the instruction as a system register setting one. */ void printSetSysReg(FILE* f) const; /** * Print the instruction as a register setting one. */ void printSet(FILE* f) const; /** * Print register setting part of the instruction */ void printSet(FILE* f, unsigned value1, bool isDir, unsigned value2) const; /** * Print the instruction as a register setting and conditional * linking one. */ void printSetCLnk(FILE* f) const; /** * Print register setting part of the instruction if it is a * combined setting and linking instruction */ bool printSetWithLink(FILE* f) const; /** * Print the instruction as a condition register setting and * conditional linking one. */ void printCSetCLnk(FILE* f) const; /** * Print the instruction as a comparing, register setting and * linking one. */ void printCmpSetLnk(FILE* f) const; /** * Print a version 1 condition */ bool printConditionV1(FILE* f) const; /** * Print a version 2 condition */ bool printConditionV2(FILE* f) const; /** * Print a version 3 condition */ bool printConditionV3(FILE* f) const; /** * Print a version 4 condition */ bool printConditionV4(FILE* f) const; /** * Print a special condition */ bool printSpecialCondition(FILE* f) const; /** * Print a link condition */ bool printLinkCondition(FILE* f) const; /** * Print a jump/call condition. */ bool printJumpCallCondition(FILE* f) const; /** * Print a system register setting condition */ bool printSetSysRegCondition(FILE* f) const; /** * Print a register setting condition */ bool printSetCondition(FILE* f) const; /** * Print a set and conditional link condition */ bool printSetCLnkCondition(FILE* f) const; /** * Print a conditional set and link condition */ bool printCSetCLnkCondition(FILE* f) const; /** * Print a conditional set and unconditional link condition */ bool printCmpSetLnkCondition(FILE* f) const;};//------------------------------------------------------------------------------// Inline definitions//------------------------------------------------------------------------------//------------------------------------------------------------------------------// Operand//------------------------------------------------------------------------------template <typename T>inline unsigned BitExtractor<T>::getBits(T x, unsigned from, unsigned numBits){ return (x>>from)&(~(fullMask<<numBits));}//------------------------------------------------------------------------------//------------------------------------------------------------------------------inline unsigned Operand::getHigh() const{ return high;}//------------------------------------------------------------------------------inline unsigned Operand::getLow() const{ return low;}//------------------------------------------------------------------------------inline unsigned Operand::getValue() const{ return (((unsigned)high)<<8) | low;}//------------------------------------------------------------------------------//------------------------------------------------------------------------------inline unsigned Operand::getHighBits(unsigned from, unsigned numBits) const{ return BitExtractor<unsigned char>::getBits(high, from, numBits);}//------------------------------------------------------------------------------inline unsigned Operand::getLowBits(unsigned from, unsigned numBits) const{ return BitExtractor<unsigned char>::getBits(low, from, numBits);}//------------------------------------------------------------------------------inline unsigned Operand::getBits(unsigned from, unsigned numBits) const{ if (from>=8) return getHighBits(from-8, numBits); else if ( (from+numBits)<=8) return getLowBits(from, numBits); else { return BitExtractor<unsigned>::getBits(getValue(), from, numBits); }}//------------------------------------------------------------------------------//------------------------------------------------------------------------------// Operand1//------------------------------------------------------------------------------inline unsigned Operand1::getCR1() const{ return getLow();}//------------------------------------------------------------------------------inline unsigned Operand1::getPTTN() const{ return getBits(0, 10);}//------------------------------------------------------------------------------inline unsigned Operand1::getTTN() const{ return getLowBits(0, 7);}//------------------------------------------------------------------------------inline unsigned Operand1::getPGCN() const{ return getBits(0, 15);}//------------------------------------------------------------------------------inline bool Operand1::isAF() const{ return getLowBits(7, 1)!=0;}//------------------------------------------------------------------------------inline unsigned Operand1::getSR1() const{ return getLowBits(0, 4);} //------------------------------------------------------------------------------inline unsigned Operand1::getSRS() const{ return getLow();}//------------------------------------------------------------------------------inline unsigned Operand1::getSVAL() const{ return getValue();}//------------------------------------------------------------------------------inline unsigned Operand1::getAVAL() const{ return getLowBits(0, 7);} //------------------------------------------------------------------------------inline unsigned Operand1::getSRD() const{ return getLowBits(0, 4);}//------------------------------------------------------------------------------inline unsigned Operand1::getSetCR1() const{ return getHigh();}//------------------------------------------------------------------------------// Operand2//------------------------------------------------------------------------------inline unsigned Operand2::getCR2() const{ return getLow();}//------------------------------------------------------------------------------inline unsigned Operand2::getCVAL() const{ return getValue();}//------------------------------------------------------------------------------inline unsigned Operand2::getTTN() const{ return getLowBits(0, 7);}//------------------------------------------------------------------------------inline unsigned Operand2::getVTS() const{ return getHigh();} //------------------------------------------------------------------------------inline Operand2::jumpCallType_t Operand2::getJumpCallType() const{ return (jumpCallType_t)getLowBits(6, 2);}//------------------------------------------------------------------------------inline unsigned Operand2::getMenu() const{ return getLowBits(0, 4);}//------------------------------------------------------------------------------inline unsigned Operand2::getRSMCell() const{ return getHigh();}//------------------------------------------------------------------------------inline bool Operand2::isSF() const{ return getHighBits(7, 1)!=0;}//------------------------------------------------------------------------------inline unsigned Operand2::getSR2() const{ return getHighBits(0, 4);}//------------------------------------------------------------------------------inline unsigned Operand2::getSVAL() const{ return getHighBits(0, 7);}//------------------------------------------------------------------------------inline bool Operand2::isNF() const{ return getLowBits(7, 1)!=0;}//------------------------------------------------------------------------------inline unsigned Operand2::getSR3() const{ return getLowBits(0, 4);}//------------------------------------------------------------------------------inline unsigned Operand2::getNVAL() const{ return getLowBits(0, 7);}//------------------------------------------------------------------------------inline unsigned Operand2::getPGCN() const{ return getLow();}//------------------------------------------------------------------------------inline bool Operand2::isMF() const{ return getLowBits(7, 1)!=0;}//------------------------------------------------------------------------------inline unsigned Operand2::getSRD() const{ return getLowBits(0, 4);}//------------------------------------------------------------------------------inline unsigned Operand2::getSRS() const{ return getLow();}//------------------------------------------------------------------------------// Operand3//------------------------------------------------------------------------------inline unsigned Operand3::getLineNumber() const{ return getLow();}//------------------------------------------------------------------------------inline unsigned Operand3::getLVL() const{ return getHighBits(0, 4);}//------------------------------------------------------------------------------inline unsigned Operand3::getHLBN() const{ return getHighBits(2, 6);}//------------------------------------------------------------------------------inline Operand3::link_t Operand3::getLinkType() const{ return (link_t)getLowBits(0, 5);}//------------------------------------------------------------------------------inline unsigned Operand3::getPGCN() const{ return getBits(0, 15);}//------------------------------------------------------------------------------inline unsigned Operand3::getPTTN() const{ return getBits(0, 10);}//------------------------------------------------------------------------------inline unsigned Operand3::getPGN() const{ return getLowBits(0, 7);}//------------------------------------------------------------------------------inline unsigned Operand3::getCN() const{ return getLow();}//------------------------------------------------------------------------------inline unsigned Operand3::getCR1() const{ return getHigh();}//------------------------------------------------------------------------------inline unsigned Operand3::getCR2() const{ return getLow();}//------------------------------------------------------------------------------inline unsigned Operand3::getCVAL() const{ return getValue();}//------------------------------------------------------------------------------// Instruction//------------------------------------------------------------------------------inline Instruction::type_t Instruction::getType() const{ return (type_t)type;}//------------------------------------------------------------------------------inline bool Instruction::isDirect() const{ return direct != 0;}//------------------------------------------------------------------------------inline Instruction::setType_t Instruction::getSetType() const{ return (setType_t)_set;}//------------------------------------------------------------------------------inline Instruction::setOp_t Instruction::getSetOp() const{ return (setOp_t)_set;}//------------------------------------------------------------------------------inline bool Instruction::isCmpDirect() const{ return dircmp;} //------------------------------------------------------------------------------inline Instruction::cmpOp_t Instruction::getCmpOp() const{ return (cmpOp_t)cmp;}//------------------------------------------------------------------------------inline Instruction::specCmd_t Instruction::getSpecCmd() const{ return (specCmd_t)cmd;}//------------------------------------------------------------------------------inline Instruction::linkCmd_t Instruction::getLinkCmd() const{ return (linkCmd_t)cmd;}//------------------------------------------------------------------------------inline Instruction::jumpCallCmd_t Instruction::getJumpCallCmd() const{ return (jumpCallCmd_t)cmd;}//------------------------------------------------------------------------------inline unsigned Instruction::getCR1() const{ return cmd;}//------------------------------------------------------------------------------inline unsigned Instruction::getSRD() const{ return cmd;}//------------------------------------------------------------------------------} /* namespace dvd::vm */ } /* namespace dvd *///------------------------------------------------------------------------------#endif // DXR3PLAYER_DVD_VM_H// Local variables:// mode: c++// End:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -