;******************************************************************* ; 8x8 Software Multiplier ; ( Code Efficient : Looped Code ) ;******************************************************************* ; ; The 16 bit result is stored in 2 bytes ; ; Before calling the subroutine " mpy ", the multiplier should ; be loaded in location " mulplr ", and the multiplicand in ; " mulcnd " . The 16 bit result is stored in locations ; H_byte & L_byte. ; ; Performance : ; Program Memory : 15 locations ; # of cycles : 71 ; Scratch RAM : 0 locations ; ; ; Program: MULT8x8S.ASM ; Revision Date: ; 1-13-97 Compatibility with MPASMWIN 1.40 ; ; This routine is optimized for code efficiency ( looped code ) ; For time efficiency code refer to "mult8x8F.asm" ( straight line code ) ;******************************************************************* Same equ 1 ; ***************************** Begin Multiplier Routine mpy_S clrf H_byte clrf L_byte movlw 8 movwf count movf mulcnd,W bcf STATUS,C ; Clear the carry bit in the status Reg. loop rrf mulplr, F btfsc STATUS,C addwf H_byte,Same rrf H_byte,Same rrf L_byte,Same decfsz count, F goto loop retlw 0