home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / TOP / USR / MAN / dc.prf < prev    next >
Text File  |  2009-11-06  |  6KB  |  224 lines

  1. .fill
  2. .justify
  3. .offset 5
  4. .rightmargin 70
  5. .pagesize 72
  6. .m1 3
  7. .m2 2
  8. .m3 2
  9. .m4 5
  10. .ec \
  11. .header /Dc/Utility/Dc
  12. .footer /Page #//Printed (%)/
  13. .in +5
  14. .define topic
  15. .bold
  16. .in -5
  17. $1 $2 $3 $4 $5
  18. .in +5
  19. .en
  20. .define endtopic
  21.  
  22. .en
  23. .define noform
  24. .nojustify
  25. .nofill
  26. .en
  27. .define noformend
  28. .justify
  29. .fill
  30. .en
  31. .! Manual created with MWB
  32. .! END-OF-MACRO
  33. .topic NAME
  34. Dc - Desk Calculator for integer aritmetic
  35. .endtopic
  36. .topic SYNOPSIS
  37. .noform
  38. dc [-b=<h,d,o,b>]
  39. .noformend
  40. .endtopic
  41. .topic DESCRIPTION
  42. .bold
  43. Dc
  44. offers a desk calculator for integer aritmetic. It is written as a tool
  45. for a programmer who doesn't have enough place for a "regular" desk
  46. calculator (it is written for me). The design of the keypad is like the
  47. one of an Atari ST(tm) but you can use it with every other keyboard,
  48. too. The only option in the commandline which is possible is
  49. .ul
  50. -b=<base>
  51. where <base> is `h` for hexadecimal, `d` for decimal, `o` for octal and
  52. `b` for binary. After startung the screen displays a calculator with
  53. displayline (top-right), errormessage area (top-left), five memory slots
  54. are displayed on the left side of the panel, on the right side you can
  55. find the digits and functions.
  56.  
  57.     In the display the current value is displayed in the actual
  58. base, the memory entries are always displayed in the base of decimal.
  59.  
  60.     To type in a number, simply hit the right digit keys on yout
  61. keyboard. For hexadecimal input use the
  62. .ul
  63. lowercse
  64. letters a-f. If the base doesn't allow a digit to be typed (e.g. 9 in
  65. octal base) a bell rings and an errormessage will be displayed. If you
  66. want to type in the value of an ASCII charcter you can type
  67. .bold
  68. '
  69. followed by the character you wish to get the value of.
  70.  
  71.     After typing the number you will choose an operator. You can
  72. type them in as displayed on the screen. Operators available:
  73. .in +5
  74. .nf
  75. .nj
  76. +   addition
  77. -   subtraction
  78. *   multiplication
  79. /   divison
  80. %   modulo
  81. &   binary and
  82. |   binary or
  83. ^   binary xor
  84. ~   unary binary not (2-complement)
  85. !   unary negate (1-complement)
  86. <   shift left
  87. >   shift right
  88. =   equivalance
  89.  
  90.     The priority is like this:
  91. High
  92.         ~, !
  93.     <, >
  94.         *, /, %
  95.         +, -
  96.         &
  97.         ^
  98.         |
  99.         =
  100. Low
  101. .fill
  102. .justify
  103. .in -5
  104.  
  105.     To change the current base, type
  106. .ul
  107. CAPITAL
  108. letter H, D, O or B. The actual base will be displayed highlighted. The
  109. CLS button once will clear the current input, twice will clear all
  110. brackets and the internal stack. The dot `.` isn't yet in use.
  111.  
  112.     To access one of the five memory slots you have to type in `P`,
  113. `G` or `F` followed by the number of the slot. `P` (put) puts the
  114. current displayed value in the given slot. If you type CR instead of a
  115. number the value will be put in the next free slot (a slot is free if
  116. its value is zero). `G` (get) fetches the value of the given slot and
  117. makes it to the actual value (which is displayed in the display). When
  118. typeing CR instead of a number the value of the `highest` slot will be
  119. taken. `F` (free) clears a given slot. If you type `a` (all) instead of
  120. the number, all slots are cleared. `S` (swap) will swap the current
  121. value in the display and the selceted slot. If you type CR instead of a
  122. number, them the highst non-zero slot will be taken. The five slots have
  123. been named through from `V` to `Z`. To access them directly for get and
  124. put operations you simply type in the name. In lowercase it is like the
  125. get operation, in uppercase it's like put.
  126.  
  127.     One "special" feature of `dc`. If you redirect the
  128. .ul
  129. stdout
  130. path then the output of the calculator will be written on
  131. .ul
  132. stderr
  133. and only a displayed value may be outputed to the stdout path in
  134. all four bases by pressing `.`. This is useful in using dc from an
  135. editor like the uEmacs. For the uEmacs you can add these lines in 
  136. your configuration file:
  137. .in +5
  138. .nf
  139. .nj
  140. 11    store-macro
  141.     execute-program dc
  142. !endm
  143. bind-to-key execute-macro-11    FNT
  144.  
  145. 12    store-macro
  146.     pipe-command dc
  147. !endm
  148. bind-to-key execute-macro-12    FNU
  149. .fill
  150. .justify
  151. .in -5
  152.  
  153.     The bind-to-key key is just an example (on my system this will be
  154. SHIFT-F1 and SHIFT-F2). SO I can call the dc with SHIFT-F1 for normal
  155. use and with SHIFT-F2 the results will be piped in a second window so I
  156. can see them even `dc` has gone.
  157.  
  158.     To leave `dc` just type `Q` or ESC.
  159. .endtopic
  160. .topic OS9/68000
  161. On OS9 you have the additional feature of a simulation of a basic poket
  162. computer. For this you press `\$` and you get then the Basic display. To
  163. return to DC, simply type
  164. .ul
  165. ESC
  166. oder type in
  167. .ul
  168. bye
  169. to leave the interpreter.
  170. .endtopic
  171. .topic ATARI ST
  172. If you use `dc` with the Atari ST(tm) then you can also use the keys
  173. .ul
  174. Undo
  175. for quiting and
  176. .ul
  177. Clr/Home
  178. for clearing the display.
  179. .endtopic
  180. .topic CAVEATS
  181. The calculator only works with 32 bit so you can't calculate with larger
  182. values. The errorhandling may have some problems.
  183. .endtopic
  184. .topic ENVIROMENT
  185. .noform
  186. TERM
  187. .in +5
  188. The terminaltype for the user.
  189. .in -5
  190. DCGRAPHIC
  191. .in +5
  192. .fill
  193. .justify
  194. All buttons etc. are surrounded by special graphic characters. These are
  195. offered running OS9 on an AtariST(tm) using the implementation
  196. distributed by Cumana(tm). If oyur System doesn't support these graphics
  197. you can change them using this enviroment varaibale. You have to set it
  198. to an at least six charcter long value in the order:
  199. .nf
  200. .nj
  201. .in +5
  202. - Top left corner
  203. - Top right corner
  204. - Bottom left corner
  205. - Bottom right corner
  206. - Vertical bar
  207. - Horizontal bar
  208. .in -10
  209.  
  210. .noformend
  211. .endtopic
  212. .topic EXAMPLES
  213. .noform
  214. \$ setenv TERM h19
  215. \$ setenv DCGRAPHIC ++++|-
  216. \$ dc
  217. .noformend
  218. .endtopic
  219. .topic SEE ALSO
  220. .noform
  221. On OS9 Systems, see also the documentation of Microware Basic.
  222. .noformend
  223. .endtopic
  224.