Hi there,

Well, I've finally converted my PIC16 project to PIC18, and I was taking a look 
at the first SDCC .asm output that accepted to compile OK.

My attention was drawn by the following SDCC-generated comment in the .asm file 
:

; ;multiply lit val:0x02 by variable _resetSource and store in r0x00
; ;Unrolled 8 X 8 multiplication
; ;FIXME: the function does not support result==WREG

This pops 2 questions in my mind :

1/ Is this "FIXME" the sign of anything I should worry about ? ;-)

2/ As the PIC18 datasheet says "All PIC18 include an 8x8 hardware multiplier 
as part of the ALU [...] Making multiplication a hardware operation allows it 
to be completed in a single instruction cycle".

And this corresponds to the PIC18 "MULLW" and "MULWF" asm instructions.

Datasheet-provided "performance comparison" chart shows that a 8x8 unsigned 
MULT will take 1 CPU  cycle and use 1 program memory word using the hardware 
multiplier, where it would use 69 (max) CPU cycles and use 13 program memory 
words if performed "the software way" in assembly code.

And the SDCC .asm file when I saw the comment that drew my attention contains 
no trace of ever using a MULLW or MULWF, so I assume it performs 
multiplications the long, soft way...

Any light on these 2 questions would be greatly appreciated...

-- 
Michel Bouissou (OpenPGP ID 0xEB04D09C)

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to