home *** CD-ROM | disk | FTP | other *** search
- BASE.DOC
- --------
-
- Adapted for CP/M-80 by:
-
- Jon Lindsay
- 150 N. Jackson Avenue, Suite 108
- San Jose, CA 95116
- Tel. (408) 272-4800 (weekdays)
-
- Program name: BASE.COM
-
- Program function: Display values in the following formats:
-
- - Decimal
- - Hexadecimal
- - Octal
- - Split-octal
- - Binary
- - ASCII
-
- Usage: 1) Select the desired base.
- 2) Enter the desired value and enter carriage return
-
- History of the program:
-
- This base conversion program was adapted from Willard Nico's
- ALLBASE program from his work entitled: 8080/8085 Assembly
- Language Programming (Heath Co., Benton Harbor, MI). The program
- allows entry in any one of 6 bases and the output is converted to
- all 6 base formats. For more information about operating the
- program, type ?.
-
- About the bases:
-
- DECIMAL (Base 10): The greatest number of digits allowed is
- 5. If you enter more than 5 digits (ranging in value from 0 to
- 9), the answer will be wrong. Maximum value = 65535.
-
- HEXADECIMAL (Base 16): Maximum number of usable
- digits/letters (ranging from 0 - 9 and A - F) is 4. However, if
- more than 4 are entered the LAST 4 digits are used. For example,
- entering FFFFD will produce conversions for FFFD. Maximum value
- is FFFF.
- FFFF.
-
- OCTAL (Base 8): Still used, octal appears to be losing some
- of its popularity. Maximum number of usable digits (ranging from
- 0 to 7) is 6. Maximum value = 177777.
-
- SPLIT-OCTAL (Base 8): An archaic form, it is often easier to
- use than OCTAL since the contents of each byte value are display-
- ed separately. Note that the 2 bytes (if 2 entered) must be
- separated by a slash '(/'. Maximum value = 377/377.
-
- BINARY (Base 2): A 16-bit value (2 bytes) is always
- considered. The output is displayed in four 4-bit groups
- (nibbles) to make reading easier. Example: 1111 1111 1111 0001.
- Note that you will be able to enter a BINARY value in the same
- form. That is, you can optionally insert spaces between digits or
- groups of digits. The legal digits are 0 and 1. Maximum value =
- 1111 1111 1111 1111.
-
- Examples of entry: 0001 1000 1111 0001
- 1100011110001
- 11011
-
- CAUTION: Note that your BINARY input string has a field that
- is right-justified. That is, all your input is aligned from the
- right side. To show you what this means, if you enter 111111, the
- BINARY output will appear as 0000 0000 0011 1111. If you enter
- 1111 11 (thinking you are entering F3H), this will be parsed as
- 11 1111, the same as above. It's your option whether to use
- separating spaces between nibbles --- the spaces are discarded in
- any case. Just beware that if you do want to enter the byte value
- of, say, F3 (hex) in BINARY, be sure to include significant
- zeroes: e.g., 1111 0011 (F3H).
-
- ASCII: This "base" is included in the conversion because of
- the frequent access to this format. An ASCII character is
- contained within 1 byte. Values extend from 0 to 255. Since 2
- bytes are considered with each entry, you'll be able to enter 2
- ASCII values at a time. Besides the usual "printable" ASCII
- characters, you'll be able to display the graphic characters and
- non-printing values as well. For example, in the ASCII mode,
- enter control-C and hit carriage return. The value 3 will be
- converted to all bases. Values above 127 may have graphic
- significance for your computer. Though you probably can't enter
- values greater than 127 from your keyboard, it's possible to
- examine values above 127 by using one of the other bases,
- typically HEXADECIMAL, for entering values and observing the
- ASCII output.
-
- This program is configured for a Kaypro 2X. Because I was in
- a rush to get it going, I didn't comment the program very well.
- Nor is the code very elegant. Just a kludge job. But the general
- stuff is there for the probing mind. The program has some
- important information within. It contains the conversion routines
- (ASCII to Base/ Base to ASCII) for a number of popular bases
- which may be used in other situations.
-
- If anyone has any questions or comments, I'd like to hear
- from you. Best regards.
-
- - Jon Lindsay
- July 18, 1985
-