Itanium® Architecture for Programmers

Sample Programs and Test Files from the Book

The sample programs and test files from Itanium Architecture for Programmers can be downloaded in several formats. Select the format and method that will be most convenient for the way you intend to use the files with text editors.

Downloadable Archive Contents
itanium_lf.tar Files having LF line terminators, as appropriate for ASCII text on all Unix and Linux systems.
itanium_crlf.tar Files having CRLF line terminators, as appropriate for ASCII text on all Windows and DOS systems. (OpenVMS systems will also recognize this as a valid text file format.)
itanium_cr.sit Files having CR line terminators, as appropriate for ASCII text on Macintosh systems.

Stuffit Expander™, which is available from the Stuffit home page as a free download, can extract the files from these archives as a folder or subdirectory (named itanium_lf, itanium_crlf, or itanium_cr). On a Linux or Unix system, you can also simply use the command 'tar xvf itanium_lf.tar' without the need for Stuffit Expander.

Each individual file from Itanium Architecture for Programmers can be brought up in a new browser window, from which you can print it, save it as a local ASCII file, or select and paste the text into a window of another application, such as a programmer's text editor.

Files Listed by Text Reference
Text Reference       File Name
Section 1.7.1 squares.c
Section 1.7.1 squares.cob
Section 1.7.1 squares.f
Figure 1-3 squares.s
Figure 4-3 hexnum.s
Figure 4-5 dotprod.s
Figure 5-1 dotloop.s
Figure 5-2 dotcloop.s
Figure 5-3 maximum.s
Figure 6-1 hexnum2.s
Figure 6-3 scantext.s
Figure 6-5 decnum.s
Figure 6-6 getput.c
Figure 6-7 io_c.s
Figure 6-8 backward.s
Figure 7-3 decnum2.s
Figure 7-7 booth.s
Figure 7-8 decnum3.s
Figure 7-9 random.s
Section 7.8.2 uint64_rem_min_lat.s
Figure 7-10 randc.c
Figure 7-11 randf.f
Figure 8-1 horner.s
Figure 8-4 approxpi.s
Section 8.9 dbl_div_min_lat.s
Figure 9-3 scanterm.s
Figure 9-5 scanfile.s
Section 9.6 lincoln.txt
Figure 9-4 sortstr.s
Figure 9-6 sortint.s
Section 9-7 sortint.txt
Figure 10-3 dotctop.s
Figure 10-4 dotctop2.s
Figure 10-5 fib1.s
Figure 10-6 fib2.s
Figure 10-7 fib3.s
Figure 10-8 testfib.c
Figure 11-1 com_c.c
Figure 11-1 com_f.f
Section 11.3.3 com_f1.f
Section 11.3.3 com_f2.f
Figure 11-2 inline.c
Figure 11-3 fib101.c
Exercise 11-11 matrix_c.c
Exercise 11-11 matrix_f.f
Appendix E macros.s
Figure F-1 squares_Asm.c
Figure F-2 squaresasm.c
Files Listed by File Name
File Name             Text Reference
approxpi.s Figure 8-4
backward.s Figure 6-8
booth.s Figure 7-7
com_c.c Figure 11-1
com_f.f Figure 11-1
com_f1.f Section 11.3.3
com_f2.f Section 11.3.3
dbl_div_min_lat.s Section 8.9
decnum.s Figure 6-5
decnum2.s Figure 7-3
decnum3.s Figure 7-8
dotcloop.s Figure 5-2
dotctop.s Figure 10-3
dotctop2.s Figure 10-4
dotloop.s Figure 5-1
dotprod.s Figure 4-5
fib1.s Figure 10-5
fib2.s Figure 10-6
fib3.s Figure 10-7
fib101.c Figure 11-3
getput.c Figure 6-6
hexnum.s Figure 4-3
hexnum2.s Figure 6-1
horner.s Figure 8-1
inline.c Figure 11-2
io_c.s Figure 6-7
lincoln.txt Section 9.6
macros.s Appendix E
matrix_c.c Exercise 11-11
matrix_f.f Exercise 11-11
maximum.s Figure 5-3
randc.c Figure 7-10
randf.f Figure 7-11
random.s Figure 7-9
scanfile.s Figure 9-5
scanterm.s Figure 9-3
scantext.s Figure 6-3
sortint.s Figure 9-6
sortint.txt Section 9-7
sortstr.s Figure 9-4
squares.c Section 1.7.1
squares.cob Section 1.7.1
squares.f Section 1.7.1
squares.s Figure 1-3
squares_Asm.c Figure F-1
squaresasm.c Figure F-2
testfib.c Figure 10-8
uint64_rem_min_lat.s Section 7.8.2

The sample programs and test files should be functionally equivalent, regardless of the method chosen for downloading.

Additional files

File Name Nature and Purpose
checksum.c  Source code for a simple C function that can be used for studies of the kind described in Chapter 11 (transcribed from Programming Itanium-based Systems: Developing High Performance Applications for Intel’s New Architecture by Triebel, Bissell, and Booth, Intel Press, 2001, page 283).
palindromes.txt  Additional palindromes beyond those in Exercise 6-24. (See also Peter Norvig’s computer-generated longest palindrome.)
testio_c.c Program in C that is equivalent to the assembly language program io_c.s (Figure 6-7).
usefgets.s A variant of the SCANTERM program (Figure 9-3) that uses the fgets function instead of the deprecated gets function. You must include '-x assembler-with-cpp' on the command line to gcc in a Linux environment, in order to invoke the cpp preprocessor phase. (Note that the implementation of a file pointer corresponding to stdin differs between HP-UX and Linux. A related exercise would be to use the techniques of Chapter 11 on sample C programs to learn how to access stdout and stderr similarly.)
These additional files have been produced during the evolution and use of the book and its sample programs. They are included in the subsidiary folder or subdirectory extras in the composite archives.

  [viika]  [Itanium Architecture home]  [Top of Page]  [e-mail the author(s)]