diff options
| author | Uri Shaked | 2020-03-22 21:12:03 +0200 |
|---|---|---|
| committer | GitHub | 2020-03-22 21:12:03 +0200 |
| commit | b3dc0329a8a7bfb8350ddc71719d4348dd4ed66c (patch) | |
| tree | e85d52944ce76ac604e276f25859a26d38a0afd0 /src/interrupt.ts | |
| parent | Merge pull request #25 from LironHazan/AVR8JS-24-editor-user-history (diff) | |
| parent | refactor: added peripherals and cpu feature folders (diff) | |
| download | avr8js-b3dc0329a8a7bfb8350ddc71719d4348dd4ed66c.tar.gz avr8js-b3dc0329a8a7bfb8350ddc71719d4348dd4ed66c.tar.bz2 avr8js-b3dc0329a8a7bfb8350ddc71719d4348dd4ed66c.zip | |
Merge pull request #22 from LironHazan/AVR8JS-21-restructure-project
refactor: add peripherals and cpu feature folders
Diffstat (limited to 'src/interrupt.ts')
| -rw-r--r-- | src/interrupt.ts | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/src/interrupt.ts b/src/interrupt.ts deleted file mode 100644 index 1c7d835..0000000 --- a/src/interrupt.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * AVR-8 Interrupt Handling - * Part of AVR8js - * Reference: http://ww1.microchip.com/downloads/en/devicedoc/atmel-0856-avr-instruction-set-manual.pdf - * - * Copyright (C) 2019, Uri Shaked - */ - -import { ICPU } from './cpu'; - -export function avrInterrupt(cpu: ICPU, addr: number) { - const sp = cpu.dataView.getUint16(93, true); - cpu.data[sp] = cpu.pc & 0xff; - cpu.data[sp - 1] = (cpu.pc >> 8) & 0xff; - cpu.dataView.setUint16(93, sp - 2, true); - cpu.data[95] &= 0x7f; // clear global interrupt flag - cpu.cycles += 2; - cpu.pc = addr; -} |
