aboutsummaryrefslogtreecommitdiff
path: root/src/cpu.spec.ts
diff options
context:
space:
mode:
authorUri Shaked2019-11-27 09:42:08 +0200
committerUri Shaked2019-11-27 09:42:08 +0200
commitd8d169566094c70417c646275b51918458f98dbf (patch)
treeb487976bfedc19cb7509c59793d10ad4ddb8962f /src/cpu.spec.ts
parentchore: release 0.3.0 (diff)
downloadavr8js-d8d169566094c70417c646275b51918458f98dbf.tar.gz
avr8js-d8d169566094c70417c646275b51918458f98dbf.tar.bz2
avr8js-d8d169566094c70417c646275b51918458f98dbf.zip
fix: SP not initialized on reset
close #2
Diffstat (limited to 'src/cpu.spec.ts')
-rw-r--r--src/cpu.spec.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/cpu.spec.ts b/src/cpu.spec.ts
new file mode 100644
index 0000000..92df7ee
--- /dev/null
+++ b/src/cpu.spec.ts
@@ -0,0 +1,8 @@
+import { CPU } from './cpu';
+
+describe('cpu', () => {
+ it('should set initial value of SP to the last address of internal SRAM', () => {
+ const cpu = new CPU(new Uint16Array(1024), 0x1000);
+ expect(cpu.SP).toEqual(0x10ff);
+ });
+});