aboutsummaryrefslogtreecommitdiff
path: root/src/cpu.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/cpu.ts')
-rw-r--r--src/cpu.ts18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/cpu.ts b/src/cpu.ts
index 8a77bd3..7eff3b3 100644
--- a/src/cpu.ts
+++ b/src/cpu.ts
@@ -1,6 +1,6 @@
/**
* AVR 8 CPU data structures
- * Part of avr8js
+ * Part of AVR8js
*
* Copyright (C) 2019, Uri Shaked
*/
@@ -47,4 +47,20 @@ export class CPU implements ICPU {
}
this.data[addr] = value;
}
+
+ get SP() {
+ return this.dataView.getUint16(93, true);
+ }
+
+ set SP(value: number) {
+ this.dataView.setUint16(93, value, true);
+ }
+
+ get SREG() {
+ return this.data[95];
+ }
+
+ get interruptsEnabled() {
+ return this.SREG & 0x80 ? true : false;
+ }
}