Searching \ for '[PIC]:Passing through zero' 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/devices.htm?key=pic
Search entire site for: 'Passing through zero'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]:Passing through zero'
2002\11\05@090701 by Christopher Gill

picon face
I am trying to monitor whether a register value drops below zero when a
subtraction is carried out. Is this possible and how?
I understand how the carry bit is used to show a register going over
0xFF, I thought the zero bit would have a similar effect in the other direction
but this is only set when the value is exactly zero.

can anyone help me

thanks chris

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


2002\11\05@095315 by Bob Ammerman

picon face
On a subtraction, the carry flag becomes a "not borrow" flag. In other
words, if the value "passes thru zero" then carry will be clear; otherwise
carry will be set.

Bob Ammerman
RAm Systems

{Original Message removed}

2002\11\05@100559 by Christopher Gill

picon face
Thanks Bob


----- Original Message -----
From: "Bob Ammerman" <spam_OUTrammermanTakeThisOuTspamADELPHIA.NET>
To: <.....PICLISTKILLspamspam@spam@MITVMA.MIT.EDU>
Sent: Tuesday, November 05, 2002 2:49 PM
Subject: Re: [PIC]:Passing through zero


{Quote hidden}

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


2002\11\05@144326 by Olin Lathrop

face picon face
>>
I am trying to monitor whether a register value drops below zero when a
subtraction is carried out.
<<

Use the C bit.

For a more detailed answer send you message using PLAIN TEXT next time
(not quoted printable).


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

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


2002\11\05@152306 by Mike Singer

picon face
Olin Lathrop wrote:
> For a more detailed answer send you message using
> PLAIN TEXT next time (not quoted printable).
--------------------------
From Knowledge Base Articles OL2002:
How Outlook Applies Encoding to Plain Text Messages
Q278134:

"Outlook 2002 does not expose the encoding choice as
an option. If you use Exchange, the information store uses
its own logic to determine encoding and ignores any setting
that you might set in Outlook. Encode Intelligently Outlook 2002
encodes each plain text body part for which Outlook creates
Multipurpose Internet Mail Extensions (MIME) by using the
same algorithm that Exchange servers use to send plain text
to the Internet. In general, if 25 percent or more of the message
is comprised of 8-bit characters, Outlook uses Base 64 encoding,
otherwise Outlook uses Quoted-Printable encoding."
----------------------

So " PLAIN TEXT" could be encoded "Quoted-Printable"  :-)

Christopher's posting header:
.
X-Mailer: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding:  quoted-printable
.

Mike, risking to be olinized as "wiseass"

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


2002\11\05@162640 by Peter L. Peres

picon face
On pics carry is cleared on carry or borrow. Therefore carry will be reset
after an add or substract that caused a msb carry or borrow.

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


2002\11\05@165134 by Andrew Warren

flavicon
face
Peter L. Peres <EraseMEPICLISTspam_OUTspamTakeThisOuTmitvma.mit.edu> wrote:

> On pics carry is cleared on carry or borrow. Therefore carry will be reset
> after an add or substract that caused a msb carry or borrow.

   Or, if that's too hard to remember, just think of the Carry flag
   after a subtraction as a "non-negative" flag. After a subtract,
   Carry will be set if the result is positive or zero, and will be
   clear if the result is negative.  E.g.,

   A-B, where A is greater than or equal to B:  Carry is set to 1
   A-B, where A is less than B: Carry is cleared to 0

   -Andy

   P.S.  Sorry I haven't been very active on the list; I really
         prefer only to respond to HTML messages that have been
         converted to PDF format, Base-64 encoded, PGP-signed, and
         MIME-encapsulated using the ISO646 character set... And
         there just haven't been many of those posted lately.

=== Andrew Warren -- aiwspamspam_OUTcypress.com
=== Principal Design Engineer
=== Cypress Semiconductor Corporation
===
=== Opinions expressed above do not
=== necessarily represent those of
=== Cypress Semiconductor Corporation

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


2002\11\05@175043 by hard Prosser

