aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUri Shaked2019-11-19 22:29:05 +0200
committerUri Shaked2019-11-19 22:29:05 +0200
commit237019b2c4a3abc0ad58b1d0b07422e1fa83de6e (patch)
treeb968516bacd1a7cffae6b9c0ed8dd84e5cf31f9c
parentfeat: LDY/LDZ/LDDY/LDDZ instructions + tests (diff)
downloadavr8js-237019b2c4a3abc0ad58b1d0b07422e1fa83de6e.tar.gz
avr8js-237019b2c4a3abc0ad58b1d0b07422e1fa83de6e.tar.bz2
avr8js-237019b2c4a3abc0ad58b1d0b07422e1fa83de6e.zip
doc: avr8js → AVR8js
-rw-r--r--src/cpu.ts18
-rw-r--r--src/instruction.ts2
2 files changed, 18 insertions, 2 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;
+ }
}
diff --git a/src/instruction.ts b/src/instruction.ts
index 7eaa105..a0d7492 100644
--- a/src/instruction.ts
+++ b/src/instruction.ts
@@ -1,6 +1,6 @@
/**
* AVR-8 Instruction Simulation
- * Part of avr8js
+ * Part of AVR8js
* Reference: http://ww1.microchip.com/downloads/en/devicedoc/atmel-0856-avr-instruction-set-manual.pdf
*
* Copyright (C) 2019, Uri Shaked