Skip to Main Content
Itanium® Architecture for Programmers: Understanding 64-Bit Processors and EPIC Principles
book

Itanium® Architecture for Programmers: Understanding 64-Bit Processors and EPIC Principles

by James S. Evans - Lawrence University, Gregory L. Trimper - viika
April 2003
Intermediate to advanced content levelIntermediate to advanced
576 pages
15h 13m
English
Pearson
Content preview from Itanium® Architecture for Programmers: Understanding 64-Bit Processors and EPIC Principles

7.2. DECNUM2: Using Stack Operations

We can rewrite the DECNUM program (Figure 6-5) using a stack that stores each digit from right to left as individual bytes (most significant digit on the bottom of the stack). Each element is computed as a remainder, converted into an ASCII character, and then transferred byte-by-byte into the order (left to right) required for printing. The new DECNUM2 program is shown in Figure 7-3.

Figure 7-3. DECNUM2: An illustration of stack usage
 // DECNUM2 Convert integer to ASCII // This program converts the positive number at X2 // into a string of ASCII-encoded decimal digits at A2 W = 64 // W = number width LEN = 20 // Allowance for 20 digits DOT8 = 0xcccccccccccccccd // 0.8 (approx.) .data // Declare storage .align ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

ARM System Developer's Guide

ARM System Developer's Guide

Andrew Sloss, Dominic Symes, Chris Wright
Intel Xeon Phi Processor High Performance Programming, 2nd Edition

Intel Xeon Phi Processor High Performance Programming, 2nd Edition

James Jeffers, James Reinders, Avinash Sodani

Publisher Resources

ISBN: 0131013726Purchase book