home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / compiler / surpas / ibmpc.doc < prev    next >
Text File  |  1987-10-04  |  10KB  |  221 lines

  1.  
  2.  
  3.               SURPAS-86 SUPPLEMENTARY DOCUMENTATION
  4.                  for IBM PC with DOS 1.1 and 2.0
  5.  
  6.                        Copyright (C) 1984
  7.                           Tixaku Pty Ltd        
  8.  
  9.  
  10.  
  11. Since  IBM  DOS provides no escape code sequences to control  the 
  12. display, the IBM DOS version of SURPAS has its own console driver 
  13. installed.  This driver provides an extensive set of escape  code 
  14. sequences  to  select CRT operating modes,  control  the  cursor, 
  15. clear  the screen,  insert and delete lines,  activate/deactivate 
  16. character attributes and select colors.  Furthermore, the console 
  17. driver  will  convert the extended ASCII codes  returned  by  the 
  18. keyboard  to  escape code sequences,  so that function  keys  and 
  19. other special control keys can be read from your programs.
  20.  
  21. Below follows a description of the escape code sequences provided 
  22. by  the SURPAS console driver.  An ASCII escape character (27  or 
  23. 1BH)  triggers escape sequence processing.  The escape  character 
  24. can  be followed by one or more characters depending on the func-
  25. tion required.
  26.  
  27. ESC Y   Position Cursor.  The two characters that follow the  "Y" 
  28.         specify  the row and column to which the cursor is to  be 
  29.         moved. The first character  specifies the row, the second 
  30.         specifies  the column.  Rows range from 0 to  24,  colums 
  31.         range  from  0 to 79 (39 in 40 column  modes).  To  avoid 
  32.         confusing row and column numbers with control characters, 
  33.         row  and  column values have 32 (or 20H) added  to  them. 
  34.         Thus,  to  move the cursor to the home position,  the two 
  35.         characters following the "Y" would be ASCII spaces (20H). 
  36.         The  position cursor function is also  available  through 
  37.         the GOTOXY standard procedure.
  38.  
  39. ESC J   Erases all character positions from the cursor to the end 
  40.         of  the screen.  This function is also available  through 
  41.         the CLREOS string.
  42.  
  43. ESC K   Erases all character positions from the cursor to the end 
  44.         of the line.  This function is also available through the 
  45.         CLREOL string.
  46.  
  47. ESC L   Insert Line. Inserts a blank line by moving the line that 
  48.         the cursor is on, and all following lines, down one line. 
  49.         This  function  is  also  available  through  the  INSLIN 
  50.         string.
  51.  
  52. ESC M   Delete  Line.  Deletes the contents of the line that  the 
  53.         cursor  is on,  moves all the following lines up on line, 
  54.         and adds a blank line at the bottom of the display.  This 
  55.         function is also available through the DELLIN string.
  56.  
  57. ESC P   Enter Reverse Video Mode.  Subsequent characters are dis-
  58.         played  as  black characters on  white  background.  This 
  59.         function is also available through the RVSON string.
  60.  
  61. ESC Q   Exit Reverse Video Mode.  This function is also available 
  62.         through the RVSOFF string.
  63.  
  64. ESC R   Intensify On. Subsequent characters are displayed in high 
  65.         video  intensity.  Note that intensify has no  effect  in 
  66.         reverse video mode.
  67.  
  68. ESC S   Intensify Off.
  69.  
  70. ESC T   Blink On. Subsequent characters are displayed blinking.
  71.  
  72. ESC U   Blink Off.
  73.  
  74. ESC V   Underline On. Subsequent characters are underlined. Since 
  75.         reverse video and underline are incombineable, this func-
  76.         tion will automatically exit reverse video mode.
  77.  
  78. ESC W   Underline Off.
  79.  
  80. ESC X   Cancel All Attributes.  Cancels reverse video, intensify, 
  81.         blink and underline.  Subsequent characters are displayed 
  82.         in white on a black background.
  83.  
  84. ESC a   Set CRT Mode. The CRT mode selects the number of rows and 
  85.         columns on the CRT screen, as well as color or monochrome 
  86.         display.  The  sequence  must be followed by a  character 
  87.         between  ASCII 0 and ASCII 7 which selects a mode  accor-
  88.         ding to the table below:
  89.  
  90.         0 = 40 x 25 Black and White.
  91.         1 = 40 x 25 Color.
  92.         2 = 80 x 25 Black and White.
  93.         3 = 80 x 25 Color.
  94.         4 = 320 x 200 Color Graphics.
  95.         5 = 320 x 200 Monochrome Graphics.
  96.         6 = 640 x 200 Monochrome Graphics.
  97.         7 = 80 x 25 Black and White (Monochrome Display Adapter).
  98.  
  99.         Modes  0-6 require the Color/Graphics Adapter.  Only  the 
  100.         least significant three bits of the mode number are used.
  101.  
  102. ESC b   Set Foreground Color.  The foreground color is the  color 
  103.         of the actual character raster. Associated with the fore-
  104.         ground color is an intensity bit,  which switches between 
  105.         colors  0-7  and  8-15.  Escape-b must be followed  by  a 
  106.         character  between ASCII 0 and ASCII 15 which  selects  a 
  107.         color according to the table below.
  108.  
  109.         0 = Black.               8 = Dark Gray.
  110.         1 = Blue.                9 = Light Blue.
  111.         2 = Green.              10 = Light Green.
  112.         3 = Cyan.               11 = Light Cyan.
  113.         4 = Red.                12 = Light Red.
  114.         5 = Magenta.            13 = Light Magenta.
  115.         6 = Brown.              14 = Yellow.
  116.         7 = Light Gray.         15 = White.
  117.  
  118.         Only  the least significant four bits of the color number 
  119.         are  used.  Note that Escape-R and Escape-S may  also  be 
  120.         used to switch the the foreground intensity,  i.e. switch 
  121.         between colors 0-7 and 8-15.
  122.  
  123. ESC c   Set  Background Color.  The background color is the color 
  124.         "behind" the characters.  Escape-c must be followed by  a 
  125.         character  between ASCII 0 and ASCII 15 which selects the 
  126.         background color according to the table below:
  127.  
  128.         0 = Black.               4 = Red.
  129.         1 = Blue.                5 = Magenta.
  130.         2 = Green.               6 = Brown.
  131.         3 = Cyan.                7 = Light Gray.
  132.  
  133.         If  8 is added to the color value,  the  characters  will 
  134.         blink.  Only the least significant four bits of the color 
  135.         number are used. Note that Escape-T and Escape-U may also 
  136.         be used to switch blink on and off.
  137.  
  138. ESC d   Set Border/Background Color. In alpha modes (CRT modes 0-
  139.         3), this sesequence sets the border color, i.e. the color 
  140.         of  the  border surrounding the actual character  display 
  141.         area.  In  320 x 200 graphics modes (CRT modes  4-5),  it 
  142.         sets the background color. Escape-d must be followed by a 
  143.         character between ASCII 0 and ASCII 15 which selects  the 
  144.         border/background  color.  The color values correspond to 
  145.         those  of the foreground color (see Escape-b).  Only  the 
  146.         least significant four bits of the color number are used.
  147.  
  148. ESC e   Set Color Palette.  This sequence has meaning only in 320 
  149.         x  200 graphics modes (CRT modes 4-5).  Escape-e must  be 
  150.         followed  by  an ASCII 0 or an ASCII  1  character  which 
  151.         selects one of the two available color palettes:
  152.         
  153.         0 = Green(1), Red(2), Yellow(3)
  154.         1 = Cyan(1), Magenta(2), White(3)
  155.  
  156.         Only  the least signigicant bit of the palette number  is 
  157.         used. When operating in 320 x 200 graphics mode, only the 
  158.         least significant two bits of the foreground color are in 
  159.         effect. Color number 0 is the background color and colors 
  160.         1-3 are selected from the palette.
  161.  
  162. ESC f   Set Working Display Page.  This sequence has meaning only 
  163.         in  CRT modes 0-3.  It selects the working display  page, 
  164.         i.e.  the display page to which characters are written. 8 
  165.         display  pages  are available in 40 x 25 alpha mode  (CRT 
  166.         mode  0-1) and 4 display pages are available in 80  x  25 
  167.         alpha mode (CRT mode 2-3). Escape-f must be followed by a 
  168.         character  between ASCII 0 and ASCII 3 or 7 which selects 
  169.         a display page. Only the least significant 3 (40 x 25) or 
  170.         2 (80 x 25) bits of the display number are used.
  171.  
  172. ESC g   Set Active Display Page.  This sequence has meaning  only 
  173.         in  CRT  modes 0-3.  It selects the active display  page, 
  174.         i.e. the display page to be shown on the monitor. Escape-
  175.         g must be followed by a character which selects a display 
  176.         page as described above.
  177.  
  178. When  reading characters from the keyboard,  the  SURPAS  console 
  179. driver will convert extended ASCII codes, i.e. the codes returned 
  180. by function keys and other special keys,  to two character escape 
  181. code sequences.  The first character returned is an ASCII  escape 
  182. character  (27 or 1BH).  The second character is the scan code of 
  183. the key.  For instance, if "Home" is pressed at the keyboard, the 
  184. console  driver will return an ASCII escape (27) followed  by  an 
  185. ASCII "S" (71).  For a complete list of scan codes,  please refer 
  186. to the IBM PC Technical Reference Manual, page 3-14. Alternative-
  187. ly, you may use the following short program to display the exten-
  188. ded ASCII codes of specific keys:
  189.  
  190.     PROGRAM displaycodes;
  191.     VAR
  192.       ch: char;
  193.     BEGIN
  194.       REPEAT
  195.         read(kbd,ch); writeln(ord(ch));
  196.       UNTIL ord(ch)=13;
  197.     END.
  198.  
  199. The  program continuously reads characters from the keyboard  and 
  200. displays  their  ASCII values until you press  RETURN.  When  you 
  201. press a function key or a special key,  the first value displayed 
  202. is 27, the second is the scan code of that specific key.
  203.  
  204. In addition to the standard set of editor commands,  you may also 
  205. use  the  cursor control keypad when you are in the  editor.  The 
  206. following alternate keys are defined:
  207.  
  208.     Standard   Alternate              Standard   Alternate
  209.  
  210.       ^S        Left                    ^D        Right
  211.       ^Q^S      ^Q Left                 ^Q^D      ^Q Right
  212.       ^E        Up                      ^X        Down
  213.       ^Q^E      ^Q Up                   ^Q^X      ^Q Down
  214.       ^R        PgUp                    ^C        PgDn
  215.       ^Q^R      Home                    ^Q^C      End
  216.       DEL       Backsp                  ^Q DEL    ^Q Backsp
  217.       ^V        Ins                     ^G        Del
  218.  
  219. Left,  Right, Up and Down denote the cursor arrows. Backsp is the 
  220. backspace key located above the Return key.
  221.