// Copyright (C) 1999-2003 Core Technologies. // // This file is part of tpasm. // // tpasm is free software; you can redistribute it and/or modify // it under the terms of the tpasm LICENSE AGREEMENT. // // tpasm is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // tpasm LICENSE AGREEMENT for more details. // // You should have received a copy of the tpasm LICENSE AGREEMENT // along with tpasm; see the file "LICENSE.TXT". typedef bool InitFamilyFunction(); typedef void UnInitFamilyFunction(); typedef bool SelectProcessorFunction(class PROCESSOR *theProcessor); typedef void DeselectProcessorFunction(class PROCESSOR *theProcessor); typedef PSEUDO_OPCODE *MatchPseudoOpcodeFunction(char *theOpcode); typedef bool HandlePseudoOpcodeFunction(PSEUDO_OPCODE *theOpcode,char *theLine,int *lineIndex,bool haveLabel,bool isLocal,char *lineLabel,LISTING_RECORD *listingRecord); typedef void *MatchOpcodeFunction(char *theOpcode); typedef bool HandleOpcodeFunction(void *theOpcode,char *theLine,int *lineIndex,LISTING_RECORD *listingRecord); class PROCESSOR_FAMILY { public: const char *name; InitFamilyFunction *initFamilyFunction; UnInitFamilyFunction *uninitFamilyFunction; SelectProcessorFunction *selectProcessorFunction; DeselectProcessorFunction *deselectProcessorFunction; MatchPseudoOpcodeFunction *matchPseudoFunction; HandlePseudoOpcodeFunction *handlePseudoFunction; MatchOpcodeFunction *matchFunction; HandleOpcodeFunction *handleFunction; class PROCESSOR *firstProcessor, // keeps list of processors in this family *lastProcessor; PROCESSOR_FAMILY *previousFamily, // used to link the list of families together *nextFamily; PROCESSOR_FAMILY(const char *theName,InitFamilyFunction *theInitFunction,UnInitFamilyFunction *theUnInitFunction,SelectProcessorFunction *theSelectFunction,DeselectProcessorFunction *theDeselectFunction,MatchPseudoOpcodeFunction *thePseudoMatchFunction,HandlePseudoOpcodeFunction *theHandlePseudoFunction,MatchOpcodeFunction *theMatchFunction,HandleOpcodeFunction *theHandleFunction); ~PROCESSOR_FAMILY(); }; class PROCESSOR { public: PROCESSOR_FAMILY *family; SYMTABLENODE *theSymbol; // set up when processor is added to symbol table const char *name; const void *processorData; PROCESSOR *previousProcessor, // links processors to their families *nextProcessor; PROCESSOR(PROCESSOR_FAMILY *theFamily,const char *theName,const void *theData); ~PROCESSOR(); }; PSEUDO_OPCODE *MatchProcessorPseudoOpcode(char *theOpcodeString); bool HandleProcessorPseudoOpcode(PSEUDO_OPCODE *theOpcode,char *theLine,int *lineIndex,bool haveLabel,bool isLocal,char *lineLabel,LISTING_RECORD *listingRecord); void *MatchProcessorOpcode(char *theOpcodeString); bool HandleProcessorOpcode(void *theOpcode,char *theLine,int *lineIndex,LISTING_RECORD *listingRecord); bool SelectProcessor(char *processorName,bool *found); void UnInitProcessors(); bool InitProcessors(); void DumpProcessorInformation(FILE *theFile);