int sti11(t_exec *process, T_TEAM lampions, void *mem) { DESCRIPT d; int n; int reg; int rec1; int rec2; n = 0; while ((lampions[n])->place != process->proprio) n++; my_printf("Champion %s: %s (", (lampions[n])->name, op_tab[STI].mnemonique); d = *(DESCRIPT*)(mem + PC); if (check(d, STI)) if (my_printf(WRONG_ARGS")\n")) return ((op_tab[STI]).nbr_cycles); PC = (PC + 1) % MEM_SIZE; reg = recup(mem, ((d >> (3 * 2)) & 3), process, 3); my_printf(" in i@pc+("); rec1 = recup(mem, ((d >> (2 * 2)) & 3), process, 3); my_printf(" + "); rec2 = recup(mem, ((d >> (1 * 2)) & 3), process, 3); my_printf("))\n"); if ((PCI + (rec1 + rec2) % IDX_MOD) < 0) (*(int*)(mem + MEM_SIZE + (PCI + (rec1 + rec2) % IDX_MOD))) = reaffect(reg); else (*(int*)(mem + PCI + (rec1 + rec2) % IDX_MOD)) = reaffect(reg); return ((op_tab[STI]).nbr_cycles); }
int ldi10(t_exec *process, T_TEAM lampions, void *mem) { int rec; unsigned char reg; DESCRIPT d; int n; n = 0; while ((lampions[n])->place != process->proprio) n++; my_printf("Champion %s: %s (i@pc+(", (lampions[n])->name, op_tab[LDI].mnemonique); d = *(DESCRIPT*)(mem + PC); if (check(d, LDI)) if (my_printf(WRONG_ARGS")\n")) return ((op_tab[LDI]).nbr_cycles); PC = (PC + 1) % MEM_SIZE; rec = recup(mem, ((d >> (3 * 2)) & 3), process, 3); my_printf(" + "); rec += recup(mem, ((d >> (2 * 2)) & 3), process, 3); rec = PCI + rec % IDX_MOD; if (rec < 0) rec += MEM_SIZE; my_printf(")=%d in ", rec = reaffect(*(unsigned int*)(mem + (rec) % MEM_SIZE))); reg = value(mem, ((d >> (1 * 2)) & 3), process); CARRY = !((process->registre)[reg % IDX_MOD] = rec); my_printf(") carry=%d\n", CARRY); return ((op_tab[LD]).nbr_cycles); }
int pin(void) { int i , j , k ; char numpin[9] , net[9] ; char Line[1024]; for ( ;; ) { /* recherche du debut de la description des pins d'un composant */ if ( fgets(Line,80,source) == 0 ) return(-1) ; /* suppression des blancs en d‚but de ligne */ i = 0 ; while (Line[i] == ' ') i++ ; /* elimination des lignes vides : */ if (Line[i] < ' ') continue ; if (strncmp(&Line[i],"{CN",3) != 0) continue ; /* debut description trouv‚ */ for ( ;; ) { if ( fgets(Line,80,source) == 0 ) return(-1) ; /* suppression des blancs en d‚but de ligne */ i = 0 ; while (Line[i] == ' ') i++ ; /* elimination des lignes vides : */ if (Line[i] < ' ') continue ; /* fin de description ? */ if (Line[i] == '}' ) return(0) ; memset( net, 0, sizeof(net) ) ; memset( numpin, 0, sizeof(numpin) ) ; /* lecture name pin , 4 lettres */ for (j = 0 ; j < 4 ; j++ , i++) { if ( Line[i] == ' ' ) break ; numpin[j] = Line[i] ; } j = 0 ; /* recherche affectation forc‚e de net */ if ( reaffect(&numpin[j],net) != 0) { // fprintf(dest,"%s:%s\n",&numpin[j],net) ; continue ; } /* recherche netname */ while(Line[i] == ' ') i++ ; /* recherche debut reference */ /* debut netname trouv‚ */ for ( k = 0 ; k < 8 ; i++ , k++ ) { if ( Line[i] <= ' ' ) break ; net[k] = Line[i] ; } /* les pins non connect‚es sont ‚limin‚es :*/ if (net[0] == '?' ) continue ; // fprintf(dest,"%s:%s\n",&numpin[j],net) ; } } }