Searching \ for 'Simplfying Code ?' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/index.htm?key=simplfying+code
Search entire site for: 'Simplfying Code ?'.

Truncated match.
PICList Thread
'Simplfying Code ?'
1997\03\10@091449 by Joe West

flavicon
face
Greetings:

Can a register and a particular bit be assigned a name.

ie...

btfss    snyc

Where snyc would represent 6,1

I tried equate with no luck, maybe a macro ?

Joseph D. West
Electronics Lab. Supervisor
College of Mechanical Eng.
Ohio State University

(614) 292-2845
Fax (614) 292-3163

1997\03\10@094400 by Antti Lukats

flavicon
face
#define snyc 6,1
btfss snyc

At 10:39 AM 10/3/97 -0600, you wrote:
{Quote hidden}

-- Silicon Studio Ltd.
-- http://www.sistudio.com

1997\03\10@142254 by mike

flavicon
picon face
In message  <spam_OUT199703101403.JAA05256TakeThisOuTspammail4.uts.ohio-state.edu>> .....PICLISTKILLspamspam@spam@MITVMA.MIT.EDU writes:
> Greetings:
>
>  Can a register and a particular bit be assigned a name.
>
> ie...
>
> btfss    snyc
>
> Where snyc would represent 6,1
>
> I tried equate with no luck, maybe a macro ?
>
Joseph,

I use #define. eg:

#define sync  6, 1
...

   btfss  sync

I find this to be invaluable for defining what is connected to the
pins on the PIC. For example, in a prototype I may have IIC memory.
SDA connected to porta, 0 and SCL to porta, 1.

In my code I would have

#define SDA porta, 0
#define SCL porta, 1

and later would have a routine which read data from the IIC device
and would refer to the port pins using only SDA and SCL:

 bcf   SDA         ; example only - not proper code :-)
 bsf   SCL
 bcf   SCL
 btfss SDA
 ...
 return

When I come to layout the PCB, I might find that the layout is
significantly easier if the pins were swapped. All I need to do
is change the #define lines.

Also, if you want to change the direction of the port pin you
can use the same #defined text. eg:

 bsf  status, rp0      ; goto page 1

 bsf  trisa, 0         ; produces the same code as
 bsf  SDA

 bcf  status, rp0      ; back to page 1

I hope this helps,

Mike Watson

1997\03\10@155355 by Octavio Nogueira

flavicon
face
>  Can a register and a particular bit be assigned a name.
>
> ie...
>
> btfss    snyc
>
> Where snyc would represent 6,1
>
> I tried equate with no luck, maybe a macro ?

Try this:

#define snyc 6,1

Regards,

Octavio
========================================================
Octavio Nogueira
e-mail:   nogueiraspamKILLspammandic.com.br
homepage: www.geocities.com/SiliconValley/Pines/6902/index.html
voice/fax: +55 11 240-6474
"ProPic" The first Production PIC Programmer running in
Windows and under US$ 20.00.
========================================================

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