123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- #include "elea_tipi.h"
- #include "governo.h"
- #include "memoria.h"
- #include "ricerca.h"
- #include "algebra.h"
- #include "accumulatore.h"
- #include "telescrivente.h"
- struct registri_sistema R;
- int op_salto(istruzione *i)
- {
- return 0;
- }
- static operazione *OP[64] = {
- /* 0 = OP_SALTO */ op_salto,
- /* 1 = OP_MEM */ op_mem,
- /* 2 = NO OP! */ (operazione *)0,
- /* 3 = OP_RIa */ op_ria,
- /* 4 = OP_-CT */ op_meno_ct,
- /* 5 = OP_+CT */ op_piu_ct,
- /* 6 = OP_CCT */ op_cct,
- /* 7 = OP_+MM */ op_piu_mm,
- /* 8 = NO OP! */ (operazione *)0,
- /* 9 = NO OP! */ (operazione *)0,
- /* 10 = OP_CMM */ op_cmm,
- /* 11 = OP_RIi */ op_rii,
- /* 12 = OP_CT */ op_ct,
- /* 13 = NO OP! */ (operazione *)0,
- /* 14 = OP_PUM */ op_pum,
- /* 15 = OP_-MM */ op_meno_mm,
- /* 16 = OP_MS */ op_ms,
- /* 17 = OP_DA */ op_da,
- /* 18 = OP_FAM */ op_fam,
- /* 19 = OP_AoM */ op_aom,
- /* 20 = NO OP! */ (operazione *)0,
- /* 21 = OP_+X */ op_piu_x,
- /* 22 = NO OP! */ (operazione *)0,
- /* 23 = OP_+MA */ op_piu_ma,
- /* 24 = OP_CMA */ op_cma,
- /* 25 = OP_MA */ op_ma,
- /* 26 = OP_CM */ op_cm,
- /* 27 = OP_AM */ op_am,
- /* 28 = NO OP! */ (operazione *)0,
- /* 29 = OP_-X */ op_meno_x,
- /* 30 = OP_+AM */ op_piu_am,
- /* 31 = OP_-MA */ op_meno_ma,
- /* 32 = NO OP! */ (operazione *)0,
- /* 33 = NO OP! */ (operazione *)0,
- /* 34 = OP_FTM */ op_ftm,
- /* 35 = OP_ToM */ op_tom,
- /* 36 = OP_+LD */ op_piu_ld,
- /* 37 = OP_XLD */ op_xld,
- /* 38 = NO OP! */ (operazione *)0,
- /* 39 = OP_+MT */ op_piu_mt,
- /* 40 = OP_CMT */ op_cmt,
- /* 41 = OP_MT */ op_mt,
- /* 42 = NO OP! */ (operazione *)0,
- /* 43 = OP_TM */ op_tm,
- /* 44 = NO OP! */ (operazione *)0,
- /* 45 = OP_XLN */ op_xln,
- /* 46 = OP_+TM */ op_piu_tm,
- /* 47 = OP_-MT */ op_meno_mt,
- /* 48 = NO OP! */ (operazione *)0,
- /* 49 = NO OP! */ (operazione *)0,
- /* 50 = NO OP! */ (operazione *)0,
- /* 51 = NO OP! */ (operazione *)0,
- /* 52 = NO OP! */ (operazione *)0,
- /* 53 = NO OP! */ (operazione *)0,
- /* 54 = NO OP! */ (operazione *)0,
- /* 55 = NO OP! */ (operazione *)0,
- /* 56 = NO OP! */ (operazione *)0,
- /* 57 = NO OP! */ (operazione *)0,
- /* 59 = NO OP! */ (operazione *)0,
- /* 60 = NO OP! */ (operazione *)0,
- /* 61 = NO OP! */ (operazione *)0,
- /* 62 = NO OP! */ (operazione *)0,
- /* 63 = NO OP! */ (operazione *)0,
- /* 64 = NO OP! */ (operazione *)0
- };
- static booleano CanaleInternoOcc = NO;
- static booleano CanaleEsternoOcc = NO;
- static uint32_t N_Cicli = 0;
- booleano canale_interno_occupato(void)
- {
- return CanaleInternoOcc;
- }
- booleano canale_esterno_occupato(void)
- {
- return CanaleEsternoOcc;
- }
- void esegui_primo_programma(void)
- {
- istruzione *i = R.I;
- R.I += sizeof(istruzione);
- carattere F = *((carattere *)i);
- if (OP[F] != (operazione *)0) {
- (*OP[F])(i);
- } else {
- /* TODO: fault */
- }
- }
|