home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / cpm / misc / mouse.lbr / ASCII.MZE / ASCII.MSE
Encoding:
Text File  |  1988-07-12  |  1.6 KB  |  73 lines

  1.  
  2. 125 N:    18 P:    #S,1;    
  3.  
  4. "!Print ASCII table, 02/03/88, Lee Bradley!!" 
  5.  
  6. 32 s: 128 e: 2 M:
  7.  
  8. "First ASCII character = SPACE!"
  9. "Last ASCII character = DEL!"
  10. "Number of columns = 2!!"
  11. "Defaults OK (Y/N) ? "  ?' r:
  12.  
  13. r. 'n = r. 'N = + [
  14.  
  15. "!!Enter the decimal value of the first ASCII character to print."
  16. "!(32 = SPACE) ? " ? s:
  17. "!!Now enter the decimal value of last ASCII character to print."
  18. "!(127 = DEL) ? " ? 1 + e:
  19. "!!Enter 4 or 5 for the next question only if you've hit"
  20. "!CTRL-P and want hardcopy on an Epson."
  21. "!How many columns do you want (1..5) ? " ? M:
  22. "!"  ]
  23.  
  24. #S,1;    
  25. M. 3 - ['O '@ - 'L '@ - !' !'] 
  26. #D;    
  27. 0 l: s. c:    
  28.  
  29. ~ Main loop
  30.  
  31. (
  32. e. c. - ^                    ~ While not done 
  33. c. ! 9 !'  #H,c.;  9 !' c. !' "    |" 9 !'    ~ Print dec., hex., char.
  34. c. 1 + c:                     ~ Bump char., and when  
  35. 1 c. s. - M. \ -[#C,l;]                ~ appropriate, print new line
  36. )
  37.  
  38. ~ Macros follow
  39.  
  40. $H   ~ Convert decimal to hexadecimal
  41. 1% w:
  42. w. 16 / 9 > [w. 16 / 10 - 'A + !']
  43. 10 w. 16 / > [w. 16 / '0 + !']
  44. w. 16 \ 9 > [w. 16 \ 10 - 'A + !']
  45. 10 w. 16 \ > [w. 16 \ '0 + !']
  46. @
  47.  
  48. $S  ~ Pause
  49. N. 1% * w: ( w. 1 - w: w. ^ )
  50. @
  51.  
  52. $C ~ Count lines, do heading 
  53. "!"
  54. 1%. 1 + 1%:
  55. P. 1%. = ["! "  "->"  " " 0 1%: ?' 0 * 32 + 8 !' !'  #D;]
  56. @
  57.  
  58. $D ~ Heading 
  59. #Z;
  60. M. w: (w. 1 - w: w. ^ "             ")"   ASCII Table !"
  61. M. 23 * w: ( "-" w. 1 - w: w. ^) "!"
  62. M. w: ( "Dec" 9 !' "Hex" 9 !' "Chr  |" 9 !' w. 1 - w: w. ^) "!"
  63. M. 23 * w: ( "-" w. 1 - w: w. ^) "!"
  64. @
  65.  
  66. $Z ~ Universal clear screen
  67. 24 w:
  68. (w. ^
  69. 'J 64 - !'
  70. w. 1 - w:
  71. )
  72. @
  73.