home *** CD-ROM | disk | FTP | other *** search
/ Big Blue Disk 16 / bbd16.zip / BITS&PCS.TXT < prev    next >
Text File  |  1987-11-20  |  7KB  |  108 lines

  1. |D╔══════════════════╗════════════════════════════════════════════════════════════
  2. |D║ |5The Happy Hacker |D║════════════════════════════════════════════════════════════
  3. |D╚══════════════════╝════════════════════════════════════════════════════════════
  4.  
  5. ^C^1Bits 'N PC's
  6. ^Cby
  7. ^CGeorge Leritte
  8.  
  9.    To be compatible or not to be compatible, that is the question.  In the IBM
  10. PC world, everyone and their brother is selling IBM compatible computers and
  11. equipment.  From Tandy and their line of computers to the machines made
  12. overseas, they are all touting their machines as compatible, or worse, clones.
  13. From a programmer's viewpoint, it is a nightmare.  This will be a short and, I
  14. hope, enlightening discussion on compatibility of the IBM machines.
  15.  
  16.    First, let me say that most of the "compatibles" really are compatible.  The
  17. heart of an IBM machine is the ROM-BIOS (Read Only Memory-Basic Input Output
  18. Services).  These are a set of routines that high level languages call to
  19. perform various things like printing to the screen, control disk drives, and
  20. reading and writing to files.  A compatible must have these routines, but,
  21. because of copyright laws, they cannot be identical to IBM's routines.
  22. Compatible makers had to make changes in their routines.  Some of these changes
  23. are improvements and some contain bugs or do not operate in exactly the same
  24. manner as IBM's ROM-BIOS, so that differences in operation do occur, especially
  25. when software makes use of a hardware specific function like our screen bounce.
  26. Another example of this is the timer function.  DOS has a function that returns
  27. the number of seconds since midnight.  The original IBM and most compatibles
  28. return a decimal number from this function.  A few machines, however, return
  29. integers for this interrupt.  A program that needs an exact timing function will
  30. malfunction if it is expecting fractional seconds and gets whole seconds.  These
  31. functions or calls may work exactly like they are supposed to on a compatible or
  32. clone, but only if the hardware works exactly like IBM's.  Buyers generally get
  33. upset at the programmers who write such software because their machines are
  34. "compatible" and the programs do not work as advertised.  But it is really the
  35. manufacturer's fault for not detailing the incompatibilities of their machines.
  36.  
  37.    IBM made changes in their ROM-BIOS for their PC-jr, so that software written
  38. to take advantage of the jr's video capabilities will not run on other machines.
  39. IBM also decided to place the jr's screen memory in RAM, I suppose to save on
  40. hardware costs (no video board).  But this means that every jr actually has at
  41. least 16K less usable memory than they claim and is about 1/3 slower than a
  42. standard PC.  A 256 Kilobyte PC jr has a maximum of 240K of memory to load DOS
  43. and run programs.  Alternate video modes of the jr take up even more memory.
  44. The first Tandy 1000 is PCjr compatible, not a PC compatible, so you have the
  45. same problems you would get if you had bought a jr.  There are also significant
  46. differences in the way a standard PC and the jr process keyboard input.  These
  47. could cause program crashes if the programmer bypasses the normal DOS keyboard
  48. interrupts.
  49.  
  50.    From the discussion of ROM-BIOS and the jr, you can see that compatibility is
  51. a relative word.  Add in the various versions of DOS and the problems multiply.
  52. The BIOS interrupts in each version of DOS are placed in different locations but
  53. the interrupt table at the bottom of memory references all of these interrupts
  54. properly.  If a programmer uses standard DOS calls in his programs, there should
  55. be no problem when it is run.  However, if a programmer directly changes a BIOS
  56. interrupt when his program is loaded, and then changes it back according to his
  57. DOS version when exiting, the program will probably crash when it is run on
  58. different versions of DOS.  A prime example of this is PC-RR, a public domain
  59. model railroad simulation.  Some programs peek at the ROM-BIOS and expect to see
  60. certain things there, usually IBM's signature bytes defining the type of
  61. machine.  If these bytes are not in place, the program usually crashes or
  62. displays an error message.
  63.  
  64.    When you consider the enormous variety of video boards, the problems increase
  65. exponentially.  The monochrome display adapter (MDA) is placed at one spot in
  66. memory and the color graphics adapter (CGA) is placed in another, and they
  67. require different monitors.  You can't do graphics on the first, and doing
  68. direct screen writes requires checking which is present (and active, if you have
  69. both).  The AT&T 6300 has a graphics card that runs on a monochrome monitor.
  70. This card simulates the CGA colors with different intensities.  However, blue
  71. and white are the same intensity, as are red and black.  Then Hercules came out
  72. with their monochrome graphics adapter (HGA), but few programs were written to
  73. take advantage of it, and because the resolution is different from the CGA,
  74. graphics programs would not run on HGA's.  Next came boards like the ATI
  75. Graphics Solution board, which allows more colors with the same resolution as
  76. the CGA.  Programs written for these boards either don't run properly on CGAs or
  77. don't run at all.  Then IBM developed their Enhanced Graphics Adapter (EGA). The
  78. EGA allows quadruple the resolution with even more colors.  However, programs
  79. written to take advantage of the EGA's resolution will run on nothing but
  80. machines with an EGA.  Then other manufacturers jumped on the EGA bandwagon and
  81. developed their own boards and all of these boards operate differently.  For
  82. example, the Genoa Spectrum EGA places its video routines at one spot in memory
  83. and changes the normal video interrupt to point directly to itself.  The Digicom
  84. and Vega EGA cards change the video interrupt to point to a memory resident
  85. routine, which then points to its video routines elsewhere in memory.  Now, with
  86. their new machines, IBM is using the VGA, an entirely different method of video
  87. display.
  88.  
  89.    A programmer with a low budget is doomed from the start.  He cannot afford
  90. the multitude of boards and equipment it takes to properly evaluate his software
  91. on all of these machines and video boards.  For example, just detecting an EGA
  92. is difficult, since each installs itself differently.  There are software
  93. routines that a programmer can purchase that detect these boards with relative
  94. accuracy, but as new boards hit the market, the routines become unreliable.
  95. So a programmer is forced to make compromises, and it usually is something like
  96. using only CGA modes in his graphics work.
  97.  
  98.    In an aside, there are two shareware programs available that bring CGA
  99. graphics to the Hercules monochrome computers.  They are SIMCGA and HGCIBM.
  100. They are memory resident programs that translate most CGA graphics calls to HGA
  101. graphics.  I have run both programs and they work fine on my HGA here at work,
  102. and caused problems only when I switched back to my CGA.  They can be found on
  103. our SoftFido BBS if you cannot get them anywhere else.  The phone number is 318-
  104. 222-3503.
  105.  
  106.    After bending your ear (eyes) for all this, I think we'll skip the
  107. "compatible printer" portion and say so long for now.
  108.