From f2bb32521389709c06407904eb42fa6ba70dcc84 Mon Sep 17 00:00:00 2001 From: lefevre Date: Mon, 27 Sep 2021 16:47:54 +0200 Subject: [PATCH] envoi --- "ASR3.1/TP01/\033[200~sum_array.c~" | 0 ASR3.1/TP01/a.out | Bin 0 -> 16256 bytes ASR3.1/TP01/adresses_virtuelles.c | 27 +++++++++++++++++++++++++++ ASR3.1/TP01/bss_data.c | 8 ++++++++ ASR3.1/TP01/exercice3.c | 26 ++++++++++++++++++++++++++ 5 files changed, 61 insertions(+) create mode 100644 "ASR3.1/TP01/\033[200~sum_array.c~" create mode 100755 ASR3.1/TP01/a.out create mode 100644 ASR3.1/TP01/adresses_virtuelles.c create mode 100644 ASR3.1/TP01/bss_data.c create mode 100644 ASR3.1/TP01/exercice3.c 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 0000000000000000000000000000000000000000..b0d6b1deb50a0ae4a3cfffb9bcccfe5bacea8367 GIT binary patch literal 16256 zcmeHOeQX?85r22K6PLtyPU-|Fq4iP{a8i7+^My<6X3zFHYvg>8IBi0kY|eLU`_%g| zck5zTrA_5F>M586q|zc)NaUaLA%qY@iUbI!iIPSYl3S!IK%rJh#N~t5HErbr$ujeH z=DfE#SEzr0gm$F8dGni(H#_@w{nq>5laZb-zt1O_D#ZN)r9-tgqOziu8$zg}Rn)-m zo#GC$0N_eER8qV71;4FeUQKotz|pTB8)f*XY*;Yo43VSXd^Cv(0WlYJ9_Uwv3Xi4oc?x^pQ6Yx!p-lqVZogH`!e{^ zr6r4xW_+1oL0^g$aW#PDE39UqMSCp-s6N*TiyfGsV9V;|*k#LD4Y=E08vuE61@?*X8=L6AQO z$6aM`q3by_8hb>K4L+jxM-xdglue|~ei2J%039$)Gm$dDDmD_;`xEJCGVvISa9LyM znKkuPG?5l4<5k@vw)J$kcj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ie5dI-!_S3Qz?ISvQhHh9^`coVRrbm_r5H*Jpx-5M9S^BRoy;Hw_O}Adq|JXeEiFxn|z_DL<{=WrW;m#cVO~9A<>jmF$th$0Y7L%OlF)C&O z$9f*7dK%>LXW+GV9ZIgiS+YMw=z6lRhPt7>yFPV*WBgZXe9Hf=fzJxSF;BPs8o(8b z>1100zsm`5JKC3MN@q+X6oW9NadR#j^!RWp zH3}{cNykh|OpOsE8%xBDjgS;%7flU;N7wG~_J|(Y(W%2;fKs2h&^!0<2ygH1DAmY4 z2>`*PRF7yBLF?Qt^ld#m+rvHj&aSRKkzTzw+};zxsB$MmEH^B(|H#b=C0im?-sgZj z8jN_4Lf2mz+0yCU>>E~5`d({bD}(Y+I_;)%3A zoHL*(bLWF42DvYnqcC!#hOWbg3oa?{#3;MHqIADUNoFFH8%>$fKHz57=7ZdVog+qe zNQC6T8%Pg_hO(I;_822@1D&H{s9>q4{7mHz-2!(KK{nb2Dpe9yPML zL?&G#=%C9Q$tXHdYba@okUa5_X^cP{ha~7S@&bj7K^laEaqwly_OM5z?ZIsb98D!+ z&}#-_!B0qbU{|5p80OoR>KhJNO^ZE1q z)}4P8{Bdr}{yhI>j^9&|@Eozu?9cPi1Ymf|?9cP*A_tw5Fou)93Ifhm*`Md9%<0dF z{rv}Q*^c=WfZ^PiWuE^sS3!^D&fi9b7>5Sdl>K@B&3u9k-Sy-1f1do?$&Tmq%r%EU z&iUQ-`#xY;6ONC6QY8`R_Z&iHuG~hB-;kXC3i&Zt(a1rr@Zu%VIsFfj0rTg$FcgFR zIpj}V{ycAC&hK$-?;gKDC;wtM3Rx0okSknG|*RE!MR^si*xYu{#Wr26VP&(gG&_u286iR AlmGw# literal 0 HcmV?d00001 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