From d8d169566094c70417c646275b51918458f98dbf Mon Sep 17 00:00:00 2001 From: Uri Shaked Date: Wed, 27 Nov 2019 09:42:08 +0200 Subject: fix: SP not initialized on reset close #2 --- src/cpu.spec.ts | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 src/cpu.spec.ts (limited to 'src/cpu.spec.ts') 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); + }); +}); -- cgit v1.2.3