home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpm / math / base.lbr / BASE.DQC / BASE.DOC
Encoding:
Text File  |  1985-12-14  |  4.4 KB  |  108 lines

  1.                 BASE.DOC
  2.                 --------
  3.  
  4. Adapted for CP/M-80 by:
  5.  
  6.      Jon Lindsay
  7.      150 N. Jackson Avenue, Suite 108
  8.      San Jose, CA 95116
  9.      Tel. (408) 272-4800 (weekdays)
  10.  
  11. Program name: BASE.COM
  12.  
  13. Program function: Display values in the following formats:
  14.  
  15.       - Decimal
  16.       - Hexadecimal
  17.       - Octal
  18.       - Split-octal
  19.       - Binary
  20.       - ASCII
  21.  
  22. Usage: 1) Select the desired base.
  23.        2) Enter the desired value and enter carriage return
  24.  
  25. History of the program:
  26.  
  27.      This base conversion program was adapted from Willard Nico's
  28. ALLBASE  program  from    his  work  entitled:  8080/8085  Assembly
  29. Language Programming (Heath Co.,  Benton Harbor, MI). The program
  30. allows entry in any one of 6 bases and the output is converted to
  31. all 6 base  formats.  For more    information  about  operating the
  32. program, type ?.
  33.  
  34. About the bases:
  35.  
  36.      DECIMAL (Base 10):  The greatest number of digits allowed is
  37. 5.  If    you enter more than 5 digits (ranging in value from 0  to
  38. 9), the answer will be wrong. Maximum value = 65535.
  39.  
  40.      HEXADECIMAL   (Base   16):    Maximum   number   of   usable
  41. digits/letters    (ranging from 0 - 9 and A - F) is 4.  However, if
  42. more than 4 are entered the LAST 4 digits are used.  For example,
  43. entering FFFFD will produce  conversions for FFFD.  Maximum value
  44. is FFFF.
  45. FFFF.
  46.  
  47.      OCTAL (Base 8):  Still used, octal appears to be losing some
  48. of its popularity.  Maximum number of usable digits (ranging from
  49. 0 to 7) is 6. Maximum value = 177777.
  50.  
  51.      SPLIT-OCTAL (Base 8): An archaic form, it is often easier to
  52. use than OCTAL since the contents of each byte value are display-
  53. ed separately.    Note  that the 2 bytes    (if  2    entered)  must be
  54. separated by a slash '(/'.  Maximum value = 377/377.
  55.  
  56.      BINARY  (Base  2):  A  16-bit  value  (2  bytes)  is  always
  57. considered.   The  output  is  displayed  in  four  4-bit  groups
  58. (nibbles) to make reading easier.  Example:  1111 1111 1111 0001.
  59. Note  that  you will be able to enter a BINARY value in the  same
  60. form. That is, you can optionally insert spaces between digits or
  61. groups of digits.  The legal digits are 0 and 1.  Maximum value =
  62. 1111 1111 1111 1111.
  63.  
  64.      Examples of entry: 0001 1000 1111 0001
  65.             1100011110001
  66.             11011
  67.  
  68.      CAUTION: Note that your BINARY input string has a field that
  69. is right-justified.  That is,  all your input is aligned from the
  70. right side. To show you what this means, if you enter 111111, the
  71. BINARY    output will appear as 0000 0000 0011 1111.  If you  enter
  72. 1111 11 (thinking you are entering F3H),  this will be parsed  as
  73. 11 1111,  the  same as above.  It's your option whether  to  use
  74. separating spaces between nibbles --- the spaces are discarded in
  75. any case. Just beware that if you do want to enter the byte value
  76. of,  say,  F3  (hex) in BINARY,  be sure to  include  significant
  77. zeroes: e.g., 1111 0011 (F3H).
  78.  
  79.      ASCII:  This "base" is included in the conversion because of
  80. the  frequent  access  to  this format.  An  ASCII  character  is
  81. contained  within 1 byte.  Values extend from 0 to 255.  Since    2
  82. bytes  are considered with each entry,    you'll be able to enter 2
  83. ASCII  values  at a time.  Besides the    usual  "printable"  ASCII
  84. characters,  you'll be able to display the graphic characters and
  85. non-printing  values  as well.    For example,  in the ASCII  mode,
  86. enter  control-C  and hit carriage return.  The value 3  will  be
  87. converted  to  all  bases.  Values above  127  may  have  graphic
  88. significance  for your computer.  Though you probably can't enter
  89. values    greater  than 127 from your keyboard,  it's  possible  to
  90. examine  values  above    127  by using one  of  the  other  bases,
  91. typically  HEXADECIMAL,  for  entering values and  observing  the
  92. ASCII output.
  93.  
  94.      This program is configured for a Kaypro 2X. Because I was in
  95. a rush to get it going,  I didn't comment the program very  well.
  96. Nor is the code very elegant.  Just a kludge job. But the general
  97. stuff  is  there  for the probing  mind.  The  program    has  some
  98. important information within. It contains the conversion routines
  99. (ASCII    to  Base/  Base to ASCII) for a number of  popular  bases
  100. which may be used in other situations.
  101.  
  102.      If  anyone has any questions or comments,    I'd like to  hear
  103. from you. Best regards.
  104.  
  105.                     - Jon Lindsay
  106.                       July 18, 1985
  107.  
  108.