
 1000  *---------------------------------
 1010  *      FASTER 16X16 MULTIPLY
 1020  *      BY BROOKE W. BOERING
 1030  *      NEARLY AS PUBLISHED IN MICRO--THE 6502 JOURNAL
 1040  *      PAGE 72, DECEMBER, 1980.
 1050  *---------------------------------
 1060  ACL    .EQ $50
 1070  ACH    .EQ $51
 1080  XTNDL  .EQ $52
 1090  XTNDH  .EQ $53
 1100  AUXL   .EQ $54
 1110  AUXH   .EQ $55
 1120  *---------------------------------
 1130  RMUL   LDY #16      16-BIT MULTIPLIER
 1140  .1     LDA ACL      (AC * AUX) + XTND
 1150         LSR          CHECK NEXT BIT OF MULTIPLIER
 1160         BCC .2       IF ZERO, DON'T ADD MULTIPLICAND
 1170         CLC          ADD MULTIPLICAND TO PARTIAL PRODUCT
 1180         LDA XTNDL
 1190         ADC AUXL
 1200         STA XTNDL
 1210         LDA XTNDH
 1220         ADC AUXH
 1230         STA XTNDH
 1240  .2     ROR XTNDH    SHIFT PARTIAL PRODUCT
 1250         ROR XTNDL
 1260         ROR ACH
 1270         ROR ACL
 1280         DEY          NEXT BIT
 1290         BNE .1       UNTIL ALL 16
 1300         RTS
 1310  *---------------------------------
 1320  *      TEST ROUTINE FOR MULTIPLY
 1330  *---------------------------------
 1340  SETUP.Y
 1350         LDA #$4C     PUT "JMP TESTMPY" IN $358-35A
 1360         STA $3F8
 1370         LDA #TESTMPY
 1380         STA $3F9
 1390         LDA /TESTMPY
 1400         STA $3FA
 1410         RTS
 1420  *---------------------------------
 1430  TESTMPY
 1440         LDA $3C      MOVE A1L,A1H TO ACL,ACH
 1450         STA ACL
 1460         LDA $3D
 1470         STA ACH
 1480         LDA $3E      MOVE A2L,A2H TO AUXL,AUXH
 1490         STA AUXL
 1500         LDA $3F
 1510         STA AUXH
 1520         LDA $42      MOVE A4L,A4H TO XTNDL,XTNDH
 1530         STA XTNDL
 1540         LDA $43
 1550         STA XTNDH
 1560         JSR RMUL     MULTIPLY
 1570         LDA XTNDH    PRINT 32-BIT RESULT
 1580         JSR $FDDA
 1590         LDA XTNDL
 1600         JSR $FDDA
 1610         LDA ACH
 1620         JSR $FDDA
 1630         LDA ACL
 1640         JMP $FDDA

