This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| de:software:homelab:library:bit [2010/07/08 18:17] – angelegt Wember | de:software:homelab:library:bit [2020/07/20 12:00] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== | + | ====== |
| - | Bitwise Operation | + | Die Bibliothek |
| - | Der BitIndex | + | Der Bit-Index |
| - | ===== Funktsioonid | + | ===== Funktionen |
| * **// | * **// | ||
| - | Bit index zu Bitmaske konvertieren. Parameter: | + | Bit-Index |
| - | * //bit// - Bit index. | + | * //bit// - Bit-Index. |
| * Gibt Bitmaske aus. | * Gibt Bitmaske aus. | ||
| * **// | * **// | ||
| - | Setzt ein spezifischen | + | Setzt ein bestimmtes |
| * //value// - Variable. | * //value// - Variable. | ||
| - | * //bit// - Bit index. | + | * //bit// - Bit-Index. |
| * **// | * **// | ||
| - | Löscht ein spezifischen | + | Löscht ein bestimmtes |
| * //value// - Variable. | * //value// - Variable. | ||
| - | * //bit// - Bit index. | + | * //bit// - Bit-Index. |
| * **// | * **// | ||
| - | Setzt ein spezifischen | + | Setzt ein bestimmtes |
| * //value// - Variable. | * //value// - Variable. | ||
| - | * //bit// - Bit index. | + | * //bit// - Bit-Index. |
| - | * //state// - State (//true// or //false//). | + | * //state// - Status |
| * **// | * **// | ||
| - | | + | |
| * //value// - Variable. | * //value// - Variable. | ||
| - | * //bit// - Bit index. | + | * //bit// - Bit-Index. |
| * **// | * **// | ||
| - | | + | |
| * //value// - Variable. | * //value// - Variable. | ||
| - | * //bit// - Bit index. | + | * //bit// - Bit-Index. |
| - | * Returns boolean value // | + | * Gibt den Bool’schen Wert //true//, wenn das Bit gesetzt und // |
| * **// | * **// | ||
| - | | + | |
| * //value// - Variable. | * //value// - Variable. | ||
| - | * //bit// - Bit index. | + | * //bit// - Bit-Index. |
| - | * Returns boolean value // | + | * Gibt den Bool’schen Wert //true//, wenn das Bit gelöscht wurde und// |
| ===== Beispiel ===== | ===== Beispiel ===== | ||
| - | Setzen des dritten Bits in einer 8-Bit Variablen //b// und invertieren | + | Das dritte Bit einer 8-Bit Variablen //b// setzen |
| <code c> | <code c> | ||
| Line 63: | Line 63: | ||
| ===== Quelle ===== | ===== Quelle ===== | ||
| - | + | Nachfolgend | |
| - | Das Folgende ist eine gekürzte Version des Bitweisen Operator | + | |
| <code c> | <code c> | ||
| // | // | ||
| - | // Functions for handling bits. | + | // Funktionen zur Bearbeitung von Bits. |
| // | // | ||
| #define bit_mask(bit) | #define bit_mask(bit) | ||
| Line 79: | Line 78: | ||
| // | // | ||
| - | // Functions for handling bit masks. | + | // Funktionen zur Bearbeitung von Bitmasken. |
| // | // | ||
| #define bitmask_set(value, | #define bitmask_set(value, | ||