gnupic: Bug in sumlation of BSF instruction in GPSIM?
Subject:
Re: Bug in sumlation of BSF instruction in GPSIM?
From:
Scott Dattalo ####@####.####
Date:
17 Sep 2000 12:30:04 -0000
Message-Id: <Pine.LNX.4.21.0009170732240.16010-100000@tempest2.blackhat.net>
You need to grab 20.4 off of the web page. This bug was introduced somewhere
between 20.0 and 20.2. Also, you may've noticed that the values for I/O ports
occasional exceed 255. That's been fixed too.
On Sun, 17 Sep 2000, Wojtek Zabolotny wrote:
> Hi All,
>
> I've just stated that GPSIM has problems with simulation of BSF instruction
> on ports which are partially configured as inputs, and partially as outputs.
> I've attached the simplest source which demonstrates the problem.
> Port C bits [0..5] are outputs, [6,7] are inputs.
> The BSF PORT C,5 instruction reads 0x1f (correctly) and writes back 0x20
> (incorrectly). MPLAB simulates this example correctly.
>
> Below is the output of GPSIM session:
>
> gpsim - the GNUPIC simulator
> version: 0.20.2
>
>
> type help for help
> gpsim>
> gpsim> Loading /home/wzab/photohd/asm/demo1.cod
> processing cod file /home/wzab/photohd/asm/demo1.cod
> directory is "/home/wzab/photohd/asm"
> filename is "demo1.cod"
> f877 create
> f874 create
> setting cfg_word and cfg_modes ffff 1
> setting cfg_word and cfg_modes 3f3a 0
> --- Reset
> 16F877 0x0000 0x2840 goto 0x0040
> cycle: 0x01
> cycle: 0x02
> 16F877 0x0040 0x30FF movlw 0xff
> wrote: 0xff to W
> cycle: 0x03
> 16F877 0x0041 0x0087 movwf portc
> read: 0xff from W
> wrote: 0x00 to portc
> cycle: 0x04
> 16F877 0x0042 0x1683 bsf status,5
> read: 0x18 from status
> wrote: 0x38 to status
> cycle: 0x05
> 16F877 0x0043 0x30C0 movlw 0xc0
> wrote: 0xc0 to W
> cycle: 0x06
> 16F877 0x0044 0x0087 movwf trisc
> read: 0xc0 from W
> wrote: 0x3f to portc
> wrote: 0xc0 to trisc
> cycle: 0x07
> 16F877 0x0045 0x1283 bcf status,5
> read: 0x38 from status
> wrote: 0x18 to status
> cycle: 0x08
> 16F877 0x0046 0x1687 bsf portc,5
> read: 0x3f from portc
> wrote: 0x20 to portc
> cycle: 0x09
> 16F877 0x0047 0x2847 goto 0x0047
> cycle: 0x0a
> cycle: 0x0b
>
> --
> Greetings
> Wojciech Zabolotny
> http://www.ise.pw.edu.pl/~wzab
>
> When buying hardware, ask the dealer if it is Open Source friendly!!!
> http://www.openhardware.org
>