asm volatile (
"ldx %0\n"
"bset 00,x,%1\n"
- : /* outputs */
- : "m" (addr), "g" (mask) /* inputs */
+ : "=m" (addr) /* outputs */
+ : "g" (mask) /* inputs */
: "x" /* altered registers */
- );
+ );
}
extern inline void bclr(const void* addr, const u8 mask) {
asm volatile (
"ldx %0\n"
"bclr 00,x,%1\n"
- : /* outputs */
- : "m" (addr), "g" (mask) /* inputs */
+ : "=m" (addr) /* outputs */
+ : "g" (mask) /* inputs */
: "x" /* altered registers */
- );
+ );
}
extern inline void lock() {
*/
#define buffered_addr(a) \
extern volatile u8 _##a; \
- u8 a; \
+ volatile u8 a; \
extern inline void set_##a(u8 b) { a = b; _##a = b; } \
- extern inline void bset_##a(const u8 m) { \
- bset(&a, m); \
- asm volatile ( "ldab %1\nstab %0\n" \
- : "=m"(_##a) : "m"(a) : "d"); } \
- extern inline void bclr_##a(const u8 m) { \
- bclr(&a, m); \
- asm volatile ( "ldab %1\nstab %0\n" \
- : "=m"(_##a) : "m"(a) : "d"); }
+ extern inline void bset_##a(const u8 m) { bset((void*)&a, m); _##a = a; } \
+ extern inline void bclr_##a(const u8 m) { bclr((void*)&a, m); _##a = a; }
buffered_addr(changer_output);
buffered_addr(misc_output);