home *** CD-ROM | disk | FTP | other *** search
/ ftp.update.uu.se / ftp.update.uu.se.2014.03.zip / ftp.update.uu.se / pub / decmate / dmpt1 < prev    next >
Text File  |  1995-05-03  |  11KB  |  200 lines

  1. Subject: Why a DECmate isn't a PDP-8
  2. From : lasner@watsun.cc.columbia.edu (Charles Lasner)
  3. Date: Mon, 1 Mar 1993 18:39:56 GMT
  4.  
  5. This newsgroup is primarily for PDP-8 family stuff, and will therefore support
  6. DECmates as well.  But a DECmate isn't *quite* a PDP-8 as we know it.  Certain
  7. problems thwart the prevailing software from running on it, and instead some
  8. "bastardized" versions have appeared (such as OS/278).  This will be the
  9. first in a series of articles to detail the areas of incompatibilty and
  10. what can be done about them.
  11.  
  12. 1)    CPU issues.
  13.  
  14.     The DECmate is based on the 6120 micro version of the PDP-8.  It is
  15. mostly compatible, and includes the powerful extension of CP memory and
  16. related hardware, dual push-down stacks, etc.  Certain instructions have
  17. minor differences such as the exact definitions of the PDP-8/e-originating
  18. superset instructions GTF and RTF.  The differences are so slight that the
  19. existing software for PDP-8/e interrupt handling will just work, but certain
  20. diagnostic programs will likely fail on these specific points.  There are
  21. differences such as:
  22.  
  23. PDP-8/e RTF does not clear the AC afterwards; 6120 does.  This is even a
  24. useful improvement as there is no software reason not to clear the AC at
  25. that point.  (The AC is being loaded from a temporary to restore the former
  26. status saved during an interrupt.  Then the AC has to be loaded with the
  27. former AC value, thus a CLA after RTF is in all practical 8/e code.  The
  28. RTF performing its own clear thus allows a 6120-only interrupt handler that
  29. is shorter/faster.)
  30.  
  31. PDP-8/e GTF reads back the state of interrupt into bit[4].  PDP-8/e RTF
  32. ignores bit[4] and re-enables the interrupt.  6120 GTF reads back a one into
  33. bit[4].  6120 RTF loads interrupt enable per AC[4].  For normal interrupt
  34. handling for PDP-8/e, this sequence is essentially compatible enough.  Note
  35. that classic PDP-8 interrupt handling is totally compatible on all models,
  36. but that there are PDP-8/e and newer interrupt routines, etc.
  37.  
  38. The use of extended memory instructions on the PDP-8/e is compatible with
  39. former processors, but can be extended via the KT8A or CESI MEC8 extensions.
  40. The 6120 is only compatible with the subset found on the PDP-8/e without
  41. those extensions because other instructions have been assigned to the same
  42. IOTs.  These include new instructions such as GCF (Get Current Fields) which
  43. is essentially the non-interrupt-oriented version of GTF, etc., and a set of
  44. instructions only valid in CP memory to handle that section.  Some of the
  45. instructions are defined for CP memory trap, and others are for manipulating
  46. the built-in dual stack.
  47.  
  48. As long as the program sticks to the compatible subset found in a 32K PDP-8/e,
  49. the instructions are otherwise compatible.
  50.  
  51. 2)    Console issues.
  52.  
  53.     On I/O, the 6120 largely parts company with the PDP-8/e.  The actual
  54. implementation of I/O on the DECmate consists of using packaged interfaces
  55. usually called "pie" chips (or Programmed Interface Elements).  The problem
  56. with these chips is that they are only *almost* compatible with existing
  57. PDP-8 interfaces whereas the prevailing OSes demand *total* compatibility
  58. with the older hardware.  There are several internal interfaces within the
  59. DECmate for particular use of no concern to the OS, and this is not at issue,
  60. such as the internal interface for the keyboard which is actually on an
  61. additional serial port (bidirectionally) or the APU/XPU interface, etc.
  62.  
  63. PDP-8 compatibility demands that the device 03/04 instructions be truly
  64. compatible.  On the 6121 PIE chip, liberties were taken with the design that
  65. cause out-and-out incompatibility such that only trivial programming examples
  66. still work, while the actual usage within the operating system is totally
  67. incompatible.  A breakdown of the console instructions:
  68.  
  69. 6030    Clear the keyboard flag, do not advance the reader if a TTY: is the
  70.     console device, do not clear the AC.  The 6120 version of this is to
  71.     *set* the flag!  (This instruction is not used on earlier models, so
  72.     compatibility issues aren't as bad as it sounds!)
  73.  
  74. 6031    Skip on the keyboard flag.  Notably, the PDP-8 convention is that
  75.     this instruction work *precisely* as stated.  Specifically, 6031
  76.     must skip if the flag is set.  Repeating the instruction must repeat
  77.     the same effect.  On the 6120, 6031 executes as skip on *and clear*
  78.     the flag, thus 6031 when repeated is totally incompatible, because
  79.     the flag won't raise until the data is read.  PDP-8 OS compatibility
  80.     demands that the 6031 repeat facility be present.  Without this,
  81.     various programs, handlers, and all BATCH operations are incompatible.
  82.     OS/278 consists of a bunch of wimpy emasculated versions of cusps that
  83.     either don't work properly, have existing bugs to be fixed, or kludges
  84.     to create the perception of ^C and/or ^S/^Q handling being present
  85.     correctly, but in point of fact, it is 100% deficient in this area.
  86.     When OS/278 is run on an actual PDP-8, it behaves as poorly since it
  87.     can't take advantage of the proper console interface, instead sticking
  88.     to the subset where 6031 cannot skip repeatedly, etc.
  89.  
  90. 6032    Clear the AC, advance reader run if a TTY: console, clear the keyboard
  91.     flag.  On the 6120, 6032 merely clears the AC.  Since 6031 clears the
  92.     flag, they didn't bother to make 6032 accomplish it.  However, 6032 on
  93.     the 6120 will allow the flag to raise for the *next* character since
  94.     the interface is both buffered and simulated.  Due to hardware 
  95.     limitations of the DECmate, it is not possible to re-implement the
  96.     simulated console interface any better than currently provided.  The
  97.     base reason for this is that only the "even" IOT's are trapped and
  98.     emulated while the "odd" IOT's are allowed to be used in hardware.  Had
  99.     the entire interface been trapped, we could emulate the compatible
  100.     version!
  101.  
  102. 6033    NOP  This IOT is essentially reserved for situations where the
  103.     interface baud rate could be programmed, but doesn't apply in the case
  104.     of either the PDP-8 or the DECmate.
  105.  
  106. 6034    Read the latest character, do not disturb the flag.  The data is
  107.     logically ORed into the AC.  This is used to notice that the data
  108.     is a ^C or other character without disturbing the flag, so that other
  109.     software can check it again, after being swapped in.  (It's used in
  110.     conjunction with 6031 which doesn't clear the flag when it skips.)  The
  111.     6120 version of this instruction is to OR into the AC the *previously
  112.     read* character provided by either 6032 or 6036, but it cannot initiate
  113.     a new character by itself.  While it is of marginal utility to be able
  114.     to re-read a previously read character, the inability to read in the
  115.     latest character without disturbing the flag is the crux of the
  116.     compatibility issue.
  117.  
  118. 6035    Load interrupt enable for devices 03/04 per AC[11].  On the 6120 this
  119.     is changed to device 03 only.  The 04 function is handled by 6045.
  120.     Since this is a PDP-8/e instruction, it is not a serious compatibility
  121.     issue except for initialization routines that use interrupts.  However,
  122.     since the keyboard is emulated on the DECmate, interrupt timings may
  123.     prove "choppy" compared to a real PDP-8, and interrupts to the console
  124.     are not recommended.
  125.  
  126. 6036    LOAD the AC with the latest character and clear the flag.  Also enable
  127.     reader run if the console is a TTY:.  Essentially this is the OR of
  128.     6032 and 6034.  The 6120 still ORs together the two operations, but
  129.     the underlying two operations aren't compatible, since the flag is
  130.     unaffected.  However, reading the character will cause the next
  131.     character's flag to raise (when available).  If 6032 or 6036 is not
  132.     executed, then the flag will *never* raise even if the user pounds on
  133.     the keyboard!  (There is an OS/278 ODT bug related to this which is
  134.     fixable per se, but not the ^C handling as described above.)
  135.  
  136. 6037    NOP
  137.  
  138. 6040    Set the output flag.  Actually compatible on 6120!  (And not needed
  139.     for compatibility with earlier machines that didn't have it.)
  140.  
  141. 6041    Skip on output flag.  Like the input flag, the 6120 also clears the
  142.     flag when issuing 6041.  There is less of a compatiblilty issue since
  143.     it is possible to write code that doesn't depend on the second skip,
  144.     as long as you time out the flag in any initialization code.  (P?S/8
  145.     has always done this in the past; OS/8 tends to not overlap the
  146.     console I/O so therefore the skip on flag gets checked after outputting
  147.     not before, so this is good enough for most routines.)
  148.  
  149. 6042    Clear the output flag.  On the 6120 it clears the AC.  Usually the
  150.     AC contents is unimportant during 6042, so not a serious compatibility
  151.     issue, but diagnostics will fail.
  152.  
  153. 6043    NOP
  154.  
  155. 6044    Output the character, do not clear the flag.  Same on 6120, but since
  156.     the output routine is emulated, the flag will immediately be up when
  157.     the program is running after the trap.  On a real PDP-8, the flag
  158.     comes up one character time later after it's actually sent, not
  159.     immediately.  This could affect some interrupt routines.  Again,
  160.     interrupt handling of the console is not recommended on the DECmate, 
  161.     especially on the output side.
  162.  
  163. 6045    On the PDP-8/e, this is skip on input OR output flag raised AND
  164.     interrupt enable in the device.  Useful to cause interrupt polling
  165.     routines that have to favor other devices to have less overhead.  If
  166.     the device actually has the flag raised, then you have to do a few
  167.     extra instructions, but when the interrupt is elsewhere, it lowers
  168.     the latency.  On the 6120, this is replaced with load interrupt
  169.     enable for device 04 only per AC[11].  Since this is an extension
  170.     beyond the basic interface, this is a compatibility issue for
  171.     interrupt-driven PDP-8/e and newer routines only.
  172.  
  173. 6046    Output the character and clear the flag now, causing it to raise
  174.     later.  On the 6120, the instruction is trapped, so the net result
  175.     is to raise the flag when the trap handling is over and execution
  176.     resumes.  Causes interrupt routines to always be entered and no
  177.     background processing to occur during the simulated interrupt
  178.     handling, which is not recommended.  Non-interrupt programming is
  179.     not affected by this aspect of compatibility however.
  180.  
  181. 6047    NOP
  182.  
  183. So, in summary, console handling is severely incompatible with regard to
  184. keyboard handling, and moderately incompatible for screen handling, most
  185. notably in regard to either flag initialization and/or interrupt handling.
  186. Yet, simple-minded examples from Introduction to Programming will more-or-less
  187. work; "live" OS routines cannot work.  I am working on a replacement system
  188. to be known as OS/8 Version 5, which will work within the available subset
  189. and thus will run on all models.  However, existing OS/8 cannot work on the
  190. DECmates, and OS/278 cannot perform many functions found in OS/8.
  191.  
  192. Next time, more info on other compatibility issues.
  193.  
  194. cjl
  195.  
  196.  
  197.  
  198.  
  199.  
  200.