Beispiel #1
0
static void RemoveRegFromLRBlock(regs *reg)
{
  if(elementsInSet(reg->reglives.usedpCodes) == 2) {
    pCode *pc1;

      /* only continue if there are just 2 uses of the register,
       * in in the local *entry* block and one in the local *exit* block */
        
      /* search for entry block */
      pc1 = indexSet(reg->reglives.usedpCodes, 1);

      if(insideLRBlock( pc1 )) {
        fprintf(stderr, "usedpCodes[0] inside LR block\n");
        deleteSetItem(&pc1->pb->tregisters, PCOR(PCI(pc1)->pcop)->r);
        Remove1pcode(pc1, reg);
      }

      pc1 = indexSet(reg->reglives.usedpCodes, 0);
      if(insideLRBlock( pc1 )) {
        fprintf(stderr, "usedpCodes[1] inside LR block\n");
        deleteSetItem(&pc1->pb->tregisters, PCOR(PCI(pc1)->pcop)->r);
        Remove1pcode(pc1, reg);
      }
        
      /* remove r0x00 */
      reg->isFree = 1;
      reg->wasUsed = 0;
  }
}
void orangeLedOn(void) {
   PCOR(LED_ORANGE_PORT) = (1<<LED_ORANGE_NUM);
}
void redLedOn(void) {
   PCOR(LED_RED_PORT) = (1<<LED_RED_NUM);
}
void blueLedOn(void) {
   PCOR(LED_BLUE_PORT) = (1<<LED_BLUE_NUM);
}
void greenLedOn(void) {
   PCOR(LED_GREEN_PORT) = (1<<LED_GREEN_NUM);
}