Avr8bit-emulator
An emulator for the Atmel AVR 8-bit microcontroller
Loading...
Searching...
No Matches
core.h
Go to the documentation of this file.
1#pragma once
2
3#include <stdint.h>
4#include <stdbool.h>
5
10union SREG {
11 uint8_t sreg;
12 struct {
13 bool C: 1;
14 bool Z: 1;
15 bool N: 1;
16 bool V: 1;
17 bool S: 1;
18 bool H: 1;
19 bool T: 1;
20 bool I: 1;
21 };
22};
23
28union GP {
29 uint8_t R[32];
30 struct {
31 uint8_t R0;
32 uint8_t R1;
33 uint8_t R2;
34 uint8_t R3;
35 uint8_t R4;
36 uint8_t R5;
37 uint8_t R6;
38 uint8_t R7;
39 uint8_t R8;
40 uint8_t R9;
41 uint8_t R10;
42 uint8_t R11;
43 uint8_t R12;
44 uint8_t R13;
45 uint8_t R14;
46 uint8_t R15;
47 uint8_t R16;
48 uint8_t R17;
49 uint8_t R18;
50 uint8_t R19;
51 uint8_t R20;
52 uint8_t R21;
53 uint8_t R22;
54 uint8_t R23;
55 uint8_t R24;
56 uint8_t R25;
57 uint16_t X;
58 uint16_t Y;
59 uint16_t Z;
60 };
61};
62
67struct CORE {
68 union GP gp;
69 uint32_t PC;
70 uint16_t SP;
71 union SREG sreg;
72};
73
74void inc_pc(struct CORE *core);
void inc_pc(struct CORE *core)
Definition core.c:3
Core structure containing general purpose registers, program counter, stack pointer,...
Definition core.h:67
union GP gp
Definition core.h:68
uint16_t SP
Definition core.h:70
uint32_t PC
Definition core.h:69
union SREG sreg
Definition core.h:71
General Purpose Registers.
Definition core.h:28
uint8_t R11
Definition core.h:42
uint8_t R16
Definition core.h:47
uint8_t R13
Definition core.h:44
uint8_t R6
Definition core.h:37
uint8_t R5
Definition core.h:36
uint8_t R9
Definition core.h:40
uint8_t R4
Definition core.h:35
uint8_t R21
Definition core.h:52
uint8_t R14
Definition core.h:45
uint8_t R19
Definition core.h:50
uint8_t R8
Definition core.h:39
uint8_t R20
Definition core.h:51
uint8_t R7
Definition core.h:38
uint8_t R25
Definition core.h:56
uint8_t R22
Definition core.h:53
uint8_t R17
Definition core.h:48
uint8_t R23
Definition core.h:54
uint8_t R2
Definition core.h:33
uint16_t Y
Definition core.h:58
uint8_t R10
Definition core.h:41
uint8_t R12
Definition core.h:43
uint8_t R15
Definition core.h:46
uint8_t R18
Definition core.h:49
uint8_t R24
Definition core.h:55
uint8_t R0
Definition core.h:31
uint8_t R[32]
Definition core.h:29
uint8_t R3
Definition core.h:34
uint16_t Z
Definition core.h:59
uint8_t R1
Definition core.h:32
uint16_t X
Definition core.h:57
Status Register.
Definition core.h:10
bool N
Definition core.h:15
bool C
Definition core.h:13
bool V
Definition core.h:16
bool Z
Definition core.h:14
bool I
Definition core.h:20
bool H
Definition core.h:18
bool S
Definition core.h:17
uint8_t sreg
Definition core.h:11
bool T
Definition core.h:19