diff options
| author | Uri Shaked | 2019-11-19 22:29:05 +0200 |
|---|---|---|
| committer | Uri Shaked | 2019-11-19 22:29:05 +0200 |
| commit | 237019b2c4a3abc0ad58b1d0b07422e1fa83de6e (patch) | |
| tree | b968516bacd1a7cffae6b9c0ed8dd84e5cf31f9c /src | |
| parent | feat: LDY/LDZ/LDDY/LDDZ instructions + tests (diff) | |
| download | avr8js-237019b2c4a3abc0ad58b1d0b07422e1fa83de6e.tar.gz avr8js-237019b2c4a3abc0ad58b1d0b07422e1fa83de6e.tar.bz2 avr8js-237019b2c4a3abc0ad58b1d0b07422e1fa83de6e.zip | |
doc: avr8js → AVR8js
Diffstat (limited to '')
| -rw-r--r-- | src/cpu.ts | 18 | ||||
| -rw-r--r-- | src/instruction.ts | 2 |
2 files changed, 18 insertions, 2 deletions
@@ -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 |
