Searching \ for '[PIC]Assembler - comparing with value' 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: 'Assembler - comparing with value'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]Assembler - comparing with value'
2004\10\14@074110 by Mcgee, Mark

flavicon
face
> Hi
>
> I'm using PIC16F628, writing my first PIC program.  How am I best to compare
a file location A with a literal value B, for equality?
>
> The best I can come up with is to XOR A with B and check for zero flag.  Is
this recommended?
>
> Come to think about it, how would one compare for greater-than or less-than?
subtract and test for overflow/underflow?  Can you test for overflow (no docs
with me here at work)?
>
> Regards,
> Mark

==============================================================================
This message is for the sole use of the intended recipient. If you received
this message in error please delete it and notify us. If this message was
misdirected, CSFB does not waive any confidentiality or privilege. CSFB
retains and monitors electronic communications sent through its network.
Instructions transmitted over this system are not binding on CSFB until they
are confirmed by us. Message transmission is not guaranteed to be secure.
==============================================================================

_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\14@083559 by Dave Wheeler

flavicon
face
Hi Mark,

This is how I do it..

Equal to

   movf REGA,W
   xorwf REGB,W
   btfsc STATUS,Z
   goto SOMEHERE

Greater than
   movf REGA,W
   subwf REGB,W
   btfss STATUS,C
   goto SOMEHERE


less than
   movf REGB,W
   subwf REGA,W
   btfss STATUS,C
   goto SOMEHERE

Regards,

Dave


Mcgee, Mark wrote:

{Quote hidden}

_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\14@083629 by William Bross

picon face
Mark,

check the Piclist site at:

http://www.piclist.com/techref/microchip/compcon.htm

This is the comparisons page.  lots of other stuff here too.

Bill

> {Original Message removed}

2004\10\14@083728 by Jinx

face picon face
www.piclist.com/techref/microchip/compcon.htm

_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\14@084807 by Mcgee, Mark

flavicon
face
Thanks for the link, very useful.

Mark

{Quote hidden}

==============================================================================
This message is for the sole use of the intended recipient. If you received
this message in error please delete it and notify us. If this message was
misdirected, CSFB does not waive any confidentiality or privilege. CSFB
retains and monitors electronic communications sent through its network.
Instructions transmitted over this system are not binding on CSFB until they
are confirmed by us. Message transmission is not guaranteed to be secure.
==============================================================================

_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\14@085800 by Mcgee, Mark

flavicon
face
Thanks Dave

Good to know I'm thinking along the right lines.

6502/6510 on which I cut most of my assembler teeth many years ago, used to
have CMP IIRC, so I thought I'd ask in case I'd missed something.

Cheers,
Mark

> {Original Message removed}

2004\10\14@091611 by John J. McDonough

flavicon
face
----- Original Message -----
From: "Mcgee, Mark" <mark.mcgeespamspam_OUTcsfb.com>
To: "'Microcontroller discussion list - Public.'" <@spam@piclistKILLspamspammit.edu>
Sent: Thursday, October 14, 2004 8:57 AM
Subject: RE: [PIC]Assembler - comparing with value


> 6502/6510 on which I cut most of my assembler teeth many years ago, used
to
> have CMP IIRC, so I thought I'd ask in case I'd missed something.

Mark

I, too, grew up on the 6502, and the PIC is a LOT different.  As a RISC
processor, and a Harvard Architecture processor at that, much of the cool
indexing instructions of the 6502 are lacking.  Maybe the most confusing,
though, is that the add and subtract aren't nearly as complete.  On the
other hand, like the 6502, it is very logically laid out, and with only 35
instructions to learn, it's pretty quick to get your head around it.  And
even though it is lacking the 6502's X and Y registers, there are some
rather perverted ways to get to the same place <g>.

--McD


_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\14@093308 by Mcgee, Mark

flavicon
face
I'm really enjoying learning this 'PIC' stuff - what do you call the PIC
assembler anyway?

The interrupt and timer stuff reminds me very much of the CBM64 raster
interrupts I used to play with!  Good fun.

Like you say, very logically organised like the 6502.  Not too dissimilar at
all really, apart from the indirect, and idexed stuff.  But that's all nice
stuff, not really essential.

Cheers,
Mark

> {Original Message removed}

2004\10\14@093612 by Alan B. Pearce

face picon face
> Hi Mark,
>
> This is how I do it..

Also have a look at Olin's macros (yeah, I know I have gone on about them
recently) as he has ones which are pretty intuitive to use.

http://www.embedinc.com/pic/ and down the bottom to software downloads.

_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\14@095950 by hael Rigby-Jones

picon face


>-----Original Message-----
>From: KILLspampiclist-bouncesKILLspamspammit.edu [RemoveMEpiclist-bouncesTakeThisOuTspammit.edu]
>On Behalf Of Mcgee, Mark
>Sent: 14 October 2004 14:33
>To: 'Microcontroller discussion list - Public.'
>Subject: RE: [PIC]Assembler - comparing with value
>
>
>I'm really enjoying learning this 'PIC' stuff - what do you
>call the PIC assembler anyway?
>

The Microchip assembler is called MPASM.  There are others such as the GNU
licensced GPASM and several third party toolsets such as Parallax's 'SPASM',
Tech-tools CVASM to name a few.  Most Windows users seem to stick to MPASM
though.

>The interrupt and timer stuff reminds me very much of the
>CBM64 raster interrupts I used to play with!  Good fun.
>
>Like you say, very logically organised like the 6502.  Not too
>dissimilar at all really, apart from the indirect, and idexed
>stuff.  But that's all nice stuff, not really essential.

Remember that you still have indirect addressing via the INDF and FSR
registers.  Not as powerfull as many 8 bit CPU's such as the 6502, but very
usefull nonetheless.

Regards

Mike

=======================================================================
This e-mail is intended for the person it is addressed to only. The
information contained in it may be confidential and/or protected by
law. If you are not the intended recipient of this message, you must
not make any use of this information, or copy or show it to any
person. Please contact us immediately to tell us that you have
received this e-mail, and return the original to us. Any use,
forwarding, printing or copying of this message is strictly prohibited.
No part of this message can be considered a request for goods or
services.
=======================================================================
_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\14@143212 by Andrew Warren

flavicon
face
William Bross <spamBeGonepiclistspamBeGonespammit.edu> wrote:

> www.piclist.com/techref/microchip/compcon.htm
>
> This is the comparisons page.  lots of other stuff here too.

   Yeah, and some of the code even works.

   -Andy

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

_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

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