gnupic: gpsim: TMR0 has 3 nibbles?
Subject:
gpsim: TMR0 has 3 nibbles?
From:
John Sutton ####@####.####
Date:
4 Sep 2001 17:28:18 -0000
Message-Id: <01090418240804.05752@diva.localdomain>
Hi there
We're using gpasm 0.9.11 and gpsim 0.20.1 emulating 16F84.
Having success using gpasm/gpsim... and then we hit this hideous bug?
Problem only seems to arise when attempting to read TMR0 (rather than any GPR).
Problem is that the value read from TMR0 is correct (0x87 in example below) BUT
the value written to W (0x99 below) bears no obvious relationship to it! And
weirder still, as the dump reveals, W now appears to contain 3 nibbles!!
We've tried the same code on Microchips' Windoze emulator and it works as
expected so it's either a bug in gpsim or some config that we've screwed up?
Tried searching the mailling list archive (as best one can in the absence of a
Search facility ;-) but found nothing remotely similar. Which makes me think
it's a config problem rather than a bug because it is go gross that surely it
would have been unearthed by now?
-----------------------------------------------
16f84 0x001B 0x0801 movf tmr0,w
read: 0x87 from tmr0
wrote: 0x99 to W
wrote: 0x18 to status
cycle: 0x0c4f
dump
00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f
000: -- 87 1c 18 31 00 10 00 00 00 00 00 02 00 00 01 ....1...........
010: 00 0a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
080: 00 d2 1c 18 31 01 10 00 00 00 00 00 02 00 00 01 ....1...........
090: 00 0a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
000 indf = 00 001 tmr0 = 87 002 pcl = 1c 003 status = 18
004 fsr = 31 005 porta = 00 006 portb = 10 008 eedata = 00
009 eeadr = 00 00a pclath = 00 00b intcon = 00 081 option = d2
085 trisa = 01 086 trisb = 10 088 eecon1 = 00 089 eecon2 = 00
W = 799
pc = 0x1c
----------------------------------------------
Help please!
TIA
***************************************************
John Sutton
SCL Computer Services
URL http://www.scl.co.uk/
Tel. +44 (0) 1239 711 888
***************************************************