From 237019b2c4a3abc0ad58b1d0b07422e1fa83de6e Mon Sep 17 00:00:00 2001 From: Uri Shaked Date: Tue, 19 Nov 2019 22:29:05 +0200 Subject: doc: avr8js → AVR8js --- src/cpu.ts | 18 +++++++++++++++++- src/instruction.ts | 2 +- 2 files changed, 18 insertions(+), 2 deletions(-) (limited to 'src') 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 -- cgit v1.2.3