[PicForth] Possible bug

Jamie Lawson jlawson at ces.uoguelph.ca
Mon Dec 13 02:44:36 CET 2004


Hi,

For the following code snippet:

2 pin-a button-1
3 pin-a button-2

: wait-for-buttons ( -- )
    \ wait for both pins to be high
    begin
        button-1 bit-set? button-2 bit-set? and
    until
;

PicForth-1.2.4 produces

0x0080  0805    movf    0x05,w
0x0081  3908    andlw   0x08
0x0082  0384    decf    0x04,f
0x0083  0080    movwf   0x00
0x0084  0805    movf    0x05,w
0x0085  3904    andlw   0x04
0x0086  0500    andwf   0x00,w
0x0087  0A84    incf    0x04,f
0x0088  3800    iorlw   0x00
0x0089  1903    btfsc   0x03,2
0x008A  2880    goto    0x080   ; wait_for_buttons

I think it should have generated

0x0088  0400    iorwf   0x00,w

Regards,
Jamie Lawson


More information about the PicForth mailing list