gnupic: Thread: gpsim; pic16c73, computed goto fails?


[<<] [<] Page 1 of 1 [>] [>>]
Subject: gpsim; pic16c73, computed goto fails?
From: Brad Parker ####@####.####
Date: 25 Mar 2003 23:36:32 -0000
Message-Id: <200303252323.h2PNNWF14588@mwave.heeltoe.com>

Hi,

I'm running gpsim 0.20.15 (direct from cvs) and simulating a 16C73.

I noticed that my "computed goto" was not doing the right thing; at
first I was trying to jump across a page boundary (my mistake) but
when I fixed that I noticed gpsim doing something that looks wrong.

I must be confused - I'm new to the pic...

It looks like the pc is ignoring bits 8,9 & 10 on a computed goto.  I have
code which looks like this

     org 0x140
     ...
     movlw 0x00
     call table
     ...

     org 0x600
table
     addwf  pcl,f

     dt  1,2,3,4,0

When I simulate the jump to 0x600 works fine, and w=00 but then the "addwf pcl"
is executed the code jumps to location 0x01.  The trace buffer looks like
this:

0x0000000000003C83  p16c73  0x01C0  0x00E9  movwf	0x69
   read: 0x00 from W
  wrote: 0x00 to 0x69
   read: 0x3c from TMR1H
0x0000000000003C84  p16c73  0x01C1  0x01E9  clrf	0x69
  wrote: 0x00 to 0x69
  wrote: 0x1c to status
   read: 0x3c from TMR1H
0x0000000000003C85  p16c73  0x01C2  0x0869  movf	0x69,w
   read: 0x00 from 0x69
  wrote: 0x00 to W
  wrote: 0x1c to status
   read: 0x3c from TMR1H
0x0000000000003C86  p16c73  0x01C3  0x2600  call	0x0600
   read: 0x3c from TMR1H
0x0000000000003C88  p16c73  0x0600  0x0782  addwf	pcl,f
  wrote: 0x01 to pcl
  wrote: 0x18 to status
   read: 0x3c from TMR1H
   read: 0x3c from TMR1H

Also, I can't explain the reads the TMR1H (looks like a gpsim bug?).

Has anyone else seen this?  Am I confused? :-)

-brad
[<<] [<] Page 1 of 1 [>] [>>]


Powered by ezmlm-browse 0.20.