aboutsummaryrefslogtreecommitdiff
path: root/src/cpu/registers.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/cpu/registers.h')
-rw-r--r--src/cpu/registers.h21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/cpu/registers.h b/src/cpu/registers.h
index edb6b7b..d2f2e74 100644
--- a/src/cpu/registers.h
+++ b/src/cpu/registers.h
@@ -5,13 +5,22 @@
namespace x86 {
struct cpu_state {
- /* pusha */
- uint32_t edi, esi; // destination index, source index
- uint32_t ebp, esp; // base pointer, stack pointer
- uint32_t ebx, edx, ecx, eax; // general registers
+ /* registers stored by pusha */
+ // indexes and pointers
+ uint32_t edi; // destination index: string, memory copying and setting, far pointer addressing with ES
+ uint32_t esi; // source index: string and memory copying
+ uint32_t ebp; // stack base pointer
+ const uint32_t esp; // stack pointer; this register is not used by popa
- uint32_t irq;
- uint32_t error;
+ // general registers
+ uint32_t ebx; // base register: base pointer for memory access
+ uint32_t edx; // data register: I/O ports, arithmetic
+ uint32_t ecx; // counter register: loop counter, for shifts
+ uint32_t eax; // accumulator register: I/O ports, arithmetic
+
+ /* pushed by interrupt handler macros */
+ uint32_t irq; // interrupt number
+ uint32_t error; // error code
/* stack frame, pushed by cpu */
uint32_t eip;