Splitting out headers
[uccvend-snackrom.git] / ROM2 / asm.h
1 #ifndef _ASM_H_
2 #define _ASM_H_
3
4 #include "types.h"
5
6 /* these would be inline functions, but gcc won't believe that mask is a constant
7  * when passed as a parameter
8  */
9 #define bset(addr, mask) \
10         asm volatile (       \
11                 "ldx %0\n"       \
12                 "bset 00,x,%1"   \
13                 :                          /* outputs */ \
14                 : "p" (addr), "i" (mask)   /* inputs */  \
15                 : "x"                      /* altered registers */ \
16                 );
17
18 #define bclr(addr, mask) \
19         asm volatile (       \
20                 "ldx %0\n"       \
21                 "bclr 00,x,%1"   \
22                 :                          /* outputs */ \
23                 : "p" (addr), "i" (mask)   /* inputs */  \
24                 : "x"                      /* altered registers */ \
25                 );
26
27 #endif /* _ASM_H_ */

UCC git Repository :: git.ucc.asn.au