bitops.h File Reference

Internal Interface: H8/300 bit operations. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ASMCONST   const
 
#define bit_set(byte, bit)   __asm__ ASMCONST ( "bset %0,@%1\n" : : "i" (bit),"r" (byte))
 set a single bit in memory More...
 
#define bit_clear(byte, bit)   __asm__ ASMCONST ( "bclr %0,@%1\n" : : "i" (bit),"r" (byte))
 clear a single bit in memory More...
 
#define bit_load(mask, bit)   __asm__ ASMCONST ( "bld %0,%1l\n" : : "i" (bit),"r" (mask):"cc")
 load a single bit from a mask to the carry flag More...
 
#define bit_iload(mask, bit)   __asm__ ASMCONST ( "bild %0,%1l\n" : : "i" (bit),"r" (mask):"cc")
 load the inverse of a single bit from a mask to the carry flag More...
 
#define bit_store(byte, bit)   __asm__ ASMCONST ( "bst %0,@%1\n" : : "i" (bit),"r" (byte))
 store the carry flag to a single single bit in memory More...
 

Detailed Description

Internal Interface: H8/300 bit operations.

Author
Markus L. Noga marku.nosp@m.s@no.nosp@m.ga.de

Definition in file bitops.h.

Macro Definition Documentation

§ ASMCONST

#define ASMCONST   const

Definition at line 45 of file bitops.h.

§ bit_clear

#define bit_clear (   byte,
  bit 
)    __asm__ ASMCONST ( "bclr %0,@%1\n" : : "i" (bit),"r" (byte))

clear a single bit in memory

((char*)byte)&=~(1<<bit)

Definition at line 65 of file bitops.h.

Referenced by ds_passive(), and ds_rotation_off().

§ bit_iload

#define bit_iload (   mask,
  bit 
)    __asm__ ASMCONST ( "bild %0,%1l\n" : : "i" (bit),"r" (mask):"cc")

load the inverse of a single bit from a mask to the carry flag

carry=mask & inverse of (1<<bit)

Definition at line 77 of file bitops.h.

§ bit_load

#define bit_load (   mask,
  bit 
)    __asm__ ASMCONST ( "bld %0,%1l\n" : : "i" (bit),"r" (mask):"cc")

load a single bit from a mask to the carry flag

carry=mask & (1<<bit)

Definition at line 71 of file bitops.h.

Referenced by delay().

§ bit_set

#define bit_set (   byte,
  bit 
)    __asm__ ASMCONST ( "bset %0,@%1\n" : : "i" (bit),"r" (byte))

set a single bit in memory

*((char*)byte)|=(1<<bit)

Definition at line 59 of file bitops.h.

Referenced by ds_active(), and ds_rotation_on().

§ bit_store

#define bit_store (   byte,
  bit 
)    __asm__ ASMCONST ( "bst %0,@%1\n" : : "i" (bit),"r" (byte))

store the carry flag to a single single bit in memory

*((char*)byte)= ( (*((char*)byte)) & (~(1<<bit)) ) | (carry<<bit)

Definition at line 83 of file bitops.h.


brickOS is released under the Mozilla Public License.
Original code copyright 1998-2005 by the authors.

Generated for brickOS Kernel Developer by doxygen 1.8.12