7.6. DECNUM3 and BOOTH: Making a Function
Earlier we developed Booth's algorithm for integer multiplication (Section 6.5.1) and implemented it in two versions of a program for performing number conversions, DECNUM (Figure 6-5) and DECNUM2 (Figure 7-3). Those were monolithic programs. Having now demonstrated program segmentation, we are prepared to split the DECNUM2 program into two parts: Booth's algorithm, as callable function BOOTH, and an outer shell, DECNUM3.
7.6.1. Defining the Interface
Functions are usually specified in two parts: the public interface and the body of code, which is encapsulated or hidden from view. The writer of the function determines in the public interface what the inputs, outputs, and argument-passing methods must ...
Get Itanium® Architecture for Programmers: Understanding 64-Bit Processors and EPIC Principles now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.