Merge Interpreteur serucise et non securise
This commit is contained in:
commit
3efa8d5ef2
1 changed files with 13 additions and 4 deletions
|
@ -6,6 +6,8 @@
|
|||
#define TAILLE_MEMOIRE (64)
|
||||
#define TAILLE_PILE_APPELS (16)
|
||||
|
||||
#define SECURISED (1)
|
||||
|
||||
|
||||
/**************************************************/
|
||||
/**************************************************/
|
||||
|
@ -199,10 +201,17 @@ void execute() {
|
|||
eip = programme[eip].param1 - 1;
|
||||
|
||||
} else if (programme[eip].instruction == RET) {
|
||||
esp--;
|
||||
eip = pile[check_adresse_pile(esp)] - 1;
|
||||
esp--;
|
||||
ebp = pile[check_adresse_pile(esp)];
|
||||
if (SECURISED) {
|
||||
esp--;
|
||||
eip = pile[check_adresse_pile(esp)] - 1;
|
||||
esp--;
|
||||
ebp = pile[check_adresse_pile(esp)];
|
||||
} else {
|
||||
int lastebp = ebp;
|
||||
eip = mem[check_adresse(ebp - 1)] - 1;
|
||||
ebp = mem[check_adresse(ebp - 2)];
|
||||
mem[check_adresse(lastebp - 2)] = mem[check_adresse(lastebp)];
|
||||
}
|
||||
|
||||
} else if (programme[eip].instruction == STOP) {
|
||||
if (programme[eip].param1 == 0) {
|
||||
|
|
Loading…
Reference in a new issue