Page 176 - ARM 64 Bit Assembly Language
P. 176

Abstract data types  163


                   124  /* wl_print_numerical prints a table showing the number  */
                   125  /* of occurrences for each word, followed by the word,  */
                   126  /* sorted in reverse order of occurence.             */
                   127  void wl_print_numerical(wordlist *list)
                   128  {
                   129  printf("wl_print_numerical has not been implemented");
                   130  }


                                         Listing 6.7 Makefile for the wordfreq program.
                    1  C_OBJS=wordfreq.o list.o
                    2  ASM_OBJS=
                    3  OBJS=$(C_OBJS) $(ASM_OBJS)
                    4
                    5  LFLAGS=-O2 -g
                    6  CFLAGS=-I. -O2 -g -Wall
                    7  SFLAGS=-I. -O2 -g -Wall
                    8  DEPENDFLAGS=-I. -M
                    9
                   10  wordfreq: $(OBJS)
                   11         gcc $(LFLAGS) -o wordfreq $(OBJS)
                   12
                   13  .S.o:
                   14         gcc $(SFLAGS) -c $<
                   15
                   16  .c.o:
                   17         gcc $(CFLAGS) -c $<
                   18
                   19  clean:
                   20         rm -f *.o *~ wordfreq
                   21
                   22  # make depend will create a file ".depend" with all the dependencies
                   23  depend:
                   24         rm -f .depend
                   25         $(CC) $(DEPENDFLAGS) $(C_OBJS:.o=.c) > .depend
                   26
                   27  # if we have a .depend file, include it
                   28  ifeq (.depend,$(wildcard .depend))
                   29  include .depend
                   30  endif

                     Suppose we wish to implement one of the functions from Listing 6.6 in AArch64 assembly
                     language. We would

                     1. delete the function from the C file,
                     2. create a new file with the assembly version of the function, and
                     3. modify the makefile so that the new file is included in the program.
   171   172   173   174   175   176   177   178   179   180   181