Deux versions Compilateur et Interpreteur terminé, TAF : finir la version non sécurisée du processeur, tester

This commit is contained in:
Paul Faure 2021-06-18 14:15:56 +02:00
parent 00d38d91fd
commit be9c40eece
6 changed files with 33 additions and 23 deletions

@ -1 +1 @@
Subproject commit 7718e9c861a78b48272d5d8a759a922594e25a16
Subproject commit b501ce3389db4142df557e6bca95434e591741f6

@ -1 +1 @@
Subproject commit 9c38352e612609ceb06ea82c10c31790e89feae8
Subproject commit c9c60001de4ae1f8e379dbc210b7a70a6b2dd934

View file

@ -53,7 +53,7 @@ ifeq ($(QUOI),compile)
@echo "Compilation terminée"
else ifeq ($(QUOI),interprete)
@echo "Interpretation"
cat $(SOURCE).memasm | Interpreteur/rondoudou_interpreter
Interpreteur/rondoudou_interpreter $(SOURCE).memasm
@echo "Interpretation terminée"
else ifeq ($(QUOI),cross_assemble)
@echo "CrossAssemblage"
@ -72,7 +72,7 @@ else ifeq ($(QUOI),all)
@mv output.txt $(SOURCE).memasm
@echo "Compilation terminée"
@echo "Interpretation"
cat $(SOURCE).memasm | Interpreteur/rondoudou_interpreter
Interpreteur/rondoudou_interpreter $(SOURCE).memasm
@echo "Interpretation terminée"
@echo "CrossAssemblage"
cat $(SOURCE).memasm | CrossAssembleur/rondoudou_cross_assembleur

26
juste_prix.c Normal file
View file

@ -0,0 +1,26 @@
int chose_number() {
int i = get();
return i;
}
int compare(int nb, int prop) {
int rt;
if (prop > nb) {
rt = -1;
} else if (prop < nb) {
rt = 1;
} else {
rt = 0;
}
return rt;
}
int main() {
int valeur = chose_number();
int prop = valeur + 50;
while (!(prop == valeur)) {
prop = get();
printf(compare(valeur, prop));
}
}

19
max.c
View file

@ -1,14 +1,5 @@
int get_value() {
int i = 0;
while (i<5) {
printf(0);
stop(1);
printf(255);
stop(1);
i = i+1;
}
stop(15);
i = get();
int i = get();
return i;
}
@ -32,13 +23,9 @@ int main() {
i = i+1;
}
i = 0;
while (i<5) {
printf(170);
stop(1);
printf(85);
stop(1);
while (i<10) {
printf(tab[i]);
i = i+1;
}
stop(3);
printf(max(tab, 10));
}

3
prog.c
View file

@ -1,12 +1,9 @@
int max(int * tab, int size) {
int i = 0;
int max = 0;
printf(size);
while (i<size) {
printf(tab[i]);
if (tab[i] > max) {
max = tab[i];
printf(200);
}
i = i+1;
}