diff options
author | Alex AUVOLAT <alex.auvolat@ens.fr> | 2013-11-08 21:49:39 +0100 |
---|---|---|
committer | Alex AUVOLAT <alex.auvolat@ens.fr> | 2013-11-08 21:49:39 +0100 |
commit | 435042774cd03687297a8100e807c70dd7b1b3e4 (patch) | |
tree | 4c08ca4d16515e73cb69b6e6e5cac23dbad885d9 /csim | |
parent | 05749abf8efdcaae6afd9f3dd087df475e5e93ad (diff) | |
download | SystDigit-Projet-435042774cd03687297a8100e807c70dd7b1b3e4.tar.gz SystDigit-Projet-435042774cd03687297a8100e807c70dd7b1b3e4.zip |
Simulator fixed.
Diffstat (limited to 'csim')
-rw-r--r-- | csim/sim.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -11,7 +11,7 @@ #include "sim.h" -#define DEBUG 1 +#define DEBUG 0 // Util @@ -39,7 +39,7 @@ t_machine *init_machine (t_program *p) { t_value a = 1; char *o = p->vars[i].name + 1; while (*o) { - m->var_values[i] |= a; + if (*o == '1') m->var_values[i] |= a; a >>= 1; o++; } @@ -204,7 +204,7 @@ void machine_step(t_machine *m) { // SAVE REGISTERS && MEMORY for (i = 0; i < p->n_regs; i++) { m->reg_data[i] = m->var_values[p->regs[i].source]; - if (DEBUG) printf("reg %s <- %s : %lx\n", + if (DEBUG) fprintf(stderr, "reg %s <- %s : %lx\n", p->vars[p->regs[i].dest].name, p->vars[p->regs[i].source].name, m->reg_data[i]); |