--- /dev/null
+#ifndef _ASM_H_
+#define _ASM_H_
+
+#include "types.h"
+
+/* these would be inline functions, but gcc won't believe that mask is a constant
+ * when passed as a parameter
+ */
+#define bset(addr, mask) \
+ asm volatile ( \
+ "ldx %0\n" \
+ "bset 00,x,%1" \
+ : /* outputs */ \
+ : "p" (addr), "i" (mask) /* inputs */ \
+ : "x" /* altered registers */ \
+ );
+
+#define bclr(addr, mask) \
+ asm volatile ( \
+ "ldx %0\n" \
+ "bclr 00,x,%1" \
+ : /* outputs */ \
+ : "p" (addr), "i" (mask) /* inputs */ \
+ : "x" /* altered registers */ \
+ );
+
+#endif /* _ASM_H_ */