/*============================================================================== * FUNCTION: RTLInstDict::readSSLFile * OVERVIEW: Read and parse the SSL file, and initialise the expanded instruction dictionary (this object). * This also reads and sets up the register map and flag functions. * PARAMETERS: SSLFileName - the name of the file containing the SSL specification. * RETURNS: the file was successfully read *============================================================================*/ bool RTLInstDict::readSSLFile(const std::string &SSLFileName) { // emptying the rtl dictionary idict.erase(idict.begin(), idict.end()); // Clear all state reset(); // Attempt to Parse the SSL file #ifdef DEBUG_SSLPARSER SSLParser theParser(SSLFileName, true); #else SSLParser theParser(SSLFileName, false); #endif if (theParser.theScanner == NULL) return false; addRegister("%CTI", -1, 1, false); addRegister("%NEXT", -1, 32, false); theParser.yyparse(*this); fixupParams(); if (Boomerang::get()->debugDecoder) { std::cout << "\n=======Expanded RTL template dictionary=======\n"; print(); std::cout << "\n==============================================\n\n"; } return true; }
int main(){ base *cab=NULL; int menu; load(&cab,"atributes.dat"); load(&cab,"values.dat"); load(&cab,"key.dat"); do{ system("clear"); printf("\npresione\n\t1 agragar registro\n\t2 anadir atributo\n\t3 eliminar atributo\n\t4 eliminar registro\n\t5 modificar registro\n\t6 mostrar\n\t7 salir\n"); scanf("%d",&menu); switch(menu){ case 1:addRegister(&cab,k);break; case 2:addAtribute(&cab);break; case 3:printTable(&cab);removeAtribute(&cab);break; case 4:printTable(&cab);removeRegister(&cab,k,1);break; case 5:printTable(&cab);removeRegister(&cab,k,0);break; case 6:printTable(&cab);break; case 7:printf("\n\n\t\tasta pronto :D");break; } getchar();getchar(); }while(menu!=7); saveChanges(&cab); printf("\n");return 0; }
void RegisterSet::addDefaultRegisters() { addRegister("PC", 0); addRegister("SP", 0); addRegister("R2", 0); addRegister("R3", 0); addRegister("R4", 0); addRegister("R5", 0); addRegister("R6", 0); addRegister("R7", 0); addRegister("R8", 0); addRegister("R9", 0); addRegister("R10", 0); addRegister("R11", 0); addRegister("R12", 0); addRegister("R13", 0); addRegister("R14", 0); addRegister("R15", 0); }
//Creates all 32 representations of processor registers void createRegisters() { addRegister("$zero", 0); addRegister("$at", 1); addRegister("$v0", 2); addRegister("$v1", 3); addRegister("$a0", 4); addRegister("$a1", 5); addRegister("$a2", 6); addRegister("$a3", 7); addRegister("$t0", 8); addRegister("$t1", 9); addRegister("$t2", 10); addRegister("$t3", 11); addRegister("$t4", 12); addRegister("$t5", 13); addRegister("$t6", 14); addRegister("$t7", 15); addRegister("$s0", 16); addRegister("$s1", 17); addRegister("$s2", 18); addRegister("$s3", 19); addRegister("$s4", 20); addRegister("$s5", 21); addRegister("$s6", 22); addRegister("$s7", 23); addRegister("$t8", 24); addRegister("$t9", 25); addRegister("$k0", 26); addRegister("$k1", 27); addRegister("$gp", 28); addRegister("$sp", 29); addRegister("$fp", 30); addRegister("$ra", 31); }