aboutsummaryrefslogtreecommitdiff
path: root/src/instruction.ts
diff options
context:
space:
mode:
authorUri Shaked2019-11-19 17:12:55 +0200
committerUri Shaked2019-11-19 17:12:55 +0200
commite01ae3e0a046b60d1b1d89bd448ca930b9790d29 (patch)
treece291ef7eb75fb3b430bb912326f5bfbd643845a /src/instruction.ts
parentdoc: add some comments (diff)
downloadavr8js-e01ae3e0a046b60d1b1d89bd448ca930b9790d29.tar.gz
avr8js-e01ae3e0a046b60d1b1d89bd448ca930b9790d29.tar.bz2
avr8js-e01ae3e0a046b60d1b1d89bd448ca930b9790d29.zip
feat: implement STX
Diffstat (limited to 'src/instruction.ts')
-rw-r--r--src/instruction.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/instruction.ts b/src/instruction.ts
index f7789d2..63c4caa 100644
--- a/src/instruction.ts
+++ b/src/instruction.ts
@@ -425,7 +425,7 @@ export function avrInstruction(cpu: ICPU) {
/* STX */
if ((opcode & 0xfe0f) === 0x920c) {
- /* not implemented */
+ cpu.writeData(cpu.dataView.getUint16(26, true), cpu.data[(opcode & 0x1f0) >> 4]);
}
/* STX */
@@ -436,7 +436,10 @@ export function avrInstruction(cpu: ICPU) {
/* STX */
if ((opcode & 0xfe0f) === 0x920e) {
- /* not implemented */
+ const i = cpu.data[(opcode & 0x1f0) >> 4];
+ cpu.dataView.setUint16(26, cpu.dataView.getUint16(26, true) - 1, true);
+ cpu.writeData(cpu.dataView.getUint16(26, true), i);
+ cpu.cycles++;
}
/* STY */