X-Git-Url: https://gapil.gnulinux.it/gitweb/?a=blobdiff_plain;f=process.tex;h=2376ec7d8617289e9c3d35f7a05d2d1faf4bec9a;hb=1eb95e2a35acc78407e7d988604719bb92da7253;hp=88e3b87160d0d36999ecb1ce84a9bea8208a24c7;hpb=e6ff0c2ef7388e665c6674c1752cdce21972c1eb;p=gapil.git diff --git a/process.tex b/process.tex index 88e3b87..2376ec7 100644 --- a/process.tex +++ b/process.tex @@ -1,6 +1,6 @@ %% process.tex %% -%% Copyright (C) 2000-2012 Simone Piccardi. Permission is granted to +%% Copyright (C) 2000-2013 Simone Piccardi. Permission is granted to %% copy, distribute and/or modify this document under the terms of the GNU Free %% Documentation License, Version 1.1 or any later version published by the %% Free Software Foundation; with the Invariant Sections being "Un preambolo", @@ -2698,30 +2698,26 @@ una variabile per poi ristamparne il contenuto leggendolo un byte alla volta. Il codice di detto programma, \file{endtest.c}, è nei sorgenti allegati, allora se lo eseguiamo su un normale PC compatibile, che è \textit{little endian} otterremo qualcosa del tipo: -\begin{Command} -[piccardi@gont sources]$ ./endtest -\end{Command} -%$ -\begin{Terminal} +\begin{Console} +[piccardi@gont sources]$ \textbf{./endtest} Using value ABCDEF01 val[0]= 1 val[1]=EF val[2]=CD val[3]=AB -\end{Terminal} +\end{Console} +%$ mentre su un vecchio Macintosh con PowerPC, che è \textit{big endian} avremo qualcosa del tipo: -\begin{Command} -piccardi@anarres:~/gapil/sources$ ./endtest -\end{Command} -%$ -\begin{Terminal} +\begin{Console} +piccardi@anarres:~/gapil/sources$ \textbf{./endtest} Using value ABCDEF01 val[0]=AB val[1]=CD val[2]=EF val[3]= 1 -\end{Terminal} +\end{Console} +%$ L'attenzione alla \textit{endianness} nella programmazione è importante, perché se si fanno assunzioni relative alla propria architettura non è detto che