piclist 1998\10\26\030852a >
Thread: Can I make a macro to specificy (a bit within a byte) using only one word?
www.piclist.com/techref/index.htm?key=can+make+macro+specificy
flavicon
face BY : g.daniel.invent.designRemoveME@EraseMExtra.co.nz



Ry Lato wrote:
{Quote hidden}

here's how you do your BSF or BCF oneword:

#DEFINE oneword                 one,word
i.e.--
#DEFINE _D0                     GPIO,2
#DEFINE _D1                     GPIO,3


see also below a code section I commonly *.inc into my files,
saves screen space and coding time:

you must EQU the MV1 & MV2 dummy (assembler) variables prior to use.
;M A C R O    D E F I N I T I O N S :     BY GRAHAM DANIEL:
WMOVL   MACRO   MV1,MV2     ; MOVE [LITERAL] INTO [FILE]   2 CYCLES
       MOVLW   MV1
       MOVWF   MV2
       ENDM

WMOVF   MACRO   MV1,MV2     ; MOVE [FILE] TO [FILE]        2 CYCLES
       MOVF    MV1,W
       MOVWF   MV2
       ENDM

BTG     MACRO   MV1,MV2         ; toggle bit of file reg/port
       MOVLW   1 << MV2
       XORWF   MV1,F
       ENDM

regards,
Graham Daniel.

<36342907.536A@xtra.co.nz> 7bit

See also: www.piclist.com/techref/index.htm?key=can+make+macro+specificy
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) Can I make a macro to specificy (a bit within a byte) using only one word?

month overview.

new search...