summaryrefslogtreecommitdiff
path: root/lib/alu.c
blob: 94f06ba02a49e9a6be63f9596c6256fed989f718 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#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);
}