Contents in Detail xv
8.1.10 Extended-Precision xor Operations.............................................. 504
8.1.11 Extended-Precision not Operations.............................................. 504
8.1.12 Extended-Precision Shift Operations ............................................ 504
8.1.13 Extended-Precision Rotate Operations ......................................... 508
8.1.14 Extended-Precision I/O ............................................................. 509
8.2 Operating on Different-Size Operands .......................................................... 530
8.3 Decimal Arithmetic...................................................................................... 532
8.3.1 Literal BCD Constants................................................................ 533
8.3.2 The 80x86 daa and das Instructions ........................................... 534
8.3.3 The 80x86 aaa, aas, aam, and aad Instructions .......................... 535
8.3.4 Packed Decimal Arithmetic Using the FPU.................................... 537
8.4 Tables ....................................................................................................... 539
8.4.1 Function Computation via Table Lookup....................................... 539
8.4.2 Domain Conditioning................................................................ 544
8.4.3 Generating Tables .................................................................... 545
8.4.4 Table Lookup Performance......................................................... 548
8.5 For More Information .................................................................................. 549
9
MACROS AND THE HLA COMPILE-TIME LANGUAGE 551
9.1 Introduction to the Compile-Time Language (CTL) ............................................ 551
9.2 The #print and #error Statements.................................................................. 553
9.3 Compile-Time Constants and Variables.......................................................... 555
9.4 Compile-Time Expressions and Operators ...................................................... 555
9.5 Compile-Time Functions ............................................................................... 558
9.5.1 Type-Conversion Compile-Time Functions..................................... 559
9.5.2 Numeric Compile-Time Functions ................................................ 561
9.5.3 Character-Classification Compile-Time Functions........................... 561
9.5.4 Compile-Time String Functions .................................................... 561
9.5.5 Compile-Time Symbol Information............................................... 562
9.5.6 Miscellaneous Compile-Time Functions ........................................ 563
9.5.7 Compile-Time Type Conversions of Text Objects ........................... 564
9.6 Conditional Compilation (Compile-Time Decisions).......................................... 565
9.7 Repetitive Compilation (Compile-Time Loops).................................................. 570
9.8 Macros (Compile-Time Procedures) ............................................................... 573
9.8.1 Standard Macros...................................................................... 574
9.8.2 Macro Parameters .................................................................... 576
9.8.3 Local Symbols in a Macro ......................................................... 582
9.8.4 Macros as Compile-Time Procedures ........................................... 585
9.8.5 Simulating Function Overloading with Macros.............................. 586
9.9 Writing Compile-Time “Programs” ................................................................ 592
9.9.1 Constructing Data Tables at Compile Time................................... 592
9.9.2 Unrolling Loops ........................................................................ 596
9.10 Using Macros in Different Source Files........................................................... 598
9.11 For More Information .................................................................................. 598
AAL2E_03.book Page xv Thursday, February 18, 2010 12:49 PM