flavicon
face
You are in severe danger of being "Olinated"
RP



   P.S.  Sorry I haven't been very active on the list; I really
         prefer only to respond to HTML messages that have been
         converted to PDF format, Base-64 encoded, PGP-signed, and
         MIME-encapsulated using the ISO646 character set... And
         there just haven't been many of those posted lately.

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


2002\11\05@175645 by Olin Lathrop

face picon face
>     Or, if that's too hard to remember, just think of the Carry flag
>     after a subtraction as a "non-negative" flag. After a subtract,
>     Carry will be set if the result is positive or zero, and will be
>     clear if the result is negative.  E.g.,

And if that's too hard to remember, use my SKIP_WLE (skip if W was less
than or equal to other value) and SKIP_WGT macros.  These expand to single
BTFSx STATUS, C instructions, but alleviate the need to figure out which
way C gets set on a subtract each time.  Just do a SUBLW or SUBWF followed
by SKIP_WLE or SKIP_WGT.  These any many other handy macros can be found
in STD.INS.ASPIC at http://www.embedinc.com.pic.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

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


2002\11\05@180054 by Olin Lathrop

face picon face
> by SKIP_WLE or SKIP_WGT.  These any many other handy macros can be found
> in STD.INS.ASPIC at http://www.embedinc.com.pic.

Sorry, should have been http://www.embedinc.com/pic.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

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


2002\11\05@224931 by Bob Ammerman
picon face
No!

Carry is set on carry (addition), but cleared on borrow (subtraction). This
is, btw, a natural consequence of the way 2's complement arithmetic works.

Bob Ammerman
RAm Systems

{Original Message removed}

2002\11\06@004034 by Mike Singer

picon face
Richard Prosser
> You are in severe danger of being "Olinated"
> RP
>
>     P.S.  Sorry I haven't been very active on the list; I really
>           prefer only to respond to HTML messages that have been
>           converted to PDF format, Base-64 encoded, PGP-signed, and
>           MIME-encapsulated using the ISO646 character set... And
>           there just haven't been many of those posted lately.


  I do prefer PLAIN TEXT, which is encoded 7bit.
  The discussed posting was in "PLAIN TEXT", but
encoded "quoted printable", nothing in common
with "HTML", "PDF", " PGP-signed".
.......................................................
What do I want is that the idea of "not using quoted
printable" should be expressed explicitly, for example:

 Hey guy, your question was in PLAIN TEXT, but in
quoted printable encoding. I know you've got irrefragable
answers already to your bloody "quoted printable"
message. But if you do expect some favour from me in
the form of my personal reply you shouldn't use
quoted printable encoding at all, just 7bit encoding.
I know also your Outlook 2002 does not expose the
encoding choice as an option according to MSDN
article Q278134.
So tell your boss he should change his crappy
corporate MS software environment, to older one,
where you would have encoding choice to please me.
...........................................................

Mike. :-)   :-)   :-)   :-)   :-)   :-)   :-)   :-)   :-)   :-)

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email @spam@listservKILLspamspammitvma.mit.edu with SET PICList DIGEST in the body


2002\11\06@070753 by Alan B. Pearce

face picon face
>>     Or, if that's too hard to remember, just think of the Carry flag
>>     after a subtraction as a "non-negative" flag. After a subtract,
>>     Carry will be set if the result is positive or zero, and will be
>>     clear if the result is negative.  E.g.,
>
>And if that's too hard to remember, use my SKIP_WLE (skip if W was less
>than or equal to other value) and SKIP_WGT macros.  These expand to single
>BTFSx STATUS, C instructions, but alleviate the need to figure out which
>way C gets set on a subtract each time.  Just do a SUBLW or SUBWF followed
>by SKIP_WLE or SKIP_WGT.

These macros work well. The only time I had a hiccup was subtracting 16 bit
values passing through zero, and trying to detect this.
Unfortunately there is no "subtract with carry" to take the flag status of
the low byte operation through to the high byte subtract when both high
bytes are zero. The solution was to OR the high and low byte together and
then check for zero.

>These any many other handy macros can be found
>in STD.INS.ASPIC at http://www.embedinc.com.pic.

Should that not be http://www.embedinc.com/pic. unless you have changed your
site name :))

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email KILLspamlistservKILLspamspammitvma.mit.edu with SET PICList DIGEST in the body


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