Imports #
"encoding/binary"
"fmt"
"fmt"
"bytes"
"fmt"
"strings"
"fmt"
"strconv"
"strings"
"encoding/binary"
"fmt"
"fmt"
"bytes"
"fmt"
"strings"
"fmt"
"strconv"
"strings"
const Aconst A0const A1const A10const A11const A12const A13const A14const A15const A2const A3const A4const A5const A6const A7const A8const A9const ADconst ADBconst ADBRconst ADRconst ADTRconst ADTRAconst AEconst AEBconst AEBRconst AERconst AFIconst AGconst AGFconst AGFIconst AGFRconst AGHconst AGHIconst AGHIKconst AGRconst AGRKconst AGSIconst AHconst AHHHRconst AHHLRconst AHIconst AHIKconst AHYconst AIHconst ALconst ALCconst ALCGconst ALCGRconst ALCRconst ALFIconst ALGconst ALGFconst ALGFIconst ALGFRconst ALGHSIKconst ALGRconst ALGRKconst ALGSIconst ALHHHRconst ALHHLRconst ALHSIKconst ALRconst ALRKconst ALSIconst ALSIHconst ALSIHNconst ALYconst APconst ARconst ARKconst ASIconst AUconst AURconst AWconst AWRconst AXBRconst AXRconst AXTRconst AXTRAconst AYconst B0 Base = iotaconst B1const B10const B11const B12const B13const B14const B15const B2const B3const B4const B5const B6const B7const B8const B9const BAKRconst BALconst BALRconst BASconst BASRconst BASSMconst BCconst BCRconst BCTconst BCTGconst BCTGRconst BCTRconst BICconst BPPconst BPRPconst BRASconst BRASLconst BRCconst BRCLconst BRCTconst BRCTGconst BRCTHconst BRXHconst BRXHGconst BRXLEconst BRXLGconst BSAconst BSGconst BSMconst BXHconst BXHGconst BXLEconst BXLEGconst Cconst C0const C1const C10const C11const C12const C13const C14const C15const C2const C3const C4const C5const C6const C7const C8const C9const CDconst CDBconst CDBRconst CDFBRconst CDFBRAconst CDFRconst CDFTRconst CDGBRconst CDGBRAconst CDGRconst CDGTRconst CDGTRAconst CDLFBRconst CDLFTRconst CDLGBRconst CDLGTRconst CDPTconst CDRconst CDSconst CDSGconst CDSTRconst CDSYconst CDTRconst CDUTRconst CDZTconst CEconst CEBconst CEBRconst CEDTRconst CEFBRconst CEFBRAconst CEFRconst CEGBRconst CEGBRAconst CEGRconst CELFBRconst CELGBRconst CERconst CEXTRconst CFCconst CFDBRconst CFDBRAconst CFDRconst CFDTRconst CFEBRconst CFEBRAconst CFERconst CFIconst CFXBRconst CFXBRAconst CFXRconst CFXTRconst CGconst CGDBRconst CGDBRAconst CGDRconst CGDTRconst CGDTRAconst CGEBRconst CGEBRAconst CGERconst CGFconst CGFIconst CGFRconst CGFRLconst CGHconst CGHIconst CGHRLconst CGHSIconst CGIBconst CGIJconst CGITconst CGRconst CGRBconst CGRJconst CGRLconst CGRTconst CGXBRconst CGXBRAconst CGXRconst CGXTRconst CGXTRAconst CHconst CHFconst CHHRconst CHHSIconst CHIconst CHLRconst CHRLconst CHSIconst CHYconst CIBconst CIHconst CIJconst CITconst CKSMconst CLconst CLCconst CLCLconst CLCLEconst CLCLUconst CLFDBRconst CLFDTRconst CLFEBRconst CLFHSIconst CLFIconst CLFITconst CLFXBRconst CLFXTRconst CLGconst CLGDBRconst CLGDTRconst CLGEBRconst CLGFconst CLGFIconst CLGFRconst CLGFRLconst CLGHRLconst CLGHSIconst CLGIBconst CLGIJconst CLGITconst CLGRconst CLGRBconst CLGRJconst CLGRLconst CLGRTconst CLGTconst CLGXBRconst CLGXTRconst CLHFconst CLHHRconst CLHHSIconst CLHLRconst CLHRLconst CLIconst CLIBconst CLIHconst CLIJconst CLIYconst CLMconst CLMHconst CLMYconst CLRconst CLRBconst CLRJconst CLRLconst CLRTconst CLSTconst CLTconst CLYconst CMPSCconst CPconst CPDTconst CPSDRconst CPXTconst CPYAconst CRconst CRBconst CRDTEconst CRJconst CRLconst CRTconst CSconst CSCHconst CSDTRconst CSGconst CSPconst CSPGconst CSSTconst CSXTRconst CSYconst CU12const CU14const CU21const CU24const CU41const CU42const CUDTRconst CUSEconst CUXTRconst CVBconst CVBGconst CVBYconst CVDconst CVDGconst CVDYconst CXBRconst CXFBRconst CXFBRAconst CXFRconst CXFTRconst CXGBRconst CXGBRAconst CXGRconst CXGTRconst CXGTRAconst CXLFBRconst CXLFTRconst CXLGBRconst CXLGTRconst CXPTconst CXRconst CXSTRconst CXTRconst CXUTRconst CXZTconst CYconst CZDTconst CZXTconst Dconst DDconst DDBconst DDBRconst DDRconst DDTRconst DDTRAconst DEconst DEBconst DEBRconst DERconst DFLTCCconst DIDBRconst DIEBRconst DLconst DLGconst DLGRconst DLRconst DPconst DRconst DSGconst DSGFconst DSGFRconst DSGRconst DXBRconst DXRconst DXTRconst DXTRAconst EARconst ECAGconst ECTGconst EDconst EDMKconst EEDTRconst EEXTRconst EFPCconst EPAIRconst EPARconst EPSWconst EREGconst EREGGconst ESAIRconst ESARconst ESDTRconst ESEAconst ESTAconst ESXTRconst ETNDconst EXconst EXRLconst F0const F1const F10const F11const F12const F13const F14const F15const F2const F3const F4const F5const F6const F7const F8const F9const FIDBRconst FIDBRAconst FIDRconst FIDTRconst FIEBRconst FIEBRAconst FIERconst FIXBRconst FIXBRAconst FIXRconst FIXTRconst FLOGRconst HDRconst HERconst HSCHconst IACconst ICconst ICMconst ICMHconst ICMYconst ICYconst IDTEconst IEDTRconst IEXTRconst IIHFconst IIHHconst IIHLconst IILFconst IILHconst IILLconst IPKconst IPMconst IPTEconst IRBMconst ISKEconst IVSKconst KDBconst KDBRconst KDSAconst KDTRconst KEBconst KEBRconst KIMDconst KLMDconst KMconst KMAconst KMACconst KMCconst KMCTRconst KMFconst KMOconst KXBRconst KXTRconst Lconst LAconst LAAconst LAAGconst LAALconst LAALGconst LAEconst LAEYconst LAMconst LAMYconst LANconst LANGconst LAOconst LAOGconst LARLconst LASPconst LATconst LAXconst LAXGconst LAYconst LBconst LBEARconst LBHconst LBRconst LCBBconst LCDBRconst LCDFRconst LCDRconst LCEBRconst LCERconst LCGFRconst LCGRconst LCRconst LCTLconst LCTLGconst LCXBRconst LCXRconst LDconst LDEconst LDEBconst LDEBRconst LDERconst LDETRconst LDGRconst LDRconst LDXBRconst LDXBRAconst LDXRconst LDXTRconst LDYconst LEconst LEDBRconst LEDBRAconst LEDRconst LEDTRconst LERconst LEXBRconst LEXBRAconst LEXRconst LEYconst LFASconst LFHconst LFHATconst LFPCconst LGconst LGATconst LGBconst LGBRconst LGDRconst LGFconst LGFIconst LGFRconst LGFRLconst LGGconst LGHconst LGHIconst LGHRconst LGHRLconst LGRconst LGRLconst LGSCconst LHconst LHHconst LHIconst LHRconst LHRLconst LHYconst LLCconst LLCHconst LLCRconst LLGCconst LLGCRconst LLGFconst LLGFATconst LLGFRconst LLGFRLconst LLGFSGconst LLGHconst LLGHRconst LLGHRLconst LLGTconst LLGTATconst LLGTRconst LLHconst LLHHconst LLHRconst LLHRLconst LLIHFconst LLIHHconst LLIHLconst LLILFconst LLILHconst LLILLconst LLZRGFconst LMconst LMDconst LMGconst LMHconst LMYconst LNDBRconst LNDFRconst LNDRconst LNEBRconst LNERconst LNGFRconst LNGRconst LNRconst LNXBRconst LNXRconst LOCconst LOCFHconst LOCFHRconst LOCGconst LOCGHIconst LOCGRconst LOCHHIconst LOCHIconst LOCRconst LPDconst LPDBRconst LPDFRconst LPDGconst LPDRconst LPEBRconst LPERconst LPGFRconst LPGRconst LPQconst LPRconst LPSWconst LPSWEconst LPSWEYconst LPTEAconst LPXBRconst LPXRconst LRconst LRAconst LRAGconst LRAYconst LRDRconst LRERconst LRLconst LRVconst LRVGconst LRVGRconst LRVHconst LRVRconst LTconst LTDBRconst LTDRconst LTDTRconst LTEBRconst LTERconst LTGconst LTGFconst LTGFRconst LTGRconst LTRconst LTXBRconst LTXRconst LTXTRconst LURAconst LURAGconst LXDconst LXDBconst LXDBRconst LXDRconst LXDTRconst LXEconst LXEBconst LXEBRconst LXERconst LXRconst LYconst LZDRconst LZERconst LZRFconst LZRGconst LZXRconst Mconst MADconst MADBconst MADBRconst MADRconst MAEconst MAEBconst MAEBRconst MAERconst MAYconst MAYHconst MAYHRconst MAYLconst MAYLRconst MAYRconst MCconst MDconst MDBconst MDBRconst MDEconst MDEBconst MDEBRconst MDERconst MDRconst MDTRconst MDTRAconst MEconst MEEconst MEEBconst MEEBRconst MEERconst MERconst MFYconst MGconst MGHconst MGHIconst MGRKconst MHconst MHIconst MHYconst MLconst MLGconst MLGRconst MLRconst MPconst MRconst MSconst MSCconst MSCHconst MSDconst MSDBconst MSDBRconst MSDRconst MSEconst MSEBconst MSEBRconst MSERconst MSFIconst MSGconst MSGCconst MSGFconst MSGFIconst MSGFRconst MSGRconst MSGRKCconst MSRconst MSRKCconst MSTAconst MSYconst MVCconst MVCDKconst MVCINconst MVCKconst MVCLconst MVCLEconst MVCLUconst MVCOSconst MVCPconst MVCRLconst MVCSconst MVCSKconst MVGHIconst MVHHIconst MVHIconst MVIconst MVIYconst MVNconst MVOconst MVPGconst MVSTconst MVZconst MXBRconst MXDconst MXDBconst MXDBRconst MXDRconst MXRconst MXTRconst MXTRAconst MYconst MYHconst MYHRconst MYLconst MYLRconst MYRconst Nconst NCconst NCGRKconst NCRKconst NGconst NGRconst NGRKconst NIconst NIAIconst NIHFconst NIHHconst NIHLconst NILFconst NILHconst NILLconst NIYconst NNGRKconst NNPAconst NNRKconst NOGRKconst NORKconst NRconst NRKconst NTSTGconst NXGRKconst NXRKconst NYconst Oconst OCconst OCGRKconst OCRKconst OGconst OGRconst OGRKconst OIconst OIHFconst OIHHconst OIHLconst OILFconst OILHconst OILLconst OIYconst ORconst ORKconst OYconst PACKconst PALBconst PCconst PCCconst PCKMOconst PFDconst PFDRLconst PFMFconst PFPOconst PGINconst PGOUTconst PKAconst PKUconst PLOconst POPCNTconst PPAconst PRconst PRNOconst PTconst PTFconst PTFFconst PTIconst PTLBconst QADTRconst QAXTRconst QPACIconst R0 Reg = iotaconst R1const R10const R11const R12const R13const R14const R15const R2const R3const R4const R5const R6const R7const R8const R9const RCHPconst RDPconst RISBGconst RISBGNconst RISBHGconst RISBLGconst RLLconst RLLGconst RNSBGconst ROSBGconst RPconst RRBEconst RRBMconst RRDTRconst RRXTRconst RSCHconst RXSBGconst Sconst SACconst SACFconst SALconst SAM24const SAM31const SAM64const SARconst SCHMconst SCKconst SCKCconst SCKPFconst SDconst SDBconst SDBRconst SDRconst SDTRconst SDTRAconst SEconst SEBconst SEBRconst SELFHRconst SELGRconst SELRconst SERconst SFASRconst SFPCconst SGconst SGFconst SGFRconst SGHconst SGRconst SGRKconst SHconst SHHHRconst SHHLRconst SHYconst SIGPconst SLconst SLAconst SLAGconst SLAKconst SLBconst SLBGconst SLBGRconst SLBRconst SLDAconst SLDLconst SLDTconst SLFIconst SLGconst SLGFconst SLGFIconst SLGFRconst SLGRconst SLGRKconst SLHHHRconst SLHHLRconst SLLconst SLLGconst SLLKconst SLRconst SLRKconst SLXTconst SLYconst SORTLconst SPconst SPKAconst SPMconst SPTconst SPXconst SQDconst SQDBconst SQDBRconst SQDRconst SQEconst SQEBconst SQEBRconst SQERconst SQXBRconst SQXRconst SRconst SRAconst SRAGconst SRAKconst SRDAconst SRDLconst SRDTconst SRKconst SRLconst SRLGconst SRLKconst SRNMconst SRNMBconst SRNMTconst SRPconst SRSTconst SRSTUconst SRXTconst SSAIRconst SSARconst SSCHconst SSKEconst SSMconst STconst STAMconst STAMYconst STAPconst STBEARconst STCconst STCHconst STCKconst STCKCconst STCKEconst STCKFconst STCMconst STCMHconst STCMYconst STCPSconst STCRWconst STCTGconst STCTLconst STCYconst STDconst STDYconst STEconst STEYconst STFHconst STFLconst STFLEconst STFPCconst STGconst STGRLconst STGSCconst STHconst STHHconst STHRLconst STHYconst STIDPconst STMconst STMGconst STMHconst STMYconst STNSMconst STOCconst STOCFHconst STOCGconst STOSMconst STPQconst STPTconst STPXconst STRAGconst STRLconst STRVconst STRVGconst STRVHconst STSCHconst STSIconst STURAconst STURGconst STYconst SUconst SURconst SVCconst SWconst SWRconst SXBRconst SXRconst SXTRconst SXTRAconst SYconst TABORTconst TAMconst TARconst TBconst TBDRconst TBEDRconst TBEGINconst TBEGINCconst TCDBconst TCEBconst TCXBconst TDCDTconst TDCETconst TDCXTconst TDGDTconst TDGETconst TDGXTconst TENDconst THDERconst THDRconst TMconst TMHconst TMHHconst TMHLconst TMLconst TMLHconst TMLLconst TMYconst TPconst TPEIconst TPIconst TPROTconst TRconst TRACEconst TRACGconst TRAP2const TRAP4const TREconst TROOconst TROTconst TRTconst TRTEconst TRTOconst TRTRconst TRTREconst TRTTconst TSconst TSCHconst TypeACRegconst TypeBaseRegconst TypeCRegconst TypeDispSigned20const TypeDispUnsignedconst TypeFPRegconst TypeImmSigned16const TypeImmSigned32const TypeImmSigned8const TypeImmUnsignedconst TypeIndexRegconst TypeLastconst TypeLenconst TypeMaskconst TypeRegconst TypeRegImSigned12const TypeRegImSigned16const TypeRegImSigned24const TypeRegImSigned32const TypeUnknown ArgType = iotaconst TypeVecRegconst UNPKconst UNPKAconst UNPKUconst UPTconst V0 VReg = iotaconst V1const V10const V11const V12const V13const V14const V15const V16const V17const V18const V19const V2const V20const V21const V22const V23const V24const V25const V26const V27const V28const V29const V3const V30const V31const V4const V5const V6const V7const V8const V9const VAconst VACconst VACCconst VACCCconst VAPconst VAVGconst VAVGLconst VBPERMconst VCDGconst VCDLGconst VCEQconst VCFNconst VCFPLconst VCFPSconst VCGDconst VCHconst VCHLconst VCKSMconst VCLFNHconst VCLFNLconst VCLFPconst VCLGDconst VCLZconst VCLZDPconst VCNFconst VCPconst VCRNFconst VCSFPconst VCSPHconst VCTZconst VCVBconst VCVBGconst VCVDconst VCVDGconst VDPconst VECconst VECLconst VERIMconst VERLLconst VERLLVconst VESLconst VESLVconst VESRAconst VESRAVconst VESRLconst VESRLVconst VFAconst VFAEconst VFCEconst VFCHconst VFCHEconst VFDconst VFEEconst VFENEconst VFIconst VFLLconst VFLRconst VFMconst VFMAconst VFMAXconst VFMINconst VFMSconst VFNMAconst VFNMSconst VFPSOconst VFSconst VFSQconst VFTCIconst VGBMconst VGEFconst VGEGconst VGFMconst VGFMAconst VGMconst VISTRconst VLconst VLBBconst VLBRconst VLBRREPconst VLCconst VLEBconst VLEBRFconst VLEBRGconst VLEBRHconst VLEFconst VLEGconst VLEHconst VLEIBconst VLEIFconst VLEIGconst VLEIHconst VLERconst VLGVconst VLIPconst VLLconst VLLEBRZconst VLLEZconst VLMconst VLPconst VLRconst VLREPconst VLRLconst VLRLRconst VLVGconst VLVGPconst VMAEconst VMAHconst VMALconst VMALEconst VMALHconst VMALOconst VMAOconst VMEconst VMHconst VMLconst VMLEconst VMLHconst VMLOconst VMNconst VMNLconst VMOconst VMPconst VMRHconst VMRLconst VMSLconst VMSPconst VMXconst VMXLconst VNconst VNCconst VNNconst VNOconst VNXconst VOconst VOCconst VPDIconst VPERMconst VPKconst VPKLSconst VPKSconst VPKZconst VPKZRconst VPOPCTconst VPSOPconst VREPconst VREPIconst VRPconst VSconst VSBCBIconst VSBIconst VSCBIconst VSCEFconst VSCEGconst VSCHPconst VSCSHPconst VSDPconst VSEGconst VSELconst VSLconst VSLBconst VSLDconst VSLDBconst VSPconst VSRAconst VSRABconst VSRDconst VSRLconst VSRLBconst VSRPconst VSRPRconst VSTconst VSTBRconst VSTEBconst VSTEBRFconst VSTEBRGconst VSTEBRHconst VSTEFconst VSTEGconst VSTEHconst VSTERconst VSTLconst VSTMconst VSTRCconst VSTRLconst VSTRLRconst VSTRSconst VSUMconst VSUMGconst VSUMQconst VTMconst VTPconst VUPHconst VUPKZconst VUPKZHconst VUPKZLconst VUPLconst VUPLHconst VUPLLconst VXconst WFCconst WFKconst Xconst X0 Index = iotaconst X1const X10const X11const X12const X13const X14const X15const X2const X3const X4const X5const X6const X7const X8const X9const XCconst XGconst XGRconst XGRKconst XIconst XIHFconst XILFconst XIYconst XRconst XRKconst XSCHconst XYconst ZAPconst _ Op = iotavar ap_ACReg_12_15 = *ast.UnaryExprvar ap_ACReg_24_27 = *ast.UnaryExprvar ap_ACReg_28_31 = *ast.UnaryExprvar ap_ACReg_8_11 = *ast.UnaryExprvar ap_BaseReg_16_19 = *ast.UnaryExprvar ap_BaseReg_32_35 = *ast.UnaryExprvar ap_CReg_12_15 = *ast.UnaryExprvar ap_CReg_8_11 = *ast.UnaryExprvar ap_DispSigned20_20_39 = *ast.UnaryExprvar ap_DispUnsigned_20_31 = *ast.UnaryExprvar ap_DispUnsigned_36_47 = *ast.UnaryExprvar ap_FPReg_12_15 = *ast.UnaryExprvar ap_FPReg_16_19 = *ast.UnaryExprvar ap_FPReg_24_27 = *ast.UnaryExprvar ap_FPReg_28_31 = *ast.UnaryExprvar ap_FPReg_32_35 = *ast.UnaryExprvar ap_FPReg_8_11 = *ast.UnaryExprvar ap_ImmSigned16_16_31 = *ast.UnaryExprvar ap_ImmSigned16_32_47 = *ast.UnaryExprvar ap_ImmSigned32_16_31 = *ast.UnaryExprvar ap_ImmSigned32_16_47 = *ast.UnaryExprvar ap_ImmSigned8_32_39 = *ast.UnaryExprvar ap_ImmSigned8_8_15 = *ast.UnaryExprvar ap_ImmUnsigned_12_15 = *ast.UnaryExprvar ap_ImmUnsigned_16_23 = *ast.UnaryExprvar ap_ImmUnsigned_16_27 = *ast.UnaryExprvar ap_ImmUnsigned_16_31 = *ast.UnaryExprvar ap_ImmUnsigned_16_47 = *ast.UnaryExprvar ap_ImmUnsigned_24_27 = *ast.UnaryExprvar ap_ImmUnsigned_24_31 = *ast.UnaryExprvar ap_ImmUnsigned_28_31 = *ast.UnaryExprvar ap_ImmUnsigned_28_35 = *ast.UnaryExprvar ap_ImmUnsigned_32_35 = *ast.UnaryExprvar ap_ImmUnsigned_32_39 = *ast.UnaryExprvar ap_ImmUnsigned_32_47 = *ast.UnaryExprvar ap_ImmUnsigned_36_39 = *ast.UnaryExprvar ap_ImmUnsigned_8_15 = *ast.UnaryExprvar ap_IndexReg_12_15 = *ast.UnaryExprvar ap_Len_12_15 = *ast.UnaryExprvar ap_Len_8_11 = *ast.UnaryExprvar ap_Len_8_15 = *ast.UnaryExprvar ap_Mask_12_15 = *ast.UnaryExprvar ap_Mask_16_19 = *ast.UnaryExprvar ap_Mask_20_23 = *ast.UnaryExprvar ap_Mask_24_27 = *ast.UnaryExprvar ap_Mask_28_31 = *ast.UnaryExprvar ap_Mask_32_35 = *ast.UnaryExprvar ap_Mask_36_39 = *ast.UnaryExprvar ap_Mask_8_11 = *ast.UnaryExprvar ap_RegImSigned12_12_23 = *ast.UnaryExprvar ap_RegImSigned16_16_31 = *ast.UnaryExprvar ap_RegImSigned16_32_47 = *ast.UnaryExprvar ap_RegImSigned24_24_47 = *ast.UnaryExprvar ap_RegImSigned32_16_47 = *ast.UnaryExprvar ap_Reg_12_15 = *ast.UnaryExprvar ap_Reg_16_19 = *ast.UnaryExprvar ap_Reg_24_27 = *ast.UnaryExprvar ap_Reg_28_31 = *ast.UnaryExprvar ap_Reg_8_11 = *ast.UnaryExprvar ap_VecReg_12_15 = *ast.UnaryExprvar ap_VecReg_16_19 = *ast.UnaryExprvar ap_VecReg_32_35 = *ast.UnaryExprvar ap_VecReg_8_11 = *ast.UnaryExprvar decoderCover []boolErrors
var errShort = *ast.CallExprvar errUnknown = *ast.CallExprvar instFormats = [...]instFormat{...}var opstr = [...]string{...}var vectorCS = map[int]string{...}var vectorSize = map[int]string{...}type ArgType int8An Args holds the instruction arguments. If an instruction has fewer than 6 arguments, the final elements in the array are nil.
type Args [8]ArgBase represents an 4-bit Base Register field
type Base uint8Disp12 represents an 12-bit Unsigned Displacement
type Disp12 uint16Disp20 represents an 20-bit Unsigned Displacement
type Disp20 uint32Imm represents an immediate number.
type Imm uint32Index represents an 4-bit Index Register field
type Index uint8Len represents an 8-bit type holds 4/8-bit Len argument
type Len uint8Mask represents an 4-bit mask value
type Mask uint8An Op is an instruction operation.
type Op uint16A Reg is a single register. The zero value means R0, not the absence of a register. It also includes special registers.
type Reg uint16RegIm12 represents an 12-bit Register immediate number.
type RegIm12 uint16RegIm16 represents an 16-bit Register immediate number.
type RegIm16 uint16RegIm24 represents an 24-bit Register immediate number.
type RegIm24 uint32RegIm32 represents an 32-bit Register immediate number.
type RegIm32 uint32Sign16 represents an 16-bit signed immediate number.
type Sign16 int16Sign32 represents an 32-bit signed immediate number.
type Sign32 int32Sign8 represents an 8-bit signed immediate number.
type Sign8 int8type VReg uint8An Arg is a single instruction argument. One of these types: Reg, Base, Index, Disp20, Disp12, Len, Mask, Sign8, Sign16, Sign32, RegIm12, RegIm16, RegIm24, RegIm32.
type Arg interface {
IsArg()
String(pc uint64) string
}A BitField is a bit-field in a 64-bit double word. Bits are counted from 0 from the MSB to 63 as the LSB.
type BitField struct {
Offs uint8
Bits uint8
}type Inst struct {
Op Op
Enc uint64
Len int
Args Args
}argField indicate how to decode an argument to an instruction. First parse the value from the BitFields, shift it left by Shift bits to get the actual numerical value.
type argField struct {
Type ArgType
flags uint16
BitField
}instFormat is a decoding rule for one specific instruction form. An instruction ins matches the rule if ins&Mask == Value. DontCare bits are mainly used for finding the same instruction name differing with the number of argument fields. The Args are stored in the same order as the instruction manual.
type instFormat struct {
Op Op
Mask uint64
Value uint64
DontCare uint64
Args [8]*argField
}Typ1 - Instructions having different base and extended mnemonic strings. These instructions have single M-field value and single offset.
type typ1ExtndMnics struct {
BaseOpStr string
Value uint8
Offset uint8
ExtnOpStr string
}Typ2 - Instructions having couple of extra strings added to the base mnemonic string, depending on the condition code evaluation. These instructions have single M-field value and single offset.
type typ2ExtndMnics struct {
Value uint8
Offset uint8
ExtnOpStr string
}Typ3 - Instructions having couple of extra strings added to the base mnemonic string, depending on the condition code evaluation. These instructions have two M-field values and two offsets.
type typ3ExtndMnics struct {
Value1 uint8
Value2 uint8
Offset1 uint8
Offset2 uint8
ExtnOpStr string
}Typ4 - Instructions having different base and extended mnemonic strings. These instructions have two M-field values and two offsets.
type typ4ExtndMnics struct {
BaseOpStr string
Value1 uint8
Value2 uint8
Offset1 uint8
Offset2 uint8
ExtnOpStr string
}Typ5 - Instructions having different base and extended mnemonic strings. These instructions have three M-field values and three offsets.
type typ5ExtndMnics struct {
BaseOpStr string
Value1 uint8
Value2 uint8
Value3 uint8
Offset1 uint8
Offset2 uint8
Offset3 uint8
ExtnOpStr string
}Decode decodes the leading bytes in src as a single instruction using byte order ord.
func Decode(src []byte) (inst Inst, err error)This is the function that is called to print the disassembled instruction in the GNU (AT&T) syntax form.
func GNUSyntax(inst Inst, pc uint64) stringfunc (t ArgType) GoString() stringGoSyntax returns the Go assembler syntax for the instruction. The syntax was originally defined by Plan 9. The inst relates to single instruction. The pc is the program counter of the instruction, used for expanding PC-relative addresses into absolute ones. The symname function queries the symbol table for the program being disassembled. Given a target address it returns the name and base address of the symbol containing the target, if any; otherwise it returns "", 0.
func GoSyntax(inst Inst, pc uint64, symname func(uint64) (string, uint64)) string"func Handleextndmnemonic" - This is the function where the extended mnemonic logic is implemented. This function defines various structures to keep a list of base instructions and their extended mnemonic strings. These structure will also have M-field values and offset values defined, based on their type. HandleExtndMnemonic takes "inst" structure as the input variable. Inst structure will have all the details related to an instruction. Based on the opcode base string, a switch-case statement is executed. In that, based on the M-field value and the offset value of that particular M-field, extended mnemonic string is either searched or constructed by adding couple of extra strings to the base opcode string from one of the structure defined below.
func HandleExtndMnemonic(inst *Inst) stringfunc (Mask) IsArg()func (Len) IsArg()func (VReg) IsArg()func (Sign32) IsArg()func (Sign16) IsArg()func (Sign8) IsArg()func (Imm) IsArg()func (Base) IsArg()func (Reg) IsArg()func (Index) IsArg()func (RegIm32) IsArg()func (Disp20) IsArg()func (RegIm24) IsArg()func (Disp12) IsArg()func (RegIm16) IsArg()func (RegIm12) IsArg()Parse extracts the bitfield b from i, and return it as an unsigned integer. Parse will panic if b is invalid.
func (b BitField) Parse(i uint64) uint64Parse parses the Arg out from the given binary instruction i.
func (a argField) Parse(i uint64) ArgParseSigned extracts the bitfield b from i, and return it as a signed integer. ParseSigned will panic if b is invalid.
func (b BitField) ParseSigned(i uint64) int64func (i Sign16) String(pc uint64) stringfunc (r RegIm16) String(pc uint64) stringfunc (r Index) String(pc uint64) stringfunc (r RegIm32) String(pc uint64) stringfunc (r Base) String(pc uint64) stringfunc (r Disp20) String(pc uint64) stringfunc (r Disp12) String(pc uint64) stringfunc (r VReg) String(pc uint64) stringfunc (o Op) String() stringfunc (i Imm) String(pc uint64) stringfunc (i Inst) String(pc uint64) stringfunc (i Sign8) String(pc uint64) stringfunc (r RegIm12) String(pc uint64) stringfunc (t ArgType) String() stringfunc (r RegIm24) String(pc uint64) stringfunc (b BitField) String() stringfunc (r Reg) String(pc uint64) stringfunc (i Mask) String(pc uint64) stringfunc (i Sign32) String(pc uint64) stringfunc (i Len) String(pc uint64) stringThis function returns corresponding plan9 mnemonic for the native bitwise mnemonic.
func bitwise_op(op Op) stringThis function returns corresponding extended mnemonic for the given brach on condition mnemonic.
func branchOnConditionOp(mask int, opconst Op) (op string, check bool)This function returns corresponding extended mnemonic for the given branch on relative mnemonic.
func branch_relative_op(mask int, opconst Op) (op string, check bool)This function parses memory operand of type D(B)
func mem_operand(args []string) stringThis function parses memory operand of type D(L,B)
func mem_operandl(args []string) (string, string)This function parses memory operand of type D(V,B)
func mem_operandv(args []string) stringThis function parses memory operand of type D(X,B)
func mem_operandx(args []string) stringplan9Arg formats arg (which is the argIndex's arg in inst) according to Plan 9 rules. NOTE: because Plan9Syntax is the only caller of this func, and it receives a copy of inst, it's ok to modify inst.Args here.
func plan9Arg(inst *Inst, pc uint64, symname func(uint64) (string, uint64), arg Arg) stringremoveArg removes the arg in inst.Args[index].
func removeArg(inst *Inst, index int8)It checks whether to reverse all the args of given mnemonic or not
func reverseAllOperands(op Op) boolIt checks any 2 args of given instructions to swap or not
func reverseOperandOrder(op Op) boolGenerated with Arrow