#include "elea_tipi.h" #include "governo.h" #include "memoria.h" static carattere Accumulatore[100]; static segno REG_SEGNO_A = 0; int op_da(istruzione *i) { int r; int da; r = estrai_cifra(i->da.I[0]); if (r < 0) return -1; da = r; r = estrai_cifra(i->da.I[1]); if (r < 0) return -1; da += 10 * r; R.P = da; return 0; } int op_fam(istruzione *i) { return 0; } int op_aom(istruzione *i) { int pos; indirizzo mem; int lun; int j; mem = estrai_indirizzo(i->gen.I); if (mem == (uint32_t)(-1)) return -1; lun = estrai_lunghezza(i->gen.L); for (j = 0; j < lun; j++) { pos = (R.P + lun - (j + 1)); mem_scrivi_carattere(mem + j, Accumulatore[pos] & 0x7F); /* Azzeramento */ Accumulatore[pos] = 0x80; } return 0; } int op_piu_ma(istruzione *i) { return 0; } int op_cma(istruzione *i) { return 0; } /* Da memoria a accumulatore */ int op_ma(istruzione *i) { int j; int pos; int lun; int r; indirizzo mem; mem = estrai_indirizzo(i->gen.I); if (mem == (uint32_t)(-1)) return -1; lun = estrai_lunghezza(i->gen.L); if (lun < 0) return -1; for (j = 0; j < lun; j++) { carattere c; pos = (lun - (j + 1)); c = mem_leggi_carattere(mem); Accumulatore[R.P + j] = c & 0x7f; Accumulatore[R.P + j] &= ~0x80; } /* accende gA nell'ultimo carattere */ Accumulatore[R.P + lun - j] |= 0x80; return 0; } int op_am(istruzione *i) { return 0; } int op_piu_am(istruzione *i) { return 0; } int op_meno_ma(istruzione *i) { return 0; }