----- Original Message -----=20 From: "Scott Dattalo" To: Sent: Sunday, December 01, 2002 10:47 PM Subject: Re: [EE]: PIC 12C508A Hello! I=B4m want to thank Scott Dattalo very much for his exellent solution and to give me accont for my problem with the programming of Pic 12C508! How high effect must the UV- fluorescent tube has to erase the chip? It=B4s possible to do that with the UV-box I have to make the cards? ( 2 x 8 W ) Regards =C5keN > This clearly will not work. First, W is not a register (you'll need an > 'addlw 1' instead of an 'incf w') and second, the original poster was > comparing "reg" to a constant "limit". One other subtle issue is that = the > original macro would return if reg was greater than limit. >=20 > Fortunately, Eke's problem is solved with a 'subwf': >=20 > inccmp macro reg, limit > incf reg,F > movlw limit+1 > subwf reg,W > skpc > return ; reg is less than or equal to LIMIT > clrf reg ; reg is greater than LIMIT >=20 > endm >=20 > This changes the comparison from an A-B to a B-(A-1) and looks at the > opposite state of the carry flag. >=20 > Scott >=20 >=20 > > > > --Bob > > > > ----- Original Message ----- > > From: "Eke Neehr" > > To: > > Sent: Sunday, December 01, 2002 10:01 AM > > Subject: [EE]: PIC 12C508A > > > > > > Hello! > > > > > > For a Pic 16F84 device I have this > > macro routine: > > > > inccmp macro reg, limit > > incf reg, f > > movf reg, w > > sublw limit > > btfsc STATUS, C > > return > > clrf reg > > endm > > > > but for the 12C508A device the instruction > > sublw don4t exist. > > Can any kind person tell me what I have > > to take for instructions to get the same function! > > > > Regards > > EkeN > > > > -- > > http://www.piclist.com#nomail Going offline? Don't AutoReply us! > > email listserv@mitvma.mit.edu with SET PICList DIGEST in the body > > > > -- > > http://www.piclist.com#nomail Going offline? Don't AutoReply us! > > email listserv@mitvma.mit.edu with SET PICList DIGEST in the body > > > > > > >=20 > -- > http://www.piclist.com#nomail Going offline? Don't AutoReply us! > email listserv@mitvma.mit.edu with SET PICList DIGEST in the body >=20 >=20 -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu