commit f2bb32521389709c06407904eb42fa6ba70dcc84 Author: lefevre Date: Mon Sep 27 16:47:54 2021 +0200 envoi diff --git "a/ASR3.1/TP01/\033[200~sum_array.c~" "b/ASR3.1/TP01/\033[200~sum_array.c~" new file mode 100644 index 0000000..e69de29 diff --git a/ASR3.1/TP01/a.out b/ASR3.1/TP01/a.out new file mode 100755 index 0000000..b0d6b1d Binary files /dev/null and b/ASR3.1/TP01/a.out differ diff --git a/ASR3.1/TP01/adresses_virtuelles.c b/ASR3.1/TP01/adresses_virtuelles.c new file mode 100644 index 0000000..402e6b5 --- /dev/null +++ b/ASR3.1/TP01/adresses_virtuelles.c @@ -0,0 +1,27 @@ +/* adresses virtuelles d'un processus */ + +#include +#include +#include +#include +int t[1000] = {[0 ... 999] = 2}; + +int main(int argc, char * argv[]) +{ + int i=3; + static int j = 3; + char * m = (char*)malloc(1); + + printf("je suis le pid %d\n\n",getpid()); + + /* ------- Affichage des adresses --------*/ + + printf("main\t=\t%p\n",main); + printf("&argc\t=\t%p\n",&argc); + printf("&i\t=\t%p\n",&i); + printf("&j\t=\t%p\n",&j); + printf("t\t=\t%p\n",t); + printf("m\t=\t%p\n",m); + + getchar(); +} \ No newline at end of file diff --git a/ASR3.1/TP01/bss_data.c b/ASR3.1/TP01/bss_data.c new file mode 100644 index 0000000..aedbd61 --- /dev/null +++ b/ASR3.1/TP01/bss_data.c @@ -0,0 +1,8 @@ +/* segment bss et data */ +#define N 100000 +//int t[N]; /* version 1 */ //La mémoire augmente bss +int t[N]={1}; /* version 2 */ //La mémoire reste inchangée bss +int main() +{ + return 0; +} diff --git a/ASR3.1/TP01/exercice3.c b/ASR3.1/TP01/exercice3.c new file mode 100644 index 0000000..d68f0bd --- /dev/null +++ b/ASR3.1/TP01/exercice3.c @@ -0,0 +1,26 @@ +/* accès mémoire */ +#include +#include +#include +#define N 8192 + +int t[N][N]; + +static inline double tstamp(void) +{ + struct timespec tv; + clock_gettime(CLOCK_REALTIME, &tv); + return tv.tv_sec + tv.tv_nsec * 1.0e-9; +} + +int main() +{ + int i,j; + double t1,t2; + t1=tstamp(); + /* version 1 */ for(i=0;i