gnupic: gpsim register question


Previous by date: 30 Dec 2006 18:50:24 +0000 Re: gpsim register question, Maxim Wexler
Next by date: 30 Dec 2006 18:50:24 +0000 Re: [gnupic] Re: gpsim register question, Robert Pearce
Previous in thread: 30 Dec 2006 18:50:24 +0000 Re: gpsim register question, Maxim Wexler
Next in thread:

Subject: Re: gpsim register question
From: "Maxim Wexler" ####@####.####
Date: 30 Dec 2006 18:50:24 +0000
Message-Id: <a0811460612301050k7e33dadcpa4aa0a59af19a655@mail.gmail.com>

aargh, did it again! Confusing the tab with the caps lock 8(

Anyway

COUNT1 equ 20h

Now when I step through the code and  pass the decfsz command 20h in the
register viewer fills up with FFh from 00h.

Where does that 255 come from? There's no mention anywhere in the previous
code. And besides, according to the pdf for DECFZ f,d f can't be more that
127.

Here's the code up to the first(of two) delay loops:

    ;*****Set up the Constants****

STATUS    equ    03h ;Address of the STATUS register
TRISA    equ    85h  ;Address of the tristate register for port A
PORTA    equ    05h  ;Address of Port A
COUNT1    equ    20h  ;First counter for our delay loops
COUNT2    equ    21h  ;Second counter for our delay loops

    ;****Set up the port****

    bsf    STATUS,5 ;Switch to Bank 1
    movlw    00h      ;Set the Port A pins
    movwf    TRISA    ;to output.
    bcf    STATUS,5  ;switch back to Bank 0
    movlw    02h       ;Set up our w register with 02h

    ;****Turn the LED on and off****

Start    xorwf    PORTA,1    ;Toggle the LED

    ;****Add a delay

    call    Delay

    ;****Now go back to the start of the program

    goto    Start ;go back to Start and turn LED on again

    ;****Here is our Subroutine

Delay
Loop1    decfsz    COUNT1,1    ;This second loop keeps the LED
        goto    Loop1       ;turned off long enough for us to
<...>

Another thing: In the breadboard window only porta0 to porta5 become
outputs. 6&7 remain inputs. Why, after being sent all zeros?

Maxim

Previous by date: 30 Dec 2006 18:50:24 +0000 Re: gpsim register question, Maxim Wexler
Next by date: 30 Dec 2006 18:50:24 +0000 Re: [gnupic] Re: gpsim register question, Robert Pearce
Previous in thread: 30 Dec 2006 18:50:24 +0000 Re: gpsim register question, Maxim Wexler
Next in thread:


Powered by ezmlm-browse 0.20.