ON 20020701@6:47:54 PM at page: http://www.piclist.com/techref/microchip/books.htm barik+piclist-ieee- added 'I have agreed to maintain this page. ' : 553 Null recipient not accepted ON 20020701@6:48:45 PM at page: http://www.piclist.com/techref/microchip/books.htm barik+piclist-ieee- edited the page ON 20020701@6:49:27 PM at page: http://www.piclist.com/techref/microchip/books.htm barik+piclist-ieee- edited the page ON 20020701@6:52:33 PM at page: http://www.piclist.com/techref/microchip/books.htm barik+piclist-ieee- edited the page ON 20020708@11:24:21 AM at page: http://www.piclist.com/techref/microchip/spi.htm JMN-EFP-786 James Newton edited the page ON 20020715@4:45:00 PM at page: http://www.piclist.com/techref/microchip/memory.htm JMN-EFP-786 James Newton added 'delete ' ON 20020715@4:45:26 PM at page: http://www.piclist.com/techref/microchip/memory.htm JMN-EFP-786 James Newton added 'delete ' ON 20020716@3:09:59 PM at page: http://piclist.org/techref/microchip/pages.htm JMN-EFP-786 James Newton added 'change ' ON 20020717@2:10:56 PM at page: http://piclist.com/techref/microchip/devices.htm JMN-EFP-786 James Newton added 'change ' ON 20020717@2:14:29 PM at page: http://piclist.com/techref/microchip/devices.htm JMN-EFP-786 James Newton edited the page ON 20020723@6:13:36 PM at page: http://www.piclist.org/techref/microchip/routines.htm JB-san-A6 Jim Bixby added 'Code: After looking all over for a fast 16x16-->32 unsigned multiply routine, I adapted stuff from here to create the following. It is easily modified to other multiply resolutions, does nothing tricky like depend on register locations or order, and goes fast (16x16 mpy in about 168 instructions): ;********************************************************************************************** ; PIC16 fast unsigned multiply routines ; Jim Bixby ; bix@san.rr.com ;********************************************************************************************** list r=dec,x=on,t=off,p=16F877 include p16F877.INC ; STATUS bit definitions #define _C STATUS,0 #define _Z STATUS,2 cblock 0x20 ;Register definitions TEMP0, TEMP1, TEMP2, TEMP3 ;convention: '0' is most sig byte AARG0, AARG1, AARG2, AARG3 BARG0, BARG1 endc org 0x0000 nop goto MAIN ; a short test routine MAIN movlw 0x45 ;init a couple of arguments movwf AARG0 movlw 0x30 movwf AARG1 movlw 0xC2 movwf BARG0 movlw 0x51 movwf BARG1 call MUL16x16U ;call the multiply goto MAIN ;***************************************************************************************** ; Unsigned multiply routine ; Multiplies of any size can easily be made from the macros - for this code, only MUL16X16 ; is made ; ; The approach here is linear code for speed at the expense of RAM and registers ; Adapted from : http://www.piclist.org/techref/microchip/math/mul/8x8u.htm ;***************************************************************************************** ; Add16AB macro - add AH:AL to BH:BL, result goes to BH:BL Add16AB MACRO AH,AL,BH,BL movfw AL addwf BL,f movfw AH btfsc _C incfsz AH,w addwf BH,f ENDM ;***************************************************************************************** ; Macro for adding & right shifting - used once per bit by mulmac mult MACRO bit,A,H,L ;A=multiplier,H:L=result, other arg in W btfsc A,bit addwf H,f rrf H,f rrf L,f ENDM ; End of macro ;***************************************************************************************** ; 8x8-->16 multiply macro A * B --> H:L ; Invokes mult macro above mulmac MACRO A,B,H,L ; H:L = A*B clrf H clrf L movf B,W ; move the multiplicand to W reg. bcf _C ; Clear the carry bit in the status Reg. mult 0,A,H,L mult 1,A,H,L mult 2,A,H,L mult 3,A,H,L mult 4,A,H,L mult 5,A,H,L mult 6,A,H,L mult 7,A,H,L ENDM ; NOEXPAND ;***************************************************************************************** ; MUL16x16U ; AARG0:1 * BARG0:1 --> AARG0:3 ; Invokes the three macros above ; 164 prog words, 168 inst cycles, 10 registers (6 for call/return arguments + 4) ; Uses TEMP0:3 also. BARG0:1 unchanged on return ;***************************************************************************************** MUL16x16U ; 32 bit result is first calculated into T0:T1:A2:A3 ; When done, T0:1 is moved to A0:1 so the final result is in A0:3 ; Register names can be changed at will, and any register can be located ; anywhere - order is not important. mulmac AARG0, BARG0, TEMP0, TEMP1 ;T0:1 <--A0*B0 mulmac AARG1, BARG1, AARG2, AARG3 ;A2:3 <--A1*B1 mulmac AARG1, BARG0, TEMP2, TEMP3 ;T2:3 <--A1*B0 Add16AB TEMP2, TEMP3, TEMP1, AARG2 ; Add T2:3 to T1:A2, carry into T0 btfsc _C ; nb: this relies on the _C bit being incf TEMP0,f ; correct after the Add16AB macro mulmac AARG0, BARG1, TEMP2, TEMP3 ;T2:3 <--A0*B1 Add16AB TEMP2, TEMP3, TEMP1, AARG2 ; Add T2:3 to T1:A2, carry into T0 btfsc _C incf TEMP0,f movfw TEMP1 ;Move T0:1 to A0:1 movwf AARG1 ;to finish movfw TEMP0 movwf AARG0 retlw 0 EXPAND END ' ON 20020726@4:23:50 PM at page: http://www.piclist.com/techref/microchip/spi.htm JMN-EFP-786 James Newton added 'archive reference http://www.piclist.org/techref/postbot.asp?by=time&id=piclist\1999\05\04\091701a PICList post "SPI code" Using 4094 8bit shift/store registers to a SPI LCD' ON 20020728@7:20:58 AM at page: http://www.piclist.com/techref/microchip/dtmf.htm D-DAC-A54 DesignGroupLa added 'Code: http://www.digac.com/iosource.htm CallerID DTMF decode, DTMF encode running concurrently on PIC 16F73 '