Andrew Warren wrote:
{Quote hidden}>
> Tony Nixon <
PICLIST
spam_OUTMITVMA.MIT.EDU> wrote:
>
> > I have created a small utillity called HelpASM.exe which allows you
> > to write a line of BASIC type of code and it transforms it into PIC
> > ASM.
> > ....
> > For a 16 bit example you could write...
> >
> > if TimerH:TimerL >= CountH:CountL goto EndTime
> >
> > which generates...
> >
> > movf CountL,W
> > subwf TimerL,W
> > movf CountH,W
> > btfss STATUS,C
> > addlw 1h
> > subwf TimerH,W
> > btfsc STATUS,C
> > goto EndTime
>
> Tony:
>
> I hope you write better code than your HelpASM.exe program does. Try
> executing that fragment with TimerH:L = 0x01FE and CountH:L = 0xFF00.
>
> -Andy
>
> P.S. The right way to do it is to replace the "addlw 1h" with
> "incfsz CountH,w'.
>
> === Andrew Warren -
@spam@fastfwdKILLspam
ix.netcom.com
> === Fast Forward Engineering - San Diego, California
> ===
http://www.geocities.com/SiliconValley/2499
>
> --
>
http://www.piclist.com hint: PICList Posts must start with ONE topic:
> [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads
Hi Andy,
Dead right!!
It gets caught when CountH = 0xFF.
I'll ammend all the code and update it - thanks.
--
Best regards
Tony
mICros
http://www.bubblesoftonline.com
KILLspamsalesKILLspam
picnpoke.com
--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads