home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / TURBOPAS / TURBOCLR.ZIP / TURBOCLR.MOD
Encoding:
Text File  |  1985-12-28  |  7.9 KB  |  143 lines

  1.     This is a modification/correction to the TURBO PASCAL, Ver 2.00B, color
  2. patch provided by P.C. in Texas.  In attempting to run P.C.'s patch, I found
  3. some operational problems.
  4.  
  5.     Specifically, the colors were fine while I was in the Editor.  However,
  6. running the program, caused the screen to revert to Borland's default colors.
  7. In addition, I prefer that the background AND the border be the same color, or
  8. that I have, at least, control of the border color value.
  9.  
  10.     After some research, I arrived at the following patch which just fits the
  11. available 32 bytes (20 Hex).  I have tried it and it seems to work, but NO
  12. guarantees.  For instance, I don't know why P.C. set the AX register to 000E.
  13. I didn't have room for the 3 bytes, so I set the AL register to 0F (same as
  14. the original exit value) and assumed that AH would be OK since we didn't
  15. change its value.  I, also, don't know why its necessary to set BX to 5007.
  16. The preceding code sets BH = 50 under 4 of 5 conditions (the 5th condition
  17. leaves BH = 28).  P.C.'s original routine doesn't conform but seems to work.
  18. I elected to exit the routine with the registers essentially unchanged from
  19. Borland's original.  Therefore, I left BH alone and set BL to 07.
  20.  
  21.     *****   *****   *****   *****   *****   *****   *****   *****   *****
  22.  
  23. NOTE: To get proper operation while running a program, it is advisable to
  24.       insert a "ClrScr;" ahead of the first occurrence of a "Write" or
  25.       "Writeln".  This will insure that the entire screen is a uniform color.
  26.  
  27. NOTE: TURBO PASCAL is copywrited by and a trademark of Borland International.
  28.  
  29.     *****   *****   *****   *****   *****   *****   *****   *****   *****
  30.  
  31.     The following text is an exact duplicate (sans comments) of what appeared
  32. on my IBM PC screen as I was checking the code and assembling the patch.
  33. After your entering of the initial offset (U30D or A30D), the segment address
  34. and offsets are provided by the DEBUG program.  The rest you'll have to type
  35. in.  Read your DOS manual on the usage of DEBUG.  Entering the segment address
  36. isn't necessary unless you wish to change it for some reason.
  37.  
  38.     If the code displayed after you type "U30D L20" is NOT as shown, you'll
  39. have to try and find it.  It should be fairly close by (within 30 bytes or so).
  40.  
  41.  
  42. ** Screen Display **                                    ** {Comments} **
  43. --------------------------------------------------     ------------------------
  44.  
  45. A>DEBUG                                                {Run DEBUG.COM}
  46. -N TURBO.COM                                           {Enter filename.ext}
  47. -L                                                     {Load file}
  48. -U30D L20                                              {Unassemble starting at}
  49. 0905:030D 803E5401FF    CMP     BYTE PTR [0154],FF     {DS:030D for &H20 bytes}
  50. 0905:0312 7406          JZ      031A
  51. 0905:0314 B0FF          MOV     AL,FF
  52. 0905:0316 B3F7          MOV     BL,F7
  53. 0905:0318 B10F          MOV     CL,0F
  54. 0905:031A 22C1          AND     AL,CL
  55. 0905:031C A25101        MOV     [0151],AL              {Text color/background}
  56. 0905:031F A25501        MOV     [0155],AL              {Run color/background}
  57. 0905:0322 22D9          AND     BL,CL
  58. 0905:0324 881E5201      MOV     [0152],BL              {Prompt color/bkgnd}
  59. 0905:0328 880E5301      MOV     [0153],CL              {Cursor color/bkgnd}
  60. 0905:032C C3            RET
  61. -N TURBOWHT.COM                                        {New filename}
  62. -A30D                                                  {Assemble at DS:030D}
  63. 0905:030D PUSH DX                                      {Save DX register}
  64. 0905:030E MOV AL,07                                    {Load White border}
  65. 0905:0310 MOV DX,03D9                                  {6845 mode register}
  66. 0905:0313 OUT DX,AL                                    {Output the byte}
  67. 0905:0314 MOV AL,70                                    {White w/Black char.}
  68. 0905:0316 MOV [0151],AL                                {Save as main text}
  69. 0905:0319 MOV [0155],AL                                {And as Run text}
  70. 0905:031C MOV AL,75                                    {White w/Magenta char.}
  71. 0905:031E MOV [0152],AL                                {Save as Prompt char.}
  72. 0905:0321 MOV AL,76                                    {White w/Brown char.}
  73. 0905:0323 MOV [0153],AL                                {Save as cursor char.}
  74. 0905:0326 MOV AL,0F                                    {Original exit value}
  75. 0905:0328 MOV BL,07                                    {Original exit value}
  76. 0905:032A NOP                                          {Need one more Byte}
  77. 0905:032B POP DX                                       {Restore DX register}
  78. 0905:032C RET                                          {End of subroutine}
  79. 0905:032D^C                                            {Ctrl-Break to end the}
  80.                                                        {assembly process}
  81. -W                                                     {Write the new file}
  82. Writing 8E80 bytes                                     {Debug message}
  83. -Q                                                     {Quit Debug}
  84.  
  85. A>                                                     {DOS prompt}
  86.  
  87.  
  88.     The modification listed above, provides a White background and border,
  89. Black characters, a Magenta Prompt and a Brown cursor.  This combination looks
  90. oddball (inverse characters) with a monochrome card but is entirely readable.
  91.  
  92.     The following alternate color scheme is good also.  It looks very good
  93. with a monochrome card:
  94.  
  95. 0905:030E MOV AL,01                                    {Load Blue border}
  96. 0905:0314 MOV AL,17                                    {Blue w/White char.}
  97. 0905:031C MOV AL,1E                                    {Blue w/Yellow char.}
  98. 0905:0321 MOV AL,13                                    {Blue w/Cyan char.}
  99.  
  100.     Note: Changing the 1's, above, to 3's will give a Cyan instead of blue.
  101.  
  102.     The best color combination is a personal choice.  The key to the colors
  103. is as follows:
  104.             1.  Let BO = BOrder Nibble (4 bits = one Hex digit)
  105.             2.  Let BA = BAckground Nibble
  106.             3.  Let  F = Foreground Nibble
  107.             4.  Let  I = Intensity bit
  108.             5.  Let  R = Red bit.
  109.             6.  Let  G = Green bit.
  110.             7.  Let  B = Blue bit.
  111.             8.  Let BL = set character BLink bit.
  112.  
  113.             9.  To set the border color, BO = I R G B.
  114.                 (e.g. intense red = 1 1 0 0 = C in hex )
  115.                 (     cyan        = 0 0 1 1 = 3 in hex )
  116.             10. To set the background color, BA = BL R G B.
  117.                 (e.g. a blue background = 0 0 0 1      )
  118.                 (     a white background = 0 1 1 1     )
  119.             11. To set the foreground (text) character, F = I R G B.
  120.                 ( same format as the border nibble     )
  121.             12. Using the patch shown, the border byte at :030F is 0 BO.
  122.                 (example: for intense red it is 0C, cyan is 03, etc.)
  123.             13. For the characters, the background comes first, then the
  124.                 foreground (BA F).
  125.                 (e.g. a blue background with a red character is 14)
  126.                 (     or    0 0 0 1  0 1 0 0                      )
  127.             14. If the border and background are the same, then BA = BO.
  128.  
  129. I hope the above description isn't too confusing.  - CTW.
  130.  
  131.     Be sure and save your different versions under different names.  For
  132. example, I used: TURBOWHT.COM, TURBOBLU.COM and TURBOCYN.COM as alternate
  133. names for three different versions.  That way I can choose the one I wish
  134. to use.  By doing this, I also preserved the origional version of TURBO in
  135. case something gets screwed up.
  136.  
  137.              *****  ALWAYS do your work on a BACKUP disk. *****
  138. ** NEVER mess around with the origional since a mistake can wipe you out! **
  139.  
  140.                                         --- Have fun,
  141.                                             C.T.Wiebe - San Jose, CA.
  142.                                             11/19/84, Revised 2/10/85
  143.