GE-115 Emulator
An Emulator of the General Electrics GE-115 computer
bit.h
Go to the documentation of this file.
1
6#ifndef bit_h
7#define bit_h
8
9#define BIT(V, X) ( !!(V & (1 << X)))
10#define SET_BIT(R, X) (R = (R | (1 << X)))
11#define RESET_BIT(R, X) (R = (R & ~(1 << X)))
12
13/* uses manual notation */
14/* [ 4 | 3 | 2 | 1 ] for 16 bits and [ 2 | 1 ] for 8 bits */
15#define NIBBLE_MASK(X) (0xf << ((X-1)*4))
16
17#endif