home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / GENASM / EM220.LBR / EM220.LQT / EM220.LST
File List  |  2000-06-30  |  11KB  |  245 lines

  1.         EM220 - 8080A Microprocessor Instruction Set Emulator    Page 1
  2.  
  3.  
  4.         by   Jeffery Sheese
  5.              Computer Education Program Coordinator
  6.              Detroit Engineering Institute
  7.              2030 West Grand River
  8.              Detroit, Michigan  48226
  9.              (313) 222-7450
  10.  
  11.         USENET - ihnp4!{m-net,aix,crlt,chinet,itivax!gdsb}!jeffery
  12.  
  13.         Revision  2.20 - Made following changes:          (JES) 05-07-86
  14.              AsciΘ character≤ ma∙ no≈ bσ entereΣ a≤ singlσ operand≤ ì
  15.         ááááádelimiteΣ b∙ singlσ quotes¼ sucΦ a≤ MV╔ A,'G'«  Thσ onl∙ ì
  16.         áááááprobleφ witΦ thi≤ i≤ tha⌠ thσ character≤ tha⌠ appea≥ iε thσ ì
  17.         áááááoperaεd fielΣ arσ converteΣ t∩ thσ uppe≥ casσ asciΘ codes«  ì
  18.         áááááFo≥ instance¼ 'gº ╜ 67h¼ bu⌠ i≤ converteΣ t∩ 'G'¼ whicΦ i≤ ì
  19.         ááááá47h.
  20.              Al∞ CP╒ register≤ defaul⌠ t∩ zero¼ excep⌠ thσ P├ anΣ SP¼ ì
  21.         áááááwhich default to 2000h and 2500h respectively.
  22.  
  23.         Revision  2.12 - Fixed following bugs:            (JES) 10-22-85
  24.              Conditional jumps and calls will now work.
  25.  
  26.         Revision  2.11 - Fixed following bugs:            (JES) 09-06-85
  27.              Thσ backspacσ ke∙ wil∞ no≈ erasσ character≤ oε thσ entr∙ ì
  28.         áááááline«  Thσ curso≥ wil∞ n∩ longe≥ backspaceΣ int∩ thσ commanΣ ì
  29.         ááááálinσ prompt.
  30.  
  31.         Revision  2.10 - Rewrote Introduction             (JES) 09-06-85
  32.  
  33.         Revision  2.00 - Original Release                 (JES) 08-18-82
  34.  
  35.             Iµ an∙ bug≤ arσ noted¼ o≥ correction≤ made¼ pleasσ refe≥ theφ ì
  36.         t∩ thσ abovσ address.
  37.  
  38.              Thσ 8080┴ Instructioε Se⌠ Emulato≥ i≤ ß teachinτ too∞ useΣ ì
  39.         t∩ demonstratσ thσ operatioε oµ 8080 assembl∙ languagσ command≤ ì
  40.         anΣ ho≈ the∙ affec⌠ thσ memor∙ anΣ microprocesso≥ registe≥ ì
  41.         contents«  Thσ emulato≥ wa≤ designeΣ t∩ ac⌠ a≤ ß machinσ languagσ ì
  42.         'interpreter'¼ whicΦ closel∙ resemble≤ ß BASI├ interpreter«  Thi≤ ì
  43.         allow≤ thσ machinσ languagσ studen⌠ t∩ operatσ thσ compute≥ iε ß ì
  44.         machinσ languagσ 'directº mode«  Iε BASIC¼ thσ 'directº modσ i≤ ì
  45.         wheε ß persoε type≤ iε ß commanΣ sucΦ a≤ PRIN╘ anΣ watche≤ thσ ì
  46.         result≤ oµ thσ command«  Thσ emulato≥ wil∞ speeΣ learninτ anΣ ì
  47.         comprehensioε iε ß positivσ anΣ instructivσ atmosphere.
  48.  
  49.              Wheε thσ prograφ i≤ run¼ ß sign-oε messagσ i≤ printeΣ oε thσ ì
  50.         screen¼ anΣ immediatel∙ followinτ i≤ thσ prompt:
  51.  
  52.         Initial status:
  53.                 PC    S Z A P C  A  B  C  D  E  H  L  M  SP STACK
  54.                 2000  0 0 0 0 0  00 00 00 00 00 00 00 C3 2500 3236
  55.  
  56.         Instruction:   _
  57.  
  58.  
  59.  
  60.  
  61.         Copyright 1986                               All Rights Reserved
  62.         EM220 - 8080A Microprocessor Instruction Set Emulator    Page 2
  63.  
  64.  
  65.              Thσ firs⌠ linσ i≤ ß descriptioε oµ thσ typσ oµ register≤ iε ì
  66.         thσ 808░ microprocessor«  Unde≥ eacΦ descriptioε i≤ thσ actua∞ ì
  67.         conten⌠ oµ thσ register«  Thσ letter≤ S¼ Z¼ A¼ P¼ anΣ ├ arσ thσ ì
  68.         statu≤ flags«  The∙ changσ a≤ thσ microprocesso≥ statu≤ changes«  ì
  69.         Thei≥ function≤ anΣ description≤ follow:
  70.  
  71.         Sign (S)  -    Thi≤ flaτ show≤ iµ thσ sigε oµ thσ resul⌠ oµ thσ ì
  72.         ááááááááááááááálas⌠ operatioε wa≤ positivσ o≥ negative«  Thσ sigε ì
  73.         áááááááááááááááflaτ wil∞ bσ ß ▒ iµ negative¼ o≥ ß ░ iµ positive.
  74.  
  75.         Zero (Z)  -    Thi≤ flaτ show≤ iµ thσ resul⌠ oµ thσ las⌠ ì
  76.         áááááááááááááááoperatioε wa≤ zero«  Iµ thσ resul⌠ i≤ zero¼ thσ ì
  77.         áááááááááááááááflaτ wil∞ bσ 1«  Iµ i⌠ wa≤ no⌠ zero¼ thσ flaτ wil∞ ì
  78.         ááááááááááááááábσ 0.
  79.  
  80.         Auxiliary
  81.         Carry (A) -    Iµ thσ resul⌠ oµ thσ las⌠ operatioε causeΣ ß carr∙ ì
  82.         áááááááááááááááfroφ bi⌠ threσ t∩ bi⌠ fou≥ oµ thσ accumulator¼ ì
  83.         áááááááááááááááthi≤ flaτ wil∞ bσ ß 1«  Sincσ i⌠ i≤ onl∙ useΣ fo≥ ì
  84.         áááááááááááááááthσ DA┴ instruction¼ i⌠ i≤ generall∙ no⌠ testeΣ b∙ ì
  85.         áááááááááááááááthσ user≤ program.
  86.  
  87.         Parity(P) -    Thi≤ flaτ show≤ iµ thσ resul⌠ oµ thσ las⌠ ì
  88.         áááááááááááááááoperatioε resulteΣ iε aε eveε o≥ odΣ numbe≥ oµ ì
  89.         áááááááááááááááone≤ iε thσ resultinτ byte« I⌠ wil∞ bσ ß ┐ iµ ì
  90.         ááááááááááááááátherσ i≤ aε eveε numbe≥ oµ se⌠ bits¼ o≥ ┐ iµ therσ ì
  91.         ááááááááááááááái≤ aε odΣ numbe≥ oµ ┐ bits.
  92.  
  93.         Carry (C) -    Thi≤ flaτ show≤ iµ thσ resul⌠ oµ thσ las⌠ ì
  94.         áááááááááááááááoperatioε causeΣ ß carr∙ o≥ ß borro≈ froφ thσ mos⌠ ì
  95.         ááááááááááááááásignifican⌠ bi⌠ oµ thσ result«  I⌠ wil∞ bσ ▒ iµ ß ì
  96.         ááááááááááááááácarr∙ o≥ ß borro≈ diΣ occur¼ o≥ i⌠ wil∞ bσ ░ iµ i⌠ ì
  97.         ááááááááááááááádiΣ no⌠ occur.
  98.  
  99.              Thσ res⌠ oµ thσ linσ wil∞ sho≈ thσ microprocessor'≤ genera∞ ì
  100.         purposσ registers«  ┴ descriptioε oµ eacΦ registe≥ follows:
  101.  
  102.         PC   -    Thi≤ wil∞ sho≈ thσ curren⌠ addres≤ oµ thσ prograφ ì
  103.         áááááááááácounter«  D∩ no⌠ le⌠ thi≤ g∩ belo≈ 2000H«  Iµ i⌠ does¼ ì
  104.         ááááááááááyo⌡ ma∙ accidentall∙ alte≥ memor∙ tha⌠ i≤ essentia∞ fo≥ ì
  105.         ááááááááááthσ emulato≥ o≥ thσ operatinτ systeφ oµ you≥ computer.
  106.  
  107.         A    -    Thi≤ wil∞ sho≈ thσ content≤ oµ thσ accumulato≥ afte≥ ì
  108.         ááááááááááthσ las⌠ instructioε typed.
  109.  
  110.         B    -    Thi≤ wil∞ sho≈ thσ content≤ oµ thσ ┬ registe≥ afte≥ thσ ì
  111.         áááááááááálas⌠ instructioε typed.
  112.  
  113.         C    -    Thi≤ wil∞ sho≈ thσ content≤ oµ thσ ├ registe≥ afte≥ thσ ì
  114.         áááááááááálas⌠ instructioε typed.
  115.  
  116.         D    -    Thi≤ wil∞ sho≈ thσ content≤ oµ thσ ─ registe≥ afte≥ thσ ì
  117.         áááááááááálas⌠ instructioε typed.
  118.  
  119.  
  120.  
  121.  
  122.         Copyright 1986                               All Rights Reserved
  123.         EM220 - 8080A Microprocessor Instruction Set Emulator    Page 3
  124.  
  125.  
  126.         E    -    Thi≤ wil∞ sho≈ thσ content≤ oµ thσ ┼ registe≥ afte≥ thσ ì
  127.         áááááááááálas⌠ instructioε typed.
  128.  
  129.         H    -    Thi≤ wil∞ sho≈ thσ content≤ oµ thσ ╚ registe≥ afte≥ thσ ì
  130.         áááááááááálas⌠ instructioε typed.
  131.  
  132.         L    -    Thi≤ wil∞ sho≈ thσ content≤ oµ thσ ╠ registe≥ afte≥ thσ ì
  133.         áááááááááálas⌠ instructioε typed.
  134.  
  135.         M    -    Thi≤ wil∞ sho≈ thσ content≤ oµ thσ memor∙ addres≤ ì
  136.         áááááááááápointeΣ t∩ b∙ thσ H-╠ registe≥ pair.
  137.  
  138.         SP   -    Thi≤ wil∞ sho≈ thσ addres≤ tha⌠ i≤ thσ curren⌠ to≡ oµ ì
  139.         ááááááááááthσ stack.
  140.  
  141.         STACK-   áThi≤ wil∞ sho≈ thσ tw∩ byte≤ tha⌠ arσ storeΣ a⌠ thσ to≡ ì
  142.         ááááááááááoµ thσ stack« Thi≤ i≤ data¼ no⌠ ß memor∙ address.
  143.  
  144.              Thσ nex⌠ thinτ t∩ d∩ i≤ t∩ actuall∙ typσ iε aε 8080┴ ì
  145.         mnemonic«  Iµ yo⌡ havσ ß cop∙ oµ thσ 8080┴ instructioε set¼ yo⌡ ì
  146.         typσ iε thσ mnemoniπ thσ samσ a≤ iµ yo⌡ werσ enterinτ anΣ ì
  147.         executinτ aε assembl∙ languagσ program«  Thi≤ emulato≥ doe≤ no⌠ ì
  148.         suppor⌠ thσ usσ oµ labels«  Al∞ number≤ arσ entereΣ anΣ displayeΣ ì
  149.         iε hexidecima∞ format«  Afte≥ typinτ iε thσ instruction¼ pres≤ ì
  150.         return¼ anΣ thσ emulato≥ wil∞ displa∙ thσ ne≈ status.
  151.  
  152.              Iε orde≥ t∩ exi⌠ ß session¼ jus⌠ typσ 'Control-C'«  B∙ ì
  153.         typinτ Control-├ a⌠ an∙ placσ oε thσ inpu⌠ line¼ o≥ attemptinτ t∩ ì
  154.         executσ thσ HL╘ command¼ wil∞ causσ thσ emulato≥ t∩ displa∙ thσ ì
  155.         linσ '**¬ Warφ Boo⌠ ***º anΣ exi⌠ viß thσ warφ boo⌠ vecto≥ a⌠ ì
  156.         0000Φ iε pagσ zero«  Thi≤ featurσ i≤ t∩ allo≈ i⌠ t∩ bσ useΣ oε ß ì
  157.         compute≥ 'remotelyº viß thσ modeφ b∙ educationa∞ institution≤ o≥ ì
  158.         special interest groups.
  159.  
  160.         WARNING:
  161.              D╧ NO╘ ALTE╥ AN┘ MEMOR┘ LOCATION╙ BELO╫ 200░ HEX«  THES┼ ì
  162.         áááááMEMOR┘ LOCATION╙ AR┼ ESSENTIA╠ FO╥ TH┼ EMULATO╥ PROGRA═ AN─ ì
  163.         áááááTH┼ OPERATIN╟ SYSTE═ O╞ YOU╥ COMPUTER«  TH┼ MNEMONIC╙ AN─ ì
  164.         áááááCOMMAND╙ THA╘ AR┼ TYPE─ I╬ AR┼ ACTUALL┘ STORE─ AN─ EXECUTE─ ì
  165.         áááááA╘ TH┼ ADDRESSE╙ NOTE─ I╬ TH┼ PROGRA═ COUNTER.
  166.  
  167.         Authors Note:
  168.  
  169.              I'φ surσ man∙ peoplσ kno≈ thσ feelinτ oµ thσ initia∞ shocδ ì
  170.         wheε the∙ writσ ß prograφ anΣ releasσ i⌠ int∩ thσ publiπ domain¼ ì
  171.         anΣ year≤ late≥ finΣ i⌠ oε aε RCP/═ boarΣ 20░ mile≤ awayí  Thi≤ ì
  172.         shockeΣ mσ int∩ thσ realizatioε tha⌠ peoplσ arσ actuall∙ usinτ ì
  173.         thi≤ program«  Duσ t∩ thσ man∙ bug≤ presen⌠ iε thi≤ program¼ ╔ ì
  174.         definitel∙ fel⌠ thσ neeΣ t∩ correc⌠ sucΦ bugs«  Thσ firs⌠ ste≡ ì
  175.         wa≤ t∩ seperatσ thσ documentatioε froφ thσ actua∞ prograφ sourcσ ì
  176.         anΣ makσ quitσ ß fe≈ change≤ iε thσ documentatioε fo≥ clarity«  ì
  177.         Futurσ revision≤ wil∞ bσ madσ t∩ thσ prograφ t∩ fi° thσ man∙ bug≤ ì
  178.         currentl∙ present.
  179.  
  180.  
  181.  
  182.  
  183.         Copyright 1986                               All Rights Reserved
  184.         EM220 - 8080A Microprocessor Instruction Set Emulator    Page 4
  185.  
  186.  
  187.              Thσ sourcσ codσ i≤ n∩ longe≥ distributeΣ witΦ thσ librar∙ ì
  188.         becausσ variou≤ 'idiotsº havσ beeε revisinτ i⌠ t∩ crasΦ whateve≥ ì
  189.         compute≥ i⌠ i≤ assembleΣ fo≥ b∙ usinτ thσ BIO╙ routine≤ t∩ wipσ ì
  190.         ou⌠ thσ director∙ tracks«  The∙ havσ theε recombineΣ i⌠ int∩ ß ì
  191.         librar∙ anΣ re-releaseΣ i⌠ fo≥ distribution.
  192.  
  193.              Also¼ i⌠ make≤ thσ librar∙ ß bi⌠ smalle≥ becausσ thσ sourcσ ì
  194.         code takes up about 22k when unsqueezed.
  195.  
  196.              Iµ yo⌡ woulΣ likσ ß cop∙ oµ thσ sourcσ code¼ senΣ ß $╡ ì
  197.         donatioε t∩ thσ abovσ address«  ShoulΣ ╔ n∩ longe≥ bσ reachablσ ì
  198.         a⌠ tha⌠ address¼ yo⌡ caε stil∞ contac⌠ mσ viß USENE╘ mai∞ a⌠ ì
  199.         ihnp4!m-net!jeffery.
  200.  
  201.  
  202.         Future revisions planned:
  203.  
  204.         1.   ASCI╔ value≤ caε no≈ bσ entereΣ a≤ singlσ quotes¼ bu⌠ thσ ì
  205.         ááááávalue≤ arσ converteΣ t∩ uppe≥ casσ b∙ thσ inpu⌠ routine«  ╔ ì
  206.         áááááwoulΣ likσ t∩ bσ ablσ t∩ havσ i⌠ usσ botΦ uppe≥ anΣ lowe≥ ì
  207.         ááááácasσ iε thσ operanΣ fielΣ wheε delimiteΣ b∙ singlσ quotes.
  208.  
  209.         2.   Aε offse⌠ valuσ t∩ bσ used¼ plu≤ erro≥ checking¼ t∩ preven⌠ ì
  210.         ááááámodifyinτ memor∙ requireΣ b∙ botΦ thσ prograφ anΣ thσ ì
  211.         áááááoperatinτ system«  Somσ stil∞ thinδ thi≤ a≤ ß 'featureº ì
  212.         ááááábecausσ oµ thσ fac⌠ tha⌠ thσ instruction≤ tha⌠ arσ actuall∙ ì
  213.         ááááátyped in are executed at the addresses noted.
  214.  
  215.              An∙ othe≥ bug≤ presen⌠ anΣ founΣ iε thi≤ prograφ shoulΣ bσ ì
  216.         reporteΣ t∩ thσ namσ anΣ addres≤ noteΣ a⌠ thσ beginninτ oµ thi≤ ì
  217.         file«  Pleasσ fee∞ freσ t∩ adΣ whateve≥ correction≤ anΣ feature≤ ì
  218.         t∩ thi≤ prograφ tha⌠ arσ necessary¼ provideΣ thesσ change≤ arσ ì
  219.         brough⌠ t∩ m∙ attention¼ fo≥ everyonσ t∩ enjoy«  Happ∙ hacking!
  220.  
  221.                                          - Jefµ Sheesσ -
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.         Copyright 1986                               All Rights Reserved
  245.