On 11/7/2011 7:21 PM, Gál Zsolt wrote:
> I examined the compiled code, and I found a big problem in it. That is
> caused by the assembly parts of the wait function.
> Here we are:
>
>      clrwdt
>      movlw    0x42
>      movwf    0
>      decfsz   0, f
>      goto     0x102
>      nop
>
> If you are using pointers the compiler will use the FSR register for
> it. In your code you are using the 0x00 reg which is the INDF reg. The
> FSR is pointed of the last used register which should be actually the
> (*s). That register will be used trough INDF in your delay routine. So
> that cause the problem.

Good catch. U da man :-)

> It is unusual to make cblock into inline assembly. You have to make a
> global variable for using this type of delay routine. You have to use
> BANKSEL also.
>[snip snip]

-- 
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to