gnupic: Re: [gnupic] Not being able to use variables on pic18fxx50
Subject:
Re: [gnupic] Not being able to use variables on pic18fxx50
From:
"David Barnett" ####@####.####
Date:
19 Aug 2008 12:38:40 -0000
Message-Id: <4d52f78b0808190537v5cf11c25wa73653935b2047cc@mail.gmail.com>
It looks like you're reserving memory in ROM and then accessing addresses in
RAM. The RES directive allocates memory in the section you're defining, so
look at UDATA and similar directives in the manual.
David
On Mon, Aug 18, 2008 at 12:20 PM, Lope Vega ####@####.#### wrote:
> ...but I can't get the pic to "respect" and work with any variables other
> than constants.
>
> This is an example program I wanted to start with:
>
> ...
org 0
>
> counter res 2
>
> main:
> ;; portd will be all outputs
> clrf PORTD
> clrf TRISD
>
> restart:
> ;; give the memory address location `0x0' the value `5'
> movlw 5
> movwf 0x0
>
> loop:
> ;; decrement this value till it's 0, what will cause the
>
> decfsz 0x0, f
> goto loop
>
> btg PORTD, RD1
> goto restart
> end
>