home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / assemblr / library / sampler0 / me.doc < prev    next >
Text File  |  1989-01-03  |  8KB  |  224 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.                                      ME
  15.                                    My Echo
  16.                                 Version 1.00
  17.                                 (Production)
  18.  
  19.  
  20.                               Mark Plancke, Author
  21.                          Fellow Programmer of The Guild
  22.                                January 3, 1989
  23.  
  24. Version 1.00                       ME - My Echo                         Page 1
  25.  
  26. It has always bothered me that the DOS ECHO command fell short in some areas,
  27. mainly the ability to send escape sequences to the console. This would allow
  28. people who were so inclinded, to enter ANSI escape sequences into thier batch
  29. files, etc.
  30.  
  31. So I wrote this as an my first ASSEMBLER project for the IBM PC. I have
  32. written in a variety of high level languages, such as C, COBOL, FORTRAN and
  33. BASIC, but have never attempted the "down to the bare metal" programming
  34. which ASSEMBLER allows. Seems like a lot of fun, if you have the time and
  35. you need the speed which an assembler can provide.
  36.  
  37. At any rate, this program is designed as a simple replacement for the DOS
  38. ECHO command, with a few added features. There is the ability to echo escape
  39. sequences to the console as well as all the options offered by the DOS PROMPT
  40. command (I figured it was a good starting point).
  41.  
  42. Escape sequences are prefaced by an escape character, which is the '$'. To
  43. echo a message, you simply type the text as you want it to appear. So here
  44. are the escape sequences which may be used:
  45.  
  46.                 Characters              Meaning
  47.  
  48.                    $$                   Print the $ character
  49.                    $T                   Current time
  50.                    $D                   Current date
  51.                    $P                   Current directory
  52.                    $V                   DOS version number
  53.                    $N                   Current drive code
  54.                    $G                   Print the > character
  55.                    $L                   Print the < character
  56.                    $B                   Print the | character
  57.                    $Q                   Print the = character
  58.                    $H                   Print the Back space character
  59.                    $E                   ESCape character
  60.                    $_                   Print a CR/LF character sequence
  61.  
  62.  
  63. Examples:
  64.  
  65.         me $e[2jHello World             ; Clear screen and home cursor and
  66.                                         ; Print Hello World
  67.  
  68.         me $e31;47m$e[1mHello World
  69.  
  70.  
  71. Version 1.00                       ME - My Echo                       Page 2
  72.  
  73.                               REVISION HISTORY
  74.  
  75.  
  76. Oct 12, 1988    Version 0.10    Initial testing pre-release.
  77.  
  78. Oct 13, 1988    Version 0.20    Added help screen when no arguments where
  79.                                 given. Improved error messages.
  80.  
  81. Jan 3, 1989     Version 1.00    Implemented the printing of the following
  82.  
  83.                                 o Current Time
  84.                                 o Current Date
  85.                                 o DOS Version Number
  86.  
  87.  
  88.                             NOTES ON DATE OUTPUT
  89.  
  90. The date can be formatted in three ways, as follows;
  91.  
  92.       1.  MM/DD/YYYY
  93.       2.  MM/DD/YY
  94.       3.  DDD MM/DD/YYYY
  95.  
  96. The format is determined by a variable in the assembler program TM_FMT, set
  97. this to the format number you want and recompile. Valid formats are as above
  98. 1 through 3.
  99.  
  100. The file ME.COM may be modified directly to update this field, the variable
  101. is located at position four (4) in the file. You can use a hex editor or
  102. DEBUG to change this variable to the value you want.
  103.  
  104. To use debug, follow this procedure...
  105.  
  106.         Commands                          Comments - do not type these
  107.  
  108.         DEBUG ME.COM                      ; Start up debugger
  109.  
  110.         -D 100 L4                         ; Dump four bytes 
  111.  
  112.         5691:0100  E9 71 04 03                                  .q..
  113.         -E 103                            ; Enter data at 103
  114.  
  115.         5691:0103  03.01                  ; Enter the new display mode
  116.         -W                                ; Write the file
  117.         Writing 08B3 bytes
  118.         -Q                                ; Exit debugger
  119.  
  120.  
  121. This changes the display mode from 3 to 1.
  122.  
  123.  
  124.                                 ANSI TUTOR
  125.  
  126. Here are some control codes for the ANSI driver, summarized from
  127. the IBM material.
  128.  
  129.  
  130. 1. CURSOR POSITIONING
  131.  
  132.      To move the cursor to a specified position: ESC [#;#h where the first #
  133.      is the desired line number and the second the desire column.
  134.  
  135.      To move the cursor up without changing columns: ESC [#a where # specifies
  136.      the number of lines moved.
  137.  
  138.      To move the cursor to a specified horizontal and vertical position: ESC
  139.      [#;#f where # means first the line number and secondly the column number.
  140.  
  141.      To get a device status report: ESC [6n
  142.  
  143.      To get a cursor position report: ESC [#;#r where the first # specifies
  144.      the current line and the second # specifies the current column
  145.  
  146.      To move the cursor down: ESC [#b where # specifies the number of lines
  147.      moved down.
  148.  
  149.      To move the cursor forward: ESC [#C where # specifies the number of
  150.      columns moved.
  151.  
  152.      To move the cursor backward: ESC [#d where # specifies the number of
  153.      columns moved.
  154.  
  155.      To save the cursor position: ESC [s and to restore it: ESC [u.
  156.  
  157. 2. ERASING
  158.  
  159.      To do a CLS (erase screen move cursor to home position): ESC [2j
  160.  
  161.      To erase from cursor to end of line: ESC [k
  162.  
  163.  
  164. 3. COLOR GRAPHICS
  165.  
  166.      To set the color/graphics attributes, enter ESC [#;#m where the first #
  167.      is the desired foreground color and the second is the desired background
  168.      color.  Select colors from the list below:
  169.  
  170.      30  black foreground
  171.      31  red foreground
  172.      32  green foreground
  173.      33  yellow foreground
  174.      34  blue foreground
  175.      35  magenta foreground
  176.      36  cyan foreground
  177.      37  white foreground
  178.  
  179.      40  black background
  180.      41  red background
  181.      42  green background
  182.      43  yellow background
  183.      44  blue background
  184.      45  magenta background
  185.      46  cyan background
  186.      47  white background
  187.  
  188.      To set additional attributes enter: ESC [#m where # is the number of the
  189.      desired attribute.  Select attributes from the list below:
  190.  
  191.      0  all attributes off (white on black)
  192.      1  bold on
  193.      4  underscore (on IBM Monochrome Display)
  194.      5  blink
  195.      7  reverse video
  196.      8  invisible
  197.  
  198. To give an example of what can be done with these additional codes, a batch
  199. file called MENUOFF.BAT containing only the line:
  200.  
  201.                         PROMPT $e[2J$e[30;40m$h
  202.  
  203. would blank a color display completely.  It does a CLS, sets the display to a
  204. black foreground and background and the with the "$h" performs a backspace to
  205. erase the blinking cursor (the "$h command is documented in the DOS manual
  206. under PROMPT).  Another batch file called MENUON.BAT containing the lines:
  207.  
  208.       PROMPT $e[0m
  209.       prompt
  210.       cls
  211.  
  212. Would reset a color display to restore the screen after MENUOFF.BAT had been
  213. run.
  214.  
  215. Enjoy ANSI!  It is a wonderful tool, and can be a lot of fun to use.  It's not
  216. a keyboard enhancer, and if you load it up with too many keyboard
  217. redefinitions at one time you will run out of environment space.  This is
  218. harmless and simply means that ANSI is full.  But it will work fine to define
  219. your function keys and control your screen.
  220.  
  221.  
  222.  
  223. ME (My Echo) Version 1.00 (Production) January 3, 1989
  224.