Searching \ for '[PIC]: SUBLW' 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: 'SUBLW'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: SUBLW'
2002\05\15@184611 by Thomas C. Sefranek

face picon face
Burned!!!

SUBLW does NOT SUBtract Literal from W!
(It subtracts W from Literal)

WHY did they reverse the order of the operands in the Mnemonic?


 *
 |  __O    Thomas C. Sefranek  spam_OUTtcsTakeThisOuTspamcmcorp.com
 |_-\<,_   Amateur Radio Operator: WA1RHP
 (*)/ (*)  Bicycle mobile on 145.41, 448.625 MHz

ARRL Instructor, Technical Specialist, VE Contact.
hamradio.cmcorp.com/inventory/Inventory.html
http://www.harvardrepeater.org

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


2002\05\15@191942 by M. Adam Davis

flavicon
face
Every year or so someone is burned by it.  There is an obscure reason,
but it escapes me at the moment - hope it didn't kill too much of your time!

-Adam

Thomas C. Sefranek wrote:

{Quote hidden}

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


2002\05\16@024905 by Dmitriy A. Kiryashov

picon face
Hi Thomas.

Just to let you simply have another choice to do:

addlw   -const


WBR Dmitry.


>"Thomas C. Sefranek" wrote:
>
> Burned!!!
>
> SUBLW does NOT SUBtract Literal from W!
> (It subtracts W from Literal)
>
> WHY did they reverse the order of the operands in the Mnemonic?

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestspamspam_OUTmitvma.mit.edu


2002\05\16@091113 by Eoin Ross

flavicon
face
Its not really reversed ...

SUBLW ...  L - W = result

>>> @spam@adampicKILLspamspamUBASICS.COM 05/15/02 07:17PM >>>
Every year or so someone is burned by it.  There is an obscure reason,
but it escapes me at the moment - hope it didn't kill too much of your time!

-Adam

Thomas C. Sefranek wrote:
>SUBLW does NOT SUBtract Literal from W!
>(It subtracts W from Literal)
>WHY did they reverse the order of the operands in the Mnemonic?
>  |  __O    Thomas C. Sefranek  KILLspamtcsKILLspamspamcmcorp.com
--
http://www.piclist.com hint: To leave the PICList
RemoveMEpiclist-unsubscribe-requestTakeThisOuTspammitvma.mit.edu


2002\05\16@093303 by Alan B. Pearce
face picon face
>Its not really reversed ...

>SUBLW ...  L - W = result

Well it is reversed compared to the SUBWF mnemonic which is F - W = result,
and that is why people get confused.

--
http://www.piclist.com hint: To leave the PICList
spamBeGonepiclist-unsubscribe-requestspamBeGonespammitvma.mit.edu


2002\05\16@093650 by Douglas Wood

picon face
Most micros use the "register minus literal" method...

Douglas Wood
Software Engineer
TakeThisOuTdbwoodEraseMEspamspam_OUTkc.rr.com

Home of the EPICIS Development System for the PIC and SX
http://epicis.piclist.com

{Original Message removed}

2002\05\16@103233 by Bob Ammerman

picon face
----- Original Message -----
From: "Douglas Wood" <RemoveMEdbwoodspamTakeThisOuTKC.RR.COM>
To: <PICLISTEraseMEspam.....MITVMA.MIT.EDU>
Sent: Thursday, May 16, 2002 9:31 AM
Subject: Re: [PIC]: SUBLW


> Most micros use the "register minus literal" method...

But why waste the opcode space when you can just use "register
plus -(literal) instead".

Actually, I have found sublw to be very useful on several occasions.

Bob Ammerman
RAm Systems

--
http://www.piclist.com hint: To leave the PICList
EraseMEpiclist-unsubscribe-requestspammitvma.mit.edu


2002\05\16@121853 by Dwayne Reid

flavicon
face
At 10:23 AM 5/16/02 -0400, Bob Ammerman wrote:

>But why waste the opcode space when you can just use "register
>plus -(literal) instead".

Note that ADDLW and SUBLW don't exist in the 12 bit core parts.  I have to
be careful when porting existing code written for the 14 bit parts over to
the 12 bit family.

dwayne


Dwayne Reid   <RemoveMEdwaynerEraseMEspamEraseMEplanet.eon.net>
Trinity Electronics Systems Ltd    Edmonton, AB, CANADA
(780) 489-3199 voice          (780) 487-6397 fax

Celebrating 18 years of Engineering Innovation (1984 - 2002)
 .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-
    `-'   `-'   `-'   `-'   `-'   `-'   `-'   `-'   `-'
Do NOT send unsolicited commercial email to this email address.
This message neither grants consent to receive unsolicited
commercial email nor is intended to solicit commercial email.

--
http://www.piclist.com hint: To leave the PICList
RemoveMEpiclist-unsubscribe-requestspam_OUTspamKILLspammitvma.mit.edu


2002\05\17@005329 by Tal Dayan

flavicon
face
My 2c is that they wanted to provide us one more option:

w = w - K  ==>    addlw   -K

w = k - w  ==>    sublw    K     // also  w = -w ==>  sublw  0

Otherwise, sublw would be practically redundant.

Does this makes sense ?

Tal

> {Original Message removed}

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