summaryrefslogtreecommitdiff
path: root/lib/alu.c
diff options
context:
space:
mode:
authorbiouman <>2001-04-15 02:12:11 +0000
committerbiouman <>2001-04-15 02:12:11 +0000
commit62480cd55b67e10128b9a49821d94c3c5117830f (patch)
tree6139c8a867012d60f766d38085455f2cb1c156ad /lib/alu.c
parent0aca28afe35e25329bd8d680b532ccf78d4e4557 (diff)
mergeage de la branche simulateur avec la branche asm
Diffstat (limited to 'lib/alu.c')
-rw-r--r--lib/alu.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/alu.c b/lib/alu.c
new file mode 100644
index 0000000..b394b09
--- /dev/null
+++ b/lib/alu.c
@@ -0,0 +1,22 @@
+#include "alu.h"
+
+// rajouter les overflow...
+
+/*****************************************/
+/** **/
+/** GESTION DE L'UNITE DE CALCUL **/
+/** **/
+/*****************************************/
+
+Uint32 AdditionNonSigne(Uint32 a, Uint32 b) { return (a + b); }
+Uint32 AdditionSigne(Uint32 a, Uint32 b) { return (a + b); }
+Uint32 SoustractionNonSigne(Uint32 a, Uint32 b) { return (a - b); }
+Uint32 SoustractionSigne(Uint32 a, Uint32 b) { return (a - b); }
+Uint32 MultiplicationNonSigne(Uint32 a, Uint32 b) { return (a * b); }
+Uint32 MultiplicationSigne(Uint32 a, Uint32 b) { return (a * b); }
+Uint32 DivisionNonSigne(Uint32 a, Uint32 b) { return (a / b); }
+Uint32 DivisionSigne(Uint32 a, Uint32 b) { return (a / b); }
+Uint32 AND(Uint32 a, Uint32 b) { return (a & b); }
+Uint32 OR(Uint32 a, Uint32 b) { return (a | b); }
+Uint32 SHL(Uint32 a) { return (a >> 1); }
+Uint32 SHR(Uint32 a) { return (a << 1); }