asminfo.cpp

00001 /***************************************************************************
00002  *   Copyright (C) 2003,2005 by David Saxton                               *
00003  *   david@bluehaze.org                                                    *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  ***************************************************************************/
00010 
00011 #include "asminfo.h"
00012 
00013 #include <kdebug.h>
00014 
00015 AsmInfo::AsmInfo()
00016 {
00017 }
00018 
00019 
00020 AsmInfo::~AsmInfo()
00021 {
00022 }
00023 
00024 
00025 void AsmInfo::addInstruction( const QString & operand, const QString & description, const QString & opcode )
00026 {
00027         Instruction instruction;
00028         instruction.operand = operand;
00029         instruction.description = description;
00030         instruction.opcode = opcode;
00031         m_instructionList.append( instruction );
00032         m_operandList.append( operand );
00033 }
00034 
00035 
00036 QString AsmInfo::setToString( Set set )
00037 {
00038         switch (set)
00039         {
00040                 case AsmInfo::PIC12:
00041                         return "PIC12";
00042                         
00043                 case AsmInfo::PIC14:
00044                         return "PIC14";
00045                         
00046                 case AsmInfo::PIC16:
00047                         return "PIC16";
00048         }
00049         
00050         kdWarning() << k_funcinfo << "Unrecognized set="<<set<<endl;
00051         return QString::null;
00052 }
00053 
00054 
00055 AsmInfo::Set AsmInfo::stringToSet( const QString & set )
00056 {
00057         if ( set == "PIC12" )
00058                 return PIC12;
00059         
00060         if ( set == "PIC14" )
00061                 return PIC14;
00062         
00063         if ( set == "PIC16" )
00064                 return PIC16;
00065         
00066 //      kdWarning() << k_funcinfo << "Unrecognized set="<<set<<endl;
00067         return PIC14;
00068 }

Generated on Tue May 8 17:05:27 2007 for KTechLab by  doxygen 1.5.1