Merge branch 'master' of https://git.etud.insa-toulouse.fr/pfaure/CrossAssembleur
This commit is contained in:
commit
1cb970ec2d
1 changed files with 4 additions and 4 deletions
8
as.y
8
as.y
|
@ -3,7 +3,7 @@
|
||||||
}
|
}
|
||||||
%{
|
%{
|
||||||
#include "tables.h"
|
#include "tables.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
FILE * file;
|
FILE * file;
|
||||||
FILE * file2;
|
FILE * file2;
|
||||||
|
@ -21,7 +21,7 @@ FILE * file2;
|
||||||
|
|
||||||
%%
|
%%
|
||||||
|
|
||||||
Programme : Instruction Programme;
|
Programme : Instruction Programme;
|
||||||
Programme : Instruction;
|
Programme : Instruction;
|
||||||
|
|
||||||
Instruction : tMUL tNB tNB tNB {increment_time();
|
Instruction : tMUL tNB tNB tNB {increment_time();
|
||||||
|
@ -105,13 +105,13 @@ Instruction : tJMF tNB tNB {increment_time();
|
||||||
add_instruction(JMZ, $3, 0, 0);
|
add_instruction(JMZ, $3, 0, 0);
|
||||||
new_instruction(added_instruction + 2);};
|
new_instruction(added_instruction + 2);};
|
||||||
|
|
||||||
Instruction : tWR tNB tNB {increment_time();
|
Instruction : tREAD tNB tNB {increment_time();
|
||||||
int added_instruction = 0;
|
int added_instruction = 0;
|
||||||
int reg_addr = get_reg_read($3, &added_instruction);
|
int reg_addr = get_reg_read($3, &added_instruction);
|
||||||
int reg_dest = get_reg_write($2, &added_instruction);
|
int reg_dest = get_reg_write($2, &added_instruction);
|
||||||
add_instruction(LOADI, reg_dest, reg_addr, 0);
|
add_instruction(LOADI, reg_dest, reg_addr, 0);
|
||||||
new_instruction(added_instruction + 1);};
|
new_instruction(added_instruction + 1);};
|
||||||
Instruction : tREAD tNB tNB {increment_time();
|
Instruction : tWR tNB tNB {increment_time();
|
||||||
int added_instruction = 0;
|
int added_instruction = 0;
|
||||||
int reg_addr = get_reg_read($2, &added_instruction);
|
int reg_addr = get_reg_read($2, &added_instruction);
|
||||||
int reg_value = get_reg_read($3, &added_instruction);
|
int reg_value = get_reg_read($3, &added_instruction);
|
||||||
|
|
Loading…
Reference in a new issue