home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / DRI-archive / roche / FALCONER.WS4 < prev    next >
Text File  |  2009-12-11  |  7KB  |  143 lines

  1. FALCONER.WS4
  2. ------------
  3.  
  4. "Falcone≥ Floatinτ Poin⌠ Arithmetic"
  5. b∙ Charle≤ FALCONER¼ Chieµ Instrumentatioε Engineer¼ Yalσ University
  6. iε DDJ¼ MarcΦ 1979¼ p.┤ anΣ Apri∞ 1979¼ p.16
  7.  
  8. (RetypeΣ b∙ Emmanue∞ ROCHE.)
  9.  
  10.  
  11.         Thi≤ áásoftwarσ ápackagσ áprovide≤ áful∞ áfloatinτ ápoin⌠ ááarithmetiπ ì
  12. capabilit∙ áfo≥ á8080¼ 8085¼ anΣ Z8░-baseΣ machines¼ witΦ áver∙ álittlσ áspeeΣ ì
  13. penalt∙ áove≥ áusσ áoµ intege≥ arithmetic« Thσ systeφ caε áhandlσ áal∞ á1╢-bi⌠ ì
  14. intege≥ ávalue≤ (treateΣ eithe≥ a≤ positivσ integer≤ iε thσ rangσ ░ t∩ á65535¼ ì
  15. o≥ áa≤ ásigneΣ áinteger≤ iε thσ rangσ -3276╕ t∩ 32767⌐ áwithou⌠ áan∙ álos≤ áoµ ì
  16. information¼ ááye⌠ áthσ áextendeΣ árangσ á(approximatel∙ á10|▐-3╕ át∩ áá10|^+38⌐ ì
  17. conveniencσ áoµ áfloatinτ poin⌠ i≤ directl∙ available¼ togethe≥ áwitΦ ávariou≤ ì
  18. mathematica∞ function≤ (i.e.¼ logarithms¼ exponentials¼ etc)« ╔ hopσ tha⌠ thi≤ ì
  19. publicatioε wil∞ discouragσ usσ oµ intege≥ arithmetiπ iε variou≤ interpreters¼ ì
  20. compilers¼ etc.
  21.  
  22.         Thσ áoperanΣ sizσ i≤ sucΦ a≤ t∩ allo≈ virtuall∙ al∞ inne≥ loop≤ t∩ ábσ ì
  23. performeΣ áentirel∙ áiε áregisters¼ witΦ attendan⌠ speeΣ benefits« áA⌠ áß á51╕ ì
  24. nanosecond≤ clock¼ mos⌠ arithmetiπ operation≤ arσ performeΣ iε onσ milliseconΣ ì
  25. o≥ áless¼ ádivisioε iε abou⌠ 1.╡ milliseconds« ┴ ┤-MH· Z8░ ásysteφ ácaε áhalvσ ì
  26. this« Thi≤ i≤ no⌠ fa≥ removeΣ froφ intege≥ executioε times.
  27.  
  28.         ╔ ástrongl∙ recommenΣ tha⌠ an∙ use≥ oµ thi≤ packagσ d∩ s∩ withou⌠ áan∙ ì
  29. alteratioε á(excep⌠ deletioε oµ routine≤ no⌠ needeΣ iε thσ application)« áThi≤ ì
  30. systeφ ha≤ beeε iε routinσ operatioε sincσ Apri∞ 1976¼ anΣ i≤ incorporateΣ áiε ì
  31. othe≥ systems« Thσ leas⌠ exerciseΣ routine≤ arσ iε FLTINPU╘ anΣ FUNCTION.
  32.  
  33.         Whilσ thσ callinτ conventioε t∩ IVAL¼ fo≥ example¼ ma∙ appea≥ unusual¼ ì
  34. i⌠ áha≤ beeε specificall∙ designeΣ t∩ allo≈ rσ-entran⌠ usσ witΦ ávariou≤ ádatß ì
  35. sources« ┴ callinτ routinσ oµ thσ form:
  36.  
  37.         GETNUM║ PUS╚    B
  38.                 LX╔     B,(addres≤ oµ cha≥ inpu⌠ routine)
  39.                 CAL╠    IVA╠    ╗ (o≥ IVALC)
  40.                 PO╨     B
  41.                 RET
  42.  
  43. wil∞ ácustomizσ áthi≤ áa≤ árequireΣ anΣ wil∞ avoiΣ áconflic⌠ áwitΦ áan∙ áothe≥ ì
  44. software.
  45.  
  46.         Thσ ásysteφ doe≤ no⌠ havσ thσ awkwarΣ rangσ limitatioε oµ thσ E┴ áchi≡ ì
  47. (approximatel∙ 10|▐-1╕ t∩ 10|^+18⌐ anΣ somσ othe≥ systems¼ whicΦ ╔ havσ founΣ t∩ ì
  48. bitσ áthσ áuse≥ al∞ to∩ often« Duσ t∩ thσ carefu∞ treatmen⌠ áoµ ároundinτ áanΣ ì
  49. over/underflow¼ áthσ systeφ wil∞ usuall∙ givσ thσ expecteΣ result≤ á(inversioε ì
  50. oµ álargσ matrice≤ i≤ thσ onl∙ exceptioε noteΣ s∩ far¼ ye⌠ system≤ oµ ╡ t∩ á1░ ì
  51. simultaneou≤ equations¼ oε ou≥ typica∞ inpu⌠ data¼ caε bσ handleΣ adequately)¼ ì
  52. anΣ áthσ erro≥ anΣ overflo≈ reportinτ wil∞ providσ adequatσ warning≤ áoµ áruε-ì
  53. timσ misuse« Erro≥ analysi≤ i≤ mathematicall∙ tractable«
  54.  
  55.         Thσ áAER├ á(arithmetiπ erro≥ connector⌐ allow≤ átrapping≤ áoµ áillega∞ ì
  56. operand≤ á(divisioε b∙ zero¼ logarithφ oµ negativσ number¼ etc)« áIµ ádesired¼ ì
  57. thi≤ caε bσ specifieΣ a:
  58.  
  59.         AERC║   STC
  60.                 RETè
  61. whicΦ wil∞ causσ al∞ sucΦ occurrence≤ t∩ bσ treateΣ a≤ overflows.
  62.  
  63.         Iε ágeneral¼ an∙ erro≥ i≤ signaleΣ b∙ Carr∙ se⌠ oε routinσ áexit« áThσ ì
  64. individua∞ ároutinσ áfunction≤ áarσ stateΣ iε thσ ácommentary¼ áanΣ áregister≤ ì
  65. disturbeΣ arσ listed.
  66.  
  67.         Noticσ tha⌠ thσ unspecifieΣ I/╧ routine≤ outpu⌠ registe≥ C¼ anΣ returε ì
  68. witΦ ┴ se⌠ t∩ ├ oε entry« Inpu⌠ routine≤ returε character≤ iε A.
  69.  
  70.         Also¼ ánoticσ tha⌠ al∞ routine≤ (excep⌠ thosσ specificall∙ áusinτ áI/╧ ì
  71. devices⌐ áarσ rσ-entrant¼ anΣ usσ onl∙ stacδ-assigneΣ temporar∙ ástorage« áThσ ì
  72. codσ ái≤ áthu≤ inherentl∙ suitablσ fo≥ thσ átimσ-sharinτ áo≥ áinterrup⌠-driveε ì
  73. applications« User≤ wh∩ havσ beeε usinτ intege≥ arithmetiπ ma∙ finΣ tha⌠ extrß ì
  74. stacδ spacσ mus⌠ bσ allocated« Aε extrß 3▓ byte≤ shoulΣ normall∙ suffice.
  75.  
  76.         Fo≥ áthσ ábenefi⌠ oµ reader≤ withou⌠ ß ámacr∩-assembler¼ ámacro≤ áuseΣ ì
  77. generall∙ ádepenΣ oε thσ definitioε oµ register≤ a≤ B=0¼ C=1¼ D=2¼ áE=3¼ áH=4¼ ì
  78. L=5¼ áM=SP=PSW=6¼ áA=7« áBetweeε thσ macr∩ definition≤ áanΣ áthσ áactua∞ ácodσ ì
  79. generated¼ áuser≤ áshoulΣ ábσ ablσ t∩ substitutσ ásuitablσ ásourcσ ácode« áOu≥ ì
  80. assemble≥ ápermit≤ á"aó áanΣ á".ó áiε ánames¼ áautomaticall∙ áincrement≤ ááanΣ ì
  81. decrement≤ áthσ ágloba∞ ávariablσ ".LVLó oε eacΦ áPUS╚ áanΣ áPO╨ áinstruction¼ ì
  82. respectively¼ áanΣ caε generatσ relocatablσ code« Sourcσ codσ betweeε áI╞ áanΣ ì
  83. ENDI╞ statement≤ i≤ assembleΣ onl∙ iµ thσ I╞ operanΣ i≤ noε-zero¼ anΣ ábetweeε ì
  84. IF┌ áanΣ áENDI╞ áonl∙ áiµ thσ IF┌ operanΣ i≤ ázero« áThi≤ álistinτ áuse≤ áthi≤ ì
  85. construc⌠ áonl∙ áwithiε ámacros« Thσ "EXTRNó álist≤ ásho≈ áexterna∞ áaddresse≤ ì
  86. requireΣ withiε ß module¼ anΣ thσ "ENTRYó list≤ sho≈ addres≤ requireΣ b∙ othe≥ ì
  87. modules« áNotσ tha⌠ somσ characte≥ constant≤ ma∙ bσ iε lowe≥ casσ (anΣ arσ ás∩ ì
  88. marked)« áThσ áprinte≥ áuseΣ translateΣ thesσ t∩ uppe≥ case« áThi≤ áshoulΣ ábσ ì
  89. sufficien⌠ t∩ allo≈ thσ use≥ t∩ customizσ thσ sourcσ t∩ hi≤ assembler.
  90.  
  91.         ╔ áoriginall∙ áintendeΣ át∩ ásubmi⌠ listing≤ áwitΦ áal∞ ámacro≤ áfull∙ ì
  92. expanded¼ ábu⌠ áthσ áresult≤ werσ excessivel∙ cluttered¼ n∩ álonge≥ áhelΣ áan∙ ì
  93. clarity¼ áanΣ áthσ álistinτ lengtΦ wa≤ virtuall∙ doubled« áA≤ ásubmitted¼ áal∞ ì
  94. informatioε áremain≤ ápresent¼ bu⌠ thσ reade≥ ma∙ havσ t∩ refe≥ t∩ áthσ ámacr∩ ì
  95. definition≤ fairl∙ often.
  96.  
  97.         Thσ áloaΣ ma≡ belo≈ show≤ thσ locatioε oµ al∞ routine≤ wheε loadeΣ áa⌠ ì
  98. locatioε 1000╚ up¼ iε thσ orde≥ shown« Thσ "Uó identifie≤ label≤ undefineΣ áiε ì
  99. thσ overal∞ system.
  100.  
  101.         Historically¼ thi≤ systeφ replaceΣ aε earlie≥ desigε (publisheΣ iε thσ ì
  102. Inte∞ áUse≥ Library⌐ whicΦ useΣ 2'≤ complemen⌠ mantissa≤ anΣ áexponents« áTha⌠ ì
  103. systeφ haΣ ▒ les≤ bi⌠ oµ resolution¼ contro∞ oµ negativσ extreme≤ anΣ roundinτ ì
  104. haΣ ß problem¼ anΣ wa≤ ╡ t∩ 1░ time≤ slowe≥ thaε thσ presen⌠ system.
  105.  
  106.  
  107. LoaΣ Ma≡
  108. --------
  109.  
  110.   Codσ     Datß  Name
  111. --------¡  ---¡  ----
  112. 1000-115┴  Nonσ  INTARITH.ASM
  113. 115B-146│  Nonσ  FLTARITH.ASM
  114. 1464-15B┬  Nonσ  FLTINPUT.ASM
  115. 15BC-17D▓  Nonσ  FLTOUT.ASM
  116. 17D3-19F┴  Nonσ  FUNCTION.ASM
  117.  
  118. .PAè  .AN─    198╢    .EQ╒    19A╢    .G┼.    19D╖    .G╟.    19E0
  119.   .G╘.    19C╡    «LE«    19B├    .LT«    19C┼    «NE«    19AF
  120.   .OR«    197▒    .XO╥    199╢  U-AER├    000░    BCL├    102B
  121.   BCL┌    102┴    BCR┴    103▓    BCR├    103┤    C1B├    1045
  122.   C1D┼    104─    C2B├    104┤    C2D┼    104├    C2DH╠   1054
  123. U-COU╘    000░    DEBL╦   147╣    DER┴    103┬    DER├    103D
  124.   DHL┌    102▓    DI╓     111┤    DQUI╦   108▓    DTE╬    106A
  125.   EXD╟    15F╞    EXP▓    18E▒    EXP╪    193▒    FAD─    1303
  126.   FCM╨    138╖    FDI╓    124╕    FDIV╥   12A╡    FDIV╘   1202
  127.   FIN╘    13D├    FIX╥    143╣    FIX╘    140┤    FLOA─   11DC
  128.   FLO╘    13E▒    FLOT┴   13B╣    FLOT─   13D╖    FLOT╨   13CE
  129.   FMA╘    172┬    FMO─    17E┼    FMU╠    121░    FMUL╘   11F4
  130.   FRAC╘   17D│    FRCI╨   12B▒    FSTO╥   11E╕    FSU┬    137A
  131.   FSUB╥   12F╞    FXCH╟   11B╡    IDI╓    10A╖    IMU╠    108A
  132.   IVA╠    148▓    IVAL├   14B╡    JB├     147╖    LA╙     101A
  133.   LBC╙    101▒    LDE╙    100╕    LFBI╙   11A╣    LFB╙    119C
  134.   LFDI╙   11B╣    LFD╙    11B╞    LFL╘    170├    LOG▓    1B23
  135.   LOG┬    188├  U-LOU╘    000░    MU╠     10D╣    MUL1░   1061
  136.   MLR─    115┬    DDZ╙    15E▒    DFL╘    171├    ONE╟    15DC
  137.   OP╘     15D╖    DTCB╦   15B├    DTCC╠   15B┼    POL┘    1BAB
  138.   QMA╪    146┬    QNU═    146┤    SFDI╙   11C╣    STAD╥   1000
  139.   TFL╘    1714
  140.  
  141.  
  142. EO╞             (Checδ thosσ location≤ witΦ LIN╦ afte≥ retypinτ all.)
  143.