GE-115 Emulator
An Emulator of the General Electrics GE-115 computer
Main Page
Related Pages
Topics
Data Structures
Files
File List
Globals
alu_cc.c
Go to the documentation of this file.
1
#include "
alu_cc.h
"
2
#include "
bit.h
"
3
4
void
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
18
uint8_t
alu_get_cc
(
struct
ge
*
ge
)
19
{
20
return
(uint8_t)((
BIT
(
ge
->
ffFI
, 4) << 1) |
BIT
(
ge
->
ffFI
, 5));
21
}
alu_get_cc
uint8_t alu_get_cc(struct ge *ge)
Definition
alu_cc.c:18
alu_set_cc
void alu_set_cc(struct ge *ge, uint8_t cc)
Definition
alu_cc.c:4
alu_cc.h
bit.h
Bit manipulation helpers.
BIT
#define BIT(V, X)
Definition
bit.h:9
SET_BIT
#define SET_BIT(R, X)
Definition
bit.h:10
RESET_BIT
#define RESET_BIT(R, X)
Definition
bit.h:11
ge
The entire state of the emulated system, including registers, memory, peripherals and timings.
Definition
ge.h:96
ge::ffFI
uint8_t ffFI
Special conditions register 1.
Definition
ge.h:253
Generated by
1.9.8