SX Microcontroller Square Math Method

Square 8bits

;by Dmitry Kiryashov


I still don't see solution shorter than 35 clocks. I've couple of them. 


1) 
        movfw x ;35 words/clocks 
        clrf x 
        rrf y,F 
; 
        skpnc ;this part is repeated 8 times 
        addwf x,F 
        rrf x,F 
        rrf y,F 
; 


2) 
        movfw x ;35 words/clocks 
        rrf y,F 
        skpc 
        subwf x,F 
        rrf x,F ;Cy=1 always before 
        rrf y,F 
; 
        skpnc ;this part is repeated 7 times 
        addwf x,F 
        rrf x,F 
        rrf y,F 
; 
        decf x,f ;substract first Cy=1