GE-115 Emulator
An Emulator of the General Electrics GE-115 computer
alu_cc.c
Go to the documentation of this file.
1#include "alu_cc.h"
2#include "bit.h"
3
4void alu_set_cc(struct ge *ge, uint8_t cc)
5{
6 /* cc bit1 -> ffFI bit4 (high), cc bit0 -> ffFI bit5 (low) */
7 if (cc & 0x2)
8 SET_BIT(ge->ffFI, 4);
9 else
10 RESET_BIT(ge->ffFI, 4);
11
12 if (cc & 0x1)
13 SET_BIT(ge->ffFI, 5);
14 else
15 RESET_BIT(ge->ffFI, 5);
16}
17
18uint8_t alu_get_cc(struct ge *ge)
19{
20 return (uint8_t)((BIT(ge->ffFI, 4) << 1) | BIT(ge->ffFI, 5));
21}
uint8_t alu_get_cc(struct ge *ge)
Definition alu_cc.c:18
void alu_set_cc(struct ge *ge, uint8_t cc)
Definition alu_cc.c:4
Bit manipulation helpers.
#define BIT(V, X)
Definition bit.h:9
#define SET_BIT(R, X)
Definition bit.h:10
#define RESET_BIT(R, X)
Definition bit.h:11
The entire state of the emulated system, including registers, memory, peripherals and timings.
Definition ge.h:96
uint8_t ffFI
Special conditions register 1.
Definition ge.h:253