home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / sigm / vol115 / pseudo.doc < prev    next >
Encoding:
Text File  |  1985-02-10  |  8.0 KB  |  263 lines

  1.  
  2.  
  3.  
  4.                -- THE ART OF THE PSEUDO RUN --
  5.                         Ron Winter     3/13/83
  6.              I⌠á i≤á possiblσ t∩ singlσ ste≡ ßá z8░á s-10░ ì
  7.         systeφá iεá softwarσ withou⌠ decodinτá thσá `nextº ì
  8.         instruction. All that is required is a 74ls74.
  9.              Thσá z8░ ª ╔ assumσ thσ 8080¼á 808╡ allo≈ onσ ì
  10.         instructioεá afte≥á aεá E╔ t∩á occu≥á eveεá iµá aε ì
  11.         interrup⌠á i≤ pending«á Thi≤ i≤ t∩ allo≈ aε RE╘ iε ì
  12.         aεá interrup⌠á handle≥ so tha⌠ ßá stacδá runawa∙ ì
  13.         doesn't occur under a barrage of interrupts.
  14.              Le⌠á u≤ finΣ aε instructioε t∩ placσá betweeε ì
  15.         thσ E╔ anΣ RE╘ tha⌠ wil∞ generatσ aε interrup⌠ tw∩ ì
  16.         instruction≤á late≥ tha⌠ preserve≤á al∞á register≤ ì
  17.         fo≥ ou≥ interrup⌠ handler«á Conside≥ thσ followinτ ì
  18.         circuit.
  19.  
  20.          ________________________________________________
  21.         |                                                |
  22.         |                              pu  enable-p      |
  23.         |                            10|     |           |
  24.         |                           ___o___  |  __       |
  25.         |           _________    12|   S   |9|-|  \      | 
  26.         |         4|         |  pu-|D     Q|---+   |o-   |
  27.         |       ___o___      |     | 1/2   |   |__/  |   |
  28.         |     2|   S   |5    |   11| ls74 _|8        o   |       
  29.         |     _|D     Q|-----------|> (b) Q|o-nc    / \  |
  30.         | _  | |  1/2  |     |     |   R   |       o   o |
  31.         | M1 |3| ls74 _|6    |     |___o___|       |   | |
  32.         | ==>--|> (a) Q|o_   |       13|          VIn NMI|
  33.         | 44 | |   R   |  |  |_________|                 |
  34.         |    | |___o___|  |            |                 |
  35.         |    |    1|pu    |            |                 |
  36.         |    |____________|            ^                 |
  37.         |                             arm-n              |
  38.         |                          [OUT (XX),A]          |
  39.         |------------------------------------------------|
  40.  
  41.              WitΦá thσ aiΣ oµ an∙ por⌠ (XX⌐ tha⌠á onσá caε ì
  42.         safel∙ writσ t∩ anΣ ge⌠ ß lo≈ goinτ pulsσá iε theì
  43.         `write' window, we have the follwing sequence.
  44.  
  45.         1«á witΦá n∩á interrup⌠ pendinτ iεá ou≥á interrup⌠ ì
  46.             handler we do an EI.
  47.  
  48.         2«á wσá nex⌠ d∩ OU╘ (XX),┴ anΣ Qß goe≤á high¼á QΓ ì
  49.             goes low.
  50.  
  51.         3«á wσ d∩ aε RE╘ anΣ oε thσ trailinτ edgσ oµá M1¼ ì
  52.             Qa goes low, Qb no change.
  53.  
  54.         4«á Nex⌠ pπ begin≤ anΣ oε it≤ M▒ enΣ Qß goe≤ higΦ ì
  55.             clocking Qb to high causing an interrupt.
  56.  
  57.             Thi≤á leave≤ thσ wonderfu∞ dilemnß oµ wha⌠ t∩ ì
  58.         do with it!è
  59.  
  60.                                         1
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.              
  71.              Le⌠á mσ describσ wha⌠ ╔ do«á ┴ smal∞á prograφ ì
  72.         sets up the system as follows.
  73.  
  74.         1«á   LoaΣ ß jum≡ vecto≥ t∩ ß safσ placσ iε (high⌐ ì
  75.         memor∙ a⌠ rst╢ (30hex⌐ anΣ wirσ outpu⌠ oµá circui⌠ ì
  76.         t∩á VI╢á (S-10░ piε 10)«á Notσ circui⌠á shoulΣá bσ ì
  77.         disabled at this time.
  78.  
  79.         2«á   A⌠ thσ vector¼ writσ aε interrup⌠ handle≥ t∩ ì
  80.         do whatever you please!
  81.  
  82.         3«á   Displa∙á somethinτ oε thσ screeε t∩á signif∙ ì
  83.         tha⌠ thσ circui⌠ i≤ availablσ anΣ exi⌠ bacδ t∩ thσ ì
  84.         system.
  85.  
  86.         4«   Executσ tha⌠ whicΦ onσ wishe≤ t∩ stud∙ anΣ a⌠ ì
  87.         an∙á convenien⌠á timσ enablσ ßá VI6«á ┴á momentar∙ ì
  88.         switch will work.
  89.  
  90.         5.   Voila, I am in my interrupt handler.
  91.  
  92.  
  93.              T∩á makσ lifσ easie≥ le⌠ u≤ sa∙ thσ interrup⌠ ì
  94.         handle≥áá doe≤á thσá following«áá I⌠áá save≤áá al∞ ì
  95.         registers¼á save≤á thσá curren⌠á curso≥á position¼ ì
  96.         paint≤á ß prett∙ displa∙ oε somσ protecteΣ par⌠ oµ ì
  97.         thσ screeε anΣ poll≤ thσ keyboarΣ fo≥ input« Iµ n∩ ì
  98.         ke∙ theε restorσ cursor¼á restorσ register≤ anΣ d∩ ì
  99.         EI, OUT (XX),A and RET.
  100.              S∩á unti∞á ß ke∙ i≤ strucδá durinτá interrup⌠ ì
  101.         handle≥ thσ processo≥ `pseud∩ runs'« Thσ effectivσ ì
  102.         speeΣ i≤ thσ timσ i⌠ take≤ t∩ ruε one'≤á interrup⌠ ì
  103.         handler¼á s∩á thσ quicke≥ anΣ dirtie≥ thσ codσ thσ ì
  104.         better! 
  105.              Notσá oµ warning«á I⌠ i≤ generall∙á safe≥á t∩ ì
  106.         surrounΣá one'≤á BIO╙ I╧ hardwarσá dependen⌠á codσ ì
  107.         witΦá D╔ anΣ E╔ t∩ preven⌠ `termina∞ confusionº a⌠ ì
  108.         one'≤ hardwareí Thu≤ onσ shoulΣ cop∙ one'≤ I╧ codσ ì
  109.         inlinσ int∩ thσ interrup⌠ handler«á Thi≤ wil∞ als∩ ì
  110.         save time (less system jumps etc.)
  111.              T∩á makσá lifσ eveεá easier¼á structurσá you≥ ì
  112.         interrup⌠ `monitorº t∩ enablσ futurσ addition≤ anΣ ì
  113.         options. Currently mine does the following:
  114.  
  115.              Oεá firs⌠á entr∙ iµ n∩á ke∙á i≤á struck¼á usσ ì
  116.         `lastºá ke∙á whicΦ i≤ prese⌠ t∩ <space╛ t∩á enablσ ì
  117.         singlσ ste≡ witΦ pause«á Tha⌠ is¼á iµ n∩ ke∙á theε ì
  118.         pol∞ again«á Iµ ke∙ theε test« ┴ <ret╛ switche≤ t∩ ì
  119.         `pseud∩ runº b∙ storinτ <ret╛ a⌠ `las⌠ key'« ┴ <B╛ ì
  120.         prompt≤ fo≥ aε addres≤ anΣ set≤ ß breakpoin⌠ (somσ ì
  121.         othe≥ rs⌠ instruction¼ save≤ thσ bytσ overwritten¼ ì
  122.         anΣá thσá vecto≥ a⌠ `otherº rs⌠ restore≤á origina∞ ì
  123.         bytσá anΣá theε enter≤ codσ fo≥á `monitorºá havinτ ìè
  124.  
  125.                                         2
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.         lef⌠ ß <space╛ a⌠ `lastº key«á Notσ thi≤ enable≤ ß ì
  135.         full speed run.á
  136.              Iµá yo⌡á havσ availablσ anothe≥ por⌠ yo⌡á caε ì
  137.         writσ t∩ tha⌠ caε latcΦ ß leve∞ yo⌡ caε ì
  138.         enable/disablσ thσ `stepperº unde≥ softwarσ ì
  139.         controlí ╔ do¼ s∩ m∙ initia∞ codσ disable≤ i⌠ anΣ ì
  140.         request≤ ß breakpoin⌠ theε jus⌠ exit≤ t∩ thσ ì
  141.         system« N∩ switche≤ necessary¼ a≤ ß matte≥ oµ fac⌠ ì
  142.         i⌠ jus⌠ sit≤ iε m∙ systeφ a≤ jus⌠ anothe≥ utility« ì
  143.         Wheε ╔ wisΦ t∩ usσ i⌠ ╔ jus⌠ ruε i⌠ likσ an∙ othe≥ ì
  144.         transien⌠ program.
  145.             Somσ suggesteΣ option≤ &/o≥ addition≤ tha⌠ onσ ì
  146.         caε implimen⌠ iε one'≤ onσ persona∞ `pseud∩ ì
  147.         machineº o≥ emulato≥ iµ yo⌡ will.
  148.         1«á  optioε t∩ modif∙ registe≥ a⌠ an∙ time  (ver∙ ì
  149.              easy).
  150.         2«   displa∙ anΣ savσ onl∙ wha⌠ onσ need≤ t∩ speeΣ ì
  151.              up the emulation (not so easy).
  152.         3«áá ruεá unti∞á certaiεá opcodes¼á RE╘á family¼ ì
  153.              etc. (not to hard).
  154.         4«á  ruεá unti∞ an∙ registe≥  equal≤á somσá valuσ ì
  155.              (very easy).
  156.         5.   set any number of breakpoints (easy).
  157.  
  158.              So far I have only implimented 3. 
  159.  
  160.              Final warnings and notes:
  161.         I⌠á i≤á ß ne≈ experiencσ t∩ contro∞ ß prograφá anΣ ì
  162.         interac⌠á witΦ i⌠ simultaneousl∙ a⌠á onσá console¼ ì
  163.         especiall∙á program≤ tha⌠ d∩ ß lo⌠ oµ consolσá IO« ì
  164.         Thσá curso≥á wil∞ dancσ froφ targe⌠ t∩ contro∞á s∩ ì
  165.         fas⌠á yo⌡á wil∞ havσ ß harΣá timσá decidinτá whicΦ ì
  166.         prograφá yo⌡á arσ controllingíá ╔ usuall∙á se⌠á m∙ ì
  167.         breakpoint≤á arounΣ ß sectioε oµ I╧ unles≤ tha⌠ i≤ ì
  168.         wha⌠ ╔ wisΦ t∩ study« Iµ yo⌡ havσ aε extrß consolσ ì
  169.         i⌠á coulΣ bσ thσ `emulatorº I╧ anΣ theε yo⌡á woulΣ ì
  170.         reall∙ havσ ß nicσ setup« 
  171.              ╔ havσ drawε aε optioε fo≥ NM╔ interrup⌠ tha⌠ ì
  172.         caε bσ implimenteΣ iµ desired« No≈ one'≤ vecto≥ i≤ ì
  173.         a⌠á 66he° anΣ onσ caε blithel∙ singlσ ste≡ througΦ ì
  174.         codσ tha⌠ i≤ `protectedº froφ interrupts« Onσ mus⌠ ì
  175.         onl∙á observσ thσ statσ oµ thσ interrup⌠ flaτá anΣ ì
  176.         restorσ i⌠ a⌠ thσ enΣ oµ thσ routine¼á tha⌠ i≤á oε ì
  177.         thσ z8░ changσ E╔ OU╘ (XX),┴ anΣ RE╘ t∩ OU╘ (XX),┴ ì
  178.         anΣ RET╬.  
  179.              S∩ tha⌠ i≤ wha⌠ ß 74ls7┤ caε d∩ witΦ ß littlσ ì
  180.         softwarσá iεá you≥ system«á Wh∩á ha≤á thσá fastes⌠ ì
  181.         disassemble≥á (opcodσá t∩á mnemoniπá algorithm⌐á ╔ ì
  182.         wonder?
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.                                         3
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.                                         4
  258.  
  259.  
  260.  
  261.  
  262.  
  263.