Version fonctionnelle processeur sécurisé
This commit is contained in:
parent
be9c40eece
commit
496ec68147
9 changed files with 52 additions and 17 deletions
3
.gitmodules
vendored
3
.gitmodules
vendored
|
@ -10,3 +10,6 @@
|
|||
[submodule "Interpreteur"]
|
||||
path = Interpreteur
|
||||
url = https://git.etud.insa-toulouse.fr/pfaure/Interpreteur.git
|
||||
[submodule "InterpreteurRegistres"]
|
||||
path = InterpreteurRegistres
|
||||
url = https://git.etud.insa-toulouse.fr/pfaure/InterpreteurRegistres.git
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit b501ce3389db4142df557e6bca95434e591741f6
|
||||
Subproject commit 5eaffa4453e7258dd79040a10d7d7b7205eaefab
|
|
@ -1 +1 @@
|
|||
Subproject commit 96a7569291b22cc8f7339081be431554c83f86fc
|
||||
Subproject commit 712e317901212d1917739b90577e715154e09afe
|
|
@ -1 +1 @@
|
|||
Subproject commit c9c60001de4ae1f8e379dbc210b7a70a6b2dd934
|
||||
Subproject commit 725e0125079b6bde8ad032a3be21910980900ec4
|
1
InterpreteurRegistres
Submodule
1
InterpreteurRegistres
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit bff261fa01129da9135f95f16bf4124366ea24fe
|
26
Makefile
26
Makefile
|
@ -6,7 +6,7 @@ default:
|
|||
|
||||
compile:
|
||||
ifeq ($(QUOI),null)
|
||||
@echo "USAGE : make compile QUOI=\"[compilateur|interpreteur|cross_assembleur|all]\""
|
||||
@echo "USAGE : make compile QUOI=\"[compilateur|interpreteur|interpreteur_registres|cross_assembleur|all]\""
|
||||
else
|
||||
ifeq ($(QUOI),compilateur)
|
||||
@echo "Compilation du compilateur"
|
||||
|
@ -20,6 +20,10 @@ else ifeq ($(QUOI),interpreteur)
|
|||
@echo "Compilation de l'interpreteur"
|
||||
$(MAKE) -C Interpreteur build
|
||||
@echo "Compilation terminée"
|
||||
else ifeq ($(QUOI),interpreteur_registres)
|
||||
@echo "Compilation de l'interpreteur_registres"
|
||||
$(MAKE) -C InterpreteurRegistres build
|
||||
@echo "Compilation terminée"
|
||||
else ifeq ($(QUOI),all)
|
||||
@echo "Compilation du compilateur"
|
||||
$(MAKE) -C Compilateur build
|
||||
|
@ -30,21 +34,26 @@ else ifeq ($(QUOI),all)
|
|||
@echo "Compilation du CrossAssembleur"
|
||||
$(MAKE) -C CrossAssembleur build
|
||||
@echo "Compilation terminée"
|
||||
@echo "Compilation de l'interpreteur_registres"
|
||||
$(MAKE) -C InterpreteurRegistres build
|
||||
@echo "Compilation terminée"
|
||||
else
|
||||
@echo "USAGE : make compile QUOI=\"[compilateur|interpreteur|cross_assembleur|all]\""
|
||||
@echo "USAGE : make compile QUOI=\"[compilateur|interpreteur|interpreteur_registres|cross_assembleur|all]\""
|
||||
endif
|
||||
endif
|
||||
|
||||
clean:
|
||||
$(MAKE) -C Compilateur clean
|
||||
$(MAKE) -C Interpreteur clean
|
||||
$(MAKE) -C InterpreteurRegistres clean
|
||||
$(MAKE) -C CrossAssembleur clean
|
||||
@rm -f ./*.memasm ./*.regasm ./*.bin
|
||||
|
||||
exec:
|
||||
ifeq ($(SOURCE),null)
|
||||
@echo "USAGE : make exec SOURCE=\"file_name\" QUOI=\"[compile|interprete|cross_assemble|load|all]\""
|
||||
@echo "USAGE : make exec SOURCE=\"file_name\" QUOI=\"[compile|interprete|interprete_registres|cross_assemble|load|all]\""
|
||||
else ifeq ($(QUOI),null)
|
||||
@echo "USAGE : make exec SOURCE=\"file_name\" QUOI=\"[compile|interprete|cross_assemble|load|all]\""
|
||||
@echo "USAGE : make exec SOURCE=\"file_name\" QUOI=\"[compile|interprete|interprete_registres|cross_assemble|load|all]\""
|
||||
else
|
||||
ifeq ($(QUOI),compile)
|
||||
@echo "Compilation"
|
||||
|
@ -55,6 +64,10 @@ else ifeq ($(QUOI),interprete)
|
|||
@echo "Interpretation"
|
||||
Interpreteur/rondoudou_interpreter $(SOURCE).memasm
|
||||
@echo "Interpretation terminée"
|
||||
else ifeq ($(QUOI),interprete_registres)
|
||||
@echo "Interpretation registres"
|
||||
InterpreteurRegistres/rondoudou_interpreter_registres $(SOURCE).regasm
|
||||
@echo "Interpretation registres terminée"
|
||||
else ifeq ($(QUOI),cross_assemble)
|
||||
@echo "CrossAssemblage"
|
||||
cat $(SOURCE).memasm | CrossAssembleur/rondoudou_cross_assembleur
|
||||
|
@ -71,9 +84,6 @@ else ifeq ($(QUOI),all)
|
|||
cat $(SOURCE).c | Compilateur/rondoudou_gcc
|
||||
@mv output.txt $(SOURCE).memasm
|
||||
@echo "Compilation terminée"
|
||||
@echo "Interpretation"
|
||||
Interpreteur/rondoudou_interpreter $(SOURCE).memasm
|
||||
@echo "Interpretation terminée"
|
||||
@echo "CrossAssemblage"
|
||||
cat $(SOURCE).memasm | CrossAssembleur/rondoudou_cross_assembleur
|
||||
@mv output.asm $(SOURCE).regasm
|
||||
|
@ -84,7 +94,7 @@ else ifeq ($(QUOI),all)
|
|||
@mv $(SOURCE).tmp.vhd Processeur/Processeur.srcs/sources_1/new/MemoireInstructions.vhd
|
||||
@echo "Chargement du binaire terminé"
|
||||
else
|
||||
@echo "USAGE : make exec SOURCE=\"file_name\" QUOI=\"[compile|interprete|cross_assemble|load|all]\""
|
||||
@echo "USAGE : make exec SOURCE=\"file_name\" QUOI=\"[compile|interprete|interprete_registres|cross_assemble|load|all]\""
|
||||
endif
|
||||
endif
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 5663419784db4c244ec440af70ed1b5b3a1fcebc
|
||||
Subproject commit ca762f57c7c544656eaea97ec391a5efd4ec401b
|
29
max.c
29
max.c
|
@ -1,4 +1,26 @@
|
|||
int print_alarm1() {
|
||||
int j = 0;
|
||||
while (j<5) {
|
||||
printf(255);
|
||||
stop(2);
|
||||
printf(0);
|
||||
j = j+1;
|
||||
}
|
||||
}
|
||||
|
||||
int print_alarm2() {
|
||||
int j = 0;
|
||||
while (j<5) {
|
||||
printf(170);
|
||||
stop(2);
|
||||
printf(85);
|
||||
j = j+1;
|
||||
}
|
||||
}
|
||||
|
||||
int get_value() {
|
||||
print_alarm2();
|
||||
stop(10);
|
||||
int i = get();
|
||||
return i;
|
||||
}
|
||||
|
@ -22,10 +44,7 @@ int main() {
|
|||
tab[i] = get_value();
|
||||
i = i+1;
|
||||
}
|
||||
i = 0;
|
||||
while (i<10) {
|
||||
printf(tab[i]);
|
||||
i = i+1;
|
||||
}
|
||||
|
||||
print_alarm1();
|
||||
printf(max(tab, 10));
|
||||
}
|
||||
|
|
2
prog.c
2
prog.c
|
@ -2,6 +2,8 @@ int max(int * tab, int size) {
|
|||
int i = 0;
|
||||
int max = 0;
|
||||
while (i<size) {
|
||||
printf(tab[i]);
|
||||
stop(10);
|
||||
if (tab[i] > max) {
|
||||
max = tab[i];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue