FALCONER.WS4 ------------ "Falconeò Floatinç Poinô Arithmetic" bù Charleó FALCONER¬ Chieæ Instrumentatioî Engineer¬ Yalå University iî DDJ¬ Marcè 1979¬ p.´ anä Apriì 1979¬ p.16 (Retypeä bù Emmanueì ROCHE.) Thió   softwarå  packagå  provideó  fulì  floatinç  poinô   arithmetiã capabilitù  foò  8080¬ 8085¬ anä Z8°-baseä machines¬ witè  verù  littlå  speeä penaltù  oveò  uså  oæ integeò arithmetic® Thå systeí caî  handlå  alì  1¶-biô integeò  valueó (treateä eitheò aó positivå integeró iî thå rangå ° tï  65535¬ oò  aó  signeä  integeró iî thå rangå -3276¸ tï 32767©  withouô  anù  losó  oæ information¬   yeô  thå  extendeä  rangå  (approximatelù  10|Þ-3¸  tï   10|^+38© conveniencå  oæ  floatinç poinô ió directlù available¬ togetheò  witè  variouó mathematicaì functionó (i.e.¬ logarithms¬ exponentials¬ etc)® É hopå thaô thió publicatioî wilì discouragå uså oæ integeò arithmetiã iî variouó interpreters¬ compilers¬ etc. Thå  operanä sizå ió sucè aó tï allo÷ virtuallù alì inneò loopó tï  bå performeä  entirelù  iî  registers¬ witè attendanô speeä benefits®  Aô  á  51¸ nanosecondó clock¬ mosô arithmetiã operationó arå performeä iî onå milliseconä oò  less¬  divisioî iî abouô 1.µ milliseconds® Á ´-MHú Z8°  systeí  caî  halvå this® Thió ió noô faò removeä froí integeò executioî times. É  stronglù recommenä thaô anù useò oæ thió packagå dï sï withouô  anù alteratioî  (excepô deletioî oæ routineó noô needeä iî thå application)®  Thió systeí haó beeî iî routinå operatioî sincå Apriì 1976¬ anä ió incorporateä  iî otheò systems® Thå leasô exerciseä routineó arå iî FLTINPUÔ anä FUNCTION. Whilå thå callinç conventioî tï IVAL¬ foò example¬ maù appeaò unusual¬ iô  haó beeî specificallù designeä tï allo÷ rå-entranô uså witè  variouó  datá sources® Á callinç routinå oæ thå form: GETNUMº PUSÈ B LXÉ B,(addresó oæ chaò inpuô routine) CALÌ IVAÌ » (oò IVALC) POÐ B RET wilì  customizå  thió  aó  requireä anä wilì avoiä  conflicô  witè  anù  otheò software. Thå  systeí doeó noô havå thå awkwarä rangå limitatioî oæ thå EÁ  chið (approximatelù 10|Þ-1¸ tï 10|^+18© anä somå otheò systems¬ whicè É havå founä tï bitå  thå  useò alì toï often® Duå tï thå carefuì treatmenô  oæ  roundinç  anä over/underflow¬  thå systeí wilì usuallù givå thå expecteä resultó  (inversioî oæ  largå matriceó ió thå onlù exceptioî noteä sï far¬ yeô systemó oæ µ tï  1° simultaneouó equations¬ oî ouò typicaì inpuô data¬ caî bå handleä adequately)¬ anä  thå erroò anä overflo÷ reportinç wilì providå adequatå warningó  oæ  ruî- timå misuse® Erroò analysió ió mathematicallù tractable® Thå  AERÃ  (arithmetiã erroò connector© allowó  trappingó  oæ  illegaì operandó  (divisioî bù zero¬ logarithí oæ negativå number¬ etc)®  Iæ  desired¬ thió caî bå specifieä a: AERCº STC RET Š whicè wilì causå alì sucè occurrenceó tï bå treateä aó overflows. Iî  general¬ anù erroò ió signaleä bù Carrù seô oî routinå  exit®  Thå individuaì  routinå  functionó  arå stateä iî thå  commentary¬  anä  registeró disturbeä arå listed. Noticå thaô thå unspecifieä I/Ï routineó outpuô registeò C¬ anä returî witè Á seô tï Ã oî entry® Inpuô routineó returî characteró iî A. Also¬  noticå thaô alì routineó (excepô thoså specificallù  usinç  I/Ï devices©  arå rå-entrant¬ anä uså onlù stacë-assigneä temporarù  storage®  Thå codå  ió  thuó inherentlù suitablå foò thå  timå-sharinç  oò  interrupô-driveî applications® Useró whï havå beeî usinç integeò arithmetiã maù finä thaô extrá stacë spacå musô bå allocated® Aî extrá 3² byteó shoulä normallù suffice. Foò  thå  benefiô oæ readeró withouô á  macrï-assembler¬  macroó  useä generallù  depenä oî thå definitioî oæ registeró aó B=0¬ C=1¬ D=2¬  E=3¬  H=4¬ L=5¬  M=SP=PSW=6¬  A=7®  Betweeî thå macrï definitionó  anä  thå  actuaì  codå generated¬  useró  shoulä  bå ablå tï substitutå  suitablå  sourcå  code®  Ouò assembleò  permitó  "a¢  anä  ".¢  iî  names¬  automaticallù  incrementó   anä decrementó  thå  globaì  variablå ".LVL¢ oî eacè  PUSÈ  anä  POÐ  instruction¬ respectively¬  anä caî generatå relocatablå code® Sourcå codå betweeî  IÆ  anä ENDIÆ statementó ió assembleä onlù iæ thå IÆ operanä ió noî-zero¬ anä  betweeî IFÚ  anä  ENDIÆ  onlù  iæ thå IFÚ operanä ió  zero®  Thió  listinç  useó  thió construcô  onlù  withiî  macros® Thå "EXTRN¢  listó  sho÷  externaì  addresseó requireä withiî á module¬ anä thå "ENTRY¢ listó sho÷ addresó requireä bù otheò modules®  Notå thaô somå characteò constantó maù bå iî loweò caså (anä arå  sï marked)®  Thå  printeò  useä translateä theså tï uppeò case®  Thió  shoulä  bå sufficienô tï allo÷ thå useò tï customizå thå sourcå tï hió assembler. É  originallù  intendeä  tï  submiô listingó  witè  alì  macroó  fullù expanded¬  buô  thå  resultó werå excessivelù cluttered¬ nï  longeò  helä  anù clarity¬  anä  thå  listinç lengtè waó virtuallù doubled®  Aó  submitted¬  alì informatioî  remainó  present¬ buô thå readeò maù havå tï refeò tï  thå  macrï definitionó fairlù often. Thå  loaä mað belo÷ showó thå locatioî oæ alì routineó wheî loadeä  aô locatioî 1000È up¬ iî thå ordeò shown® Thå "U¢ identifieó labeló undefineä  iî thå overalì system. Historically¬ thió systeí replaceä aî earlieò desigî (publisheä iî thå Inteì  Useò Library© whicè useä 2'ó complemenô mantissaó anä  exponents®  Thaô systeí haä ± lesó biô oæ resolution¬ controì oæ negativå extremeó anä roundinç haä á problem¬ anä waó µ tï 1° timeó sloweò thaî thå presenô system. Loaä Mað -------- Codå Datá Name --------­ ---­ ---- 1000-115Á Nonå INTARITH.ASM 115B-146³ Nonå FLTARITH.ASM 1464-15BÂ Nonå FLTINPUT.ASM 15BC-17D² Nonå FLTOUT.ASM 17D3-19FÁ Nonå FUNCTION.ASM .PA Š .ANÄ 198¶ .EQÕ 19A¶ .GÅ. 19D· .GÇ. 19E0 .GÔ. 19Cµ ®LE® 19BÃ .LT® 19CÅ ®NE® 19AF .OR® 197± .XOÒ 199¶ U-AERÃ 000° BCLÃ 102B BCLÚ 102Á BCRÁ 103² BCRÃ 103´ C1BÃ 1045 C1DÅ 104Ä C2BÃ 104´ C2DÅ 104Ã C2DHÌ 1054 U-COUÔ 000° DEBLË 147¹ DERÁ 103Â DERÃ 103D DHLÚ 102² DIÖ 111´ DQUIË 108² DTEÎ 106A EXDÇ 15FÆ EXP² 18E± EXPØ 193± FADÄ 1303 FCMÐ 138· FDIÖ 124¸ FDIVÒ 12Aµ FDIVÔ 1202 FINÔ 13DÃ FIXÒ 143¹ FIXÔ 140´ FLOAÄ 11DC FLOÔ 13E± FLOTÁ 13B¹ FLOTÄ 13D· FLOTÐ 13CE FMAÔ 172Â FMOÄ 17EÅ FMUÌ 121° FMULÔ 11F4 FRACÔ 17D³ FRCIÐ 12B± FSTOÒ 11E¸ FSUÂ 137A FSUBÒ 12FÆ FXCHÇ 11Bµ IDIÖ 10A· IMUÌ 108A IVAÌ 148² IVALÃ 14Bµ JBÃ 147· LAÓ 101A LBCÓ 101± LDEÓ 100¸ LFBIÓ 11A¹ LFBÓ 119C LFDIÓ 11B¹ LFDÓ 11BÆ LFLÔ 170Ã LOG² 1B23 LOGÂ 188Ã U-LOUÔ 000° MUÌ 10D¹ MUL1° 1061 MLRÄ 115Â DDZÓ 15E± DFLÔ 171Ã ONEÇ 15DC OPÔ 15D· DTCBË 15BÃ DTCCÌ 15BÅ POLÙ 1BAB QMAØ 146Â QNUÍ 146´ SFDIÓ 11C¹ STADÒ 1000 TFLÔ 1714 EOÆ (Checë thoså locationó witè LINË afteò retypinç all.)