Deux versions Compilateur et Interpreteur terminé, TAF : finir la version non sécurisée du processeur, tester
This commit is contained in:
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
|
||||||
4
Makefile
4
Makefile
|
|
@ -53,7 +53,7 @@ ifeq ($(QUOI),compile)
|
||||||
@echo "Compilation terminée"
|
@echo "Compilation terminée"
|
||||||
else ifeq ($(QUOI),interprete)
|
else ifeq ($(QUOI),interprete)
|
||||||
@echo "Interpretation"
|
@echo "Interpretation"
|
||||||
cat $(SOURCE).memasm | Interpreteur/rondoudou_interpreter
|
Interpreteur/rondoudou_interpreter $(SOURCE).memasm
|
||||||
@echo "Interpretation terminée"
|
@echo "Interpretation terminée"
|
||||||
else ifeq ($(QUOI),cross_assemble)
|
else ifeq ($(QUOI),cross_assemble)
|
||||||
@echo "CrossAssemblage"
|
@echo "CrossAssemblage"
|
||||||
|
|
@ -72,7 +72,7 @@ else ifeq ($(QUOI),all)
|
||||||
@mv output.txt $(SOURCE).memasm
|
@mv output.txt $(SOURCE).memasm
|
||||||
@echo "Compilation terminée"
|
@echo "Compilation terminée"
|
||||||
@echo "Interpretation"
|
@echo "Interpretation"
|
||||||
cat $(SOURCE).memasm | Interpreteur/rondoudou_interpreter
|
Interpreteur/rondoudou_interpreter $(SOURCE).memasm
|
||||||
@echo "Interpretation terminée"
|
@echo "Interpretation terminée"
|
||||||
@echo "CrossAssemblage"
|
@echo "CrossAssemblage"
|
||||||
cat $(SOURCE).memasm | CrossAssembleur/rondoudou_cross_assembleur
|
cat $(SOURCE).memasm | CrossAssembleur/rondoudou_cross_assembleur
|
||||||
|
|
|
||||||
26
juste_prix.c
Normal file
26
juste_prix.c
Normal 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
19
max.c
|
|
@ -1,14 +1,5 @@
|
||||||
int get_value() {
|
int get_value() {
|
||||||
int i = 0;
|
int i = get();
|
||||||
while (i<5) {
|
|
||||||
printf(0);
|
|
||||||
stop(1);
|
|
||||||
printf(255);
|
|
||||||
stop(1);
|
|
||||||
i = i+1;
|
|
||||||
}
|
|
||||||
stop(15);
|
|
||||||
i = get();
|
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -32,13 +23,9 @@ int main() {
|
||||||
i = i+1;
|
i = i+1;
|
||||||
}
|
}
|
||||||
i = 0;
|
i = 0;
|
||||||
while (i<5) {
|
while (i<10) {
|
||||||
printf(170);
|
printf(tab[i]);
|
||||||
stop(1);
|
|
||||||
printf(85);
|
|
||||||
stop(1);
|
|
||||||
i = i+1;
|
i = i+1;
|
||||||
}
|
}
|
||||||
stop(3);
|
|
||||||
printf(max(tab, 10));
|
printf(max(tab, 10));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
3
prog.c
3
prog.c
|
|
@ -1,12 +1,9 @@
|
||||||
int max(int * tab, int size) {
|
int max(int * tab, int size) {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
int max = 0;
|
int max = 0;
|
||||||
printf(size);
|
|
||||||
while (i<size) {
|
while (i<size) {
|
||||||
printf(tab[i]);
|
|
||||||
if (tab[i] > max) {
|
if (tab[i] > max) {
|
||||||
max = tab[i];
|
max = tab[i];
|
||||||
printf(200);
|
|
||||||
}
|
}
|
||||||
i = i+1;
|
i = i+1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue