Prior Page     Next Page     This Chapter    Prior Chapter    Next Chapter





Character to Number Conversion Operations

There are two arithmetic conversion instructions: ITOA and ATOI. The first, ITOA, takes a binary integer in a register and produce an 11 character signed decimal ASCII number with leading zeros. This is not the most beautiful representation, but it is one that may be easily edited into a more useful form.

The second, ATOI, does the reverse, it takes in a series of signed ASCII numeric digits as a decimal number and puts the binary integer result into a register. It keeps using ASCII bytes until it finds a non-numeric character. It is the only Hermes instruction that uses a varying size block of memory. It keeps using bytes from memory until it finds a character that couldn't possibly be a part of the number it is converting.

These two instructions can be used to change from external to internal arithmetic forms and vice versa, that is, to shift numbers from decimal human readable characters to binary machine readable numbers and from internal binary integers back to decimal character form.








Prior Page     Next Page     This Chapter    Prior Chapter    Next Chapter


Copyright © 1995 R. Uzgalis. All rights reserved.
Contact: buz@cs.aukuni.ac.nz