92 assert(theCodeSection != NULL);
102 theCodeSection->
element(currIndex));
109 std::vector<MoveElement*> moves;
112 if (currElement->
isMove()) {
115 moves.push_back(move);
127 immediates[immKey] = imm;
166 theCodeSection->
element(currIndex));
168 }
while (!currElement->
begin());
174 assert(resources != NULL);
176 std::vector<DisassemblyInstructionSlot*> organizedInstr;
182 if (resource->
type() == ResourceElement::MRT_BUS &&
183 resource->
id() != ResourceElement::UNIVERSAL_BUS) {
185 organizedInstr.push_back(NULL);
189 for (
unsigned int i = 0; i < moves.size(); i++) {
229 if (currMove->
bus() > 0) {
230 organizedInstr[currMove->
bus() - 1] = newMove;
232 organizedInstr.push_back(newMove);
246 for (Word i = 0; i < organizedInstr.size(); i++) {
248 if (organizedInstr[i] != NULL) {
249 newInstruction->
addMove(organizedInstr[i]);
253 newInstruction->
addMove(newNOP);
257 return newInstruction;
270 assert(theCodeSection != NULL);
311 assert(theCodeSection != NULL);
313 for (Word i = 0; i < theCodeSection->
elementCount(); i++) {
341 assert(resources != NULL);
348 case MoveElement::MF_RF: {
349 if (unit & ResourceElement::UNIVERSAL_RF_MASK) {
351 case ResourceElement::INT_RF:
353 case ResourceElement::BOOL_RF:
357 case ResourceElement::FP_RF:
375 case MoveElement::MF_IMM: {
381 MapTools::valueForKey<ImmediateElement*>(immediateMap, immKey);
394 resources->
findResource(ResourceElement::MRT_IMM, unit);
403 case MoveElement::MF_UNIT: {
405 if (unit == ResourceElement::UNIVERSAL_FU) {
410 ResourceElement::MRT_OP, index)) {
414 ResourceElement::MRT_OP, index);
416 std::string opString =
419 std::string::size_type dotIndex = opString.rfind(
'.');
420 std::string opName = opString.substr(0,dotIndex);
425 std::string opIndexStr = opString.substr(
426 dotIndex, opString.length() - dotIndex);
433 ResourceElement::MRT_SR, index)) {
437 ResourceElement::MRT_SR, index);
441 if (regName == ResourceElement::RETURN_ADDRESS_NAME) {
450 "Can't find universal operand or special register "
460 resources->
findResource(ResourceElement::MRT_UNIT, unit);
466 ResourceElement::MRT_PORT, index)) {
469 resources->
findResource(ResourceElement::MRT_PORT, index);
471 std::string fuPortName =
477 ResourceElement::MRT_OP, index)) {
480 resources->
findResource(ResourceElement::MRT_OP, index);
482 std::string operandString =
485 std::string::size_type dotPos = operandString.rfind(
".");
487 assert(dotPos != std::string::npos);
489 std::string opName = operandString.substr(0, dotPos);
491 std::string operandIndexString =
492 operandString.substr(
493 dotPos+1, operandString.length() - dotPos - 1);
501 ResourceElement::MRT_SR, index)) {
504 resources->
findResource(ResourceElement::MRT_SR, index);
513 "Can't find real port, operation or special register by "