gnupic: GPsim fatal bug with 18f452?
Subject:
GPsim fatal bug with 18f452?
From:
David McNab ####@####.####
Date:
7 Jan 2005 16:51:00 +0000
Message-Id: <41DEBDB5.20505@rebirthing.co.nz>
Hi,
I've built a tiny 'hello world' led-blinker prog for 18f452.
The gpdasm disassembly, and the compiler listing, both show it starting as:
000000: ef16 goto 0x2c
000002: f000
...
00002c: 6af8 clrf 0xf8, 0
00002e: 9ed0 bcf 0xd0, 0x7, 0
000030: 6aea clrf 0xea, 0
000032: 6ae9 clrf 0xe9, 0
000034: 80c1 bsf 0xc1, 0, 0
000036: 82c1 bsf 0xc1, 0x1, 0
000038: 84c1 bsf 0xc1, 0x2, 0
00003a: 96c1 bcf 0xc1, 0x3, 0
00003c: 0e15 movlw 0x15
...
However, when i run this in gpsim, the 'goto 0x2c' actually jumps to 0x58.
As I understand, the argument of 'goto', 0x16, is a /word/ address, not
a /byte/ address. So the '00016' argument gets doubled to the /byte/
address of 0x2c.
So it seems gpsim is doubling this address twice, to target 0x58.
Needless to say, the program ends up in Wonderland amongst a pile of
invalid opcodes.
Has anyone else come across this problem with 18fxx2 processor?
Has it been fixed in CVS? Is it worth a few hours in possible
GTK+Extra2.0 dependency hell to build/install gpsim from cvs?
--
Cheers
David