Searching \ for ' [PIC] Bug with MPLAB SIM with the 18c252' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/languages.htm?key=mplab
Search entire site for: 'Bug with MPLAB SIM with the 18c252'.

No exact or substring matches. trying for part
PICList Thread
'[PICLIST] [PIC] Bug with MPLAB SIM with the 18c252'
2002\01\19@021704 by jlw.creditview

picon face
Hello,

Has anyone noticed a bug when using the MPLAB SIM with a 18c252.  In
particular, the update of status bits with code that is part of a macro.  I
have observed the following.

;Macro DEC24
DECF_24 MACRO src
 ; 8 CYCLES
       MOVLW    0x01
       SUBWF    src+0,F,A              ;Low Byte
 MOVLW  0x00
       SUBWFB src+1,F,A                ;Middle Byte
       SUBWFB src+2,F,A
       MOVF     src+0,W,A                      ;Now generate a zero test keeping result in status,Z
       IORWF    src+1,W,A
       IORWF    src+2,W,A
       ENDM

Now, in my code I have the following.
FR_COUNT_L      EQU 0x01
FR_COUNT_H      EQU 0x02
FR_COUNT_U  EQU 0x03
;RAM allocation.
Then, I declare another variable
FR_COUNT        EQU 0x01                ;Low byte of 24bit value.

...Then somewhere in code I make the following:
DEC24 (FR_COUNT)
BTFSC   STATUS,Z
....
....

Now, the sim does the correct action on the true variables as expected, but
the last part of the macro which is to generate a Z condition if it is
actually zero does not work.  However, if I replace the src+n with it actual
variable, I.E. FR_COUNT_L... then Z is update in the SIM.

Why does the SIM work on the arthimatic ok, but fail to update the status
bits when using macro substitution?

Regards,

James

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


More... (looser matching)
- Last day of these posts
- In 2002 , 2003 only
- Today
- New search...