P724 CEEFAX 724 Wed 2 Mar 21:00/03 |B2201203|a17T/OSB13|i14TEXT|m10|s÷n1÷eO SBITS M An Exploration of the BBC Micro at Machine Level BP  ........................................ ........... PMD on T byte division routine  exactly like the long division example given last timeN The only differences a re that this time  bits longN This means that the  tor can no longer be usedN The dividend and result  ined and a full-blown  n extra workspace has to be used instead CMP So we have 'dividfnd' holding the dividf nd and 'divisor'  pdws' (partial dividend workspace)  ls the role of the accumulator in the la st module and # ily to hold the result of  e divisor from the partial dividend.|c
P724 CEEFAX 724 Wed 2 Mar 21:01/01 |B2202203|a17T/OSB11|i14TEXT|m336D|s÷n1÷ e T C ar the partial dividend workspace   starts here R ult left into partial dividend S act divisor from partial dividend and st ore I repeat loop I en I T of subtraction in to partial dividend R finished T ith negative numbdrs, try it NY ou would have to covert to positive befo re  ingly A zero divisor  but you could also see what happens when S s always smaller than  nd the answer always has every bit set, so FFF FFFFF)N If you think  a kind of perverse logic to this sin|c
P724 CEEFAX 724 Wed 2 Mar 21:00/10 |B2203203|a17T/OSB15|i14TEXT|m36D8|s÷n1÷ ece  ithm can get to  I to continud the division bfyond the bina ry  ce and increase the 32 I later module I shall be looking at numbe rs  h fixed and floating  temsN These basic arithmetic routines re made easily expandable because we wil l need them later. N ical routines in these modules have been NT verflow and with  hey have not been particularly fastN I hope though that they have been clear si nce arithmetic  unction of many computer programs. S l, that's enough arithmetic for thf mome nt. Next time BBCM o OS with a look at vectors and  y can be ssed for. 
P724 CEEFAX 724 Wed 2 Mar 21:01/15 |B2201204|a17B/OSB15|i13BAS|m10|s—<1÷e|s —91÷X|s—:1 L OS M B 5 L M D L V rsion  N ] KEYMODEM ||NLIST||M ] F   P] Z    P  e% ] [OPT  ] \ D vidend        isor \ O      X   H\    l     R\ #         \÷] LDA  A  A  A  ÷>8BEQ ## \ E  divisor   H] R@LDA  \ S    to  Y\STA  YSTA  ÷Y÷p÷fSTA  YSTA  Y] ÷Y60LDX  \   dividend Y@] YJ # YT] Y^ KASL  \ R  idend     Y
P724 CEEFAX 724 Wed 2 Mar 21:00/11 |B2202204 |s—91÷X|s—:1 ÷j2OL  YROL ividend+2 YROL  YROL  YOL  YBROL  ÷Y—L÷fROL  YV] Y#SEC Y GLDA  \ S ivisor    YSBC ivisor YSTA # YLDA  1 YBSBC  YLSTA # 1 YVLDA  ZSBC  ÷Z÷j÷iSTA # ZLDA  Z ÷iSBC  ZSTA # Z] ZDBCC ## ZN] ZXCIN C  \ I  lt     ZLDA # \     nd ZSTA  \    ZLDA # ZSTA  ZLDA # Z —<÷fSTA  ZFLDA # ZP fSTA  ZZ] Z## bd Z] ZDEX \ N  ZBNE # Z
P724 CEEFAX 724 Wed 2 Mar 21:00/00 |B2203204|a17B/OSB13|i13BAS|m3614|s—<1÷e |s—91÷X|s—:1 ÷] ZF#RTS ZP] [Z k.error#mbd#zero [] [#B K [  OPT DPUB [OPT LEQUSD s Z   [OPT LDVB 0) [] [H N OPT LDUD (0) [R N OPT DD [ \  OPT DZD [  f#ws OPT DZD [] [ L ÷[—,÷]÷E []M [@] [L@ E    AB [T@I F rom BASIC   AB   ainder  AB [^A [ —h÷g!divisor=B% [  [DI From C     remainder   [^U [@] ÷[÷J÷s**** EQU B  [T D0VB(N%) \^HN   \ pass%    I P \PP 1 \ \] \ EQU D ouble     \B LEQUD (N%) \LB X \VPN \ X =0  \     
P724 CEEFAX 724 Wed 2 Mar 21:01/05 |B2204204|a17B/OSB15|i13BAS|m38F6|s—<1÷e |s—91÷X|s—:1 ÷I PX \]E \ ?     I \PP \—:÷b=pass% \D] \N EQU String  \X LEPUSN \ B N \V  \ N  QN $) \KNN \PNM 1)=K% \D     I P %?(N%-1); \N]E ]     =  I ]PPQN ]#V ÷]÷v÷b=pass% W
P724 CEEFAX 724 Wed 2 Mar 21:11/21 |B2204204|a17B/OSB15|i13BAS|m38F6|s—<1÷e |s—91÷X|s—:1 ÷I PX \]E \ ?     I \PP \—:÷b=pass% \D] \N EQU String  \X DVSN \ B N \V  \ N  QN $) \KNN \PNM 1)=K% \D     I P %?(N%-1); \N]E ]     =  I ]PPQN ]#V ÷]÷v÷b=pass% W