From 09ecc558981eb574bca428a1d2bb75ea41577b82 Mon Sep 17 00:00:00 2001 From: Gabriel Tofvesson Date: Wed, 10 Apr 2019 00:11:55 +0200 Subject: [PATCH] Implement RESET uASM instruction --- README.md | 6 ++++++ microcompiler.kt | 1 + 2 files changed, 7 insertions(+) diff --git a/README.md b/README.md index cc09b7b..542f3ac 100644 --- a/README.md +++ b/README.md @@ -225,6 +225,12 @@ Branch to address of label if **C-flag** is 0. Branch to address of label if **O-flag** is 0. +### RESET [reg] +Sets all bits in the specified register to 1. + +*This operation uses the bus* + + ## Compiler/weaver directives ### \#define \[name] [const] diff --git a/microcompiler.kt b/microcompiler.kt index 4921ba6..f1c4dd8 100644 --- a/microcompiler.kt +++ b/microcompiler.kt @@ -350,6 +350,7 @@ fun parseInstruction(line: String): MicroInstruction? { else if(shave == "halt") return MicroInstruction(ALU.NOP, ToBus.NONE, FromBus.NONE, false, false, LoopCounter.NONE, SEQ.HALT) else if(shave.startsWith("lcset")) return parseLCSet(shave) else if(shave == "declc") return MicroInstruction(ALU.NOP, ToBus.NONE, FromBus.NONE, false, false, LoopCounter.DEC, SEQ.INC) + else if(shave.startsWith("reset")) return MicroInstruction(ALU.NOP, ToBus.NONE, FromBus.locate(Register.lookup(shave.substring(6))!!.busValue), false, false, LoopCounter.NONE, SEQ.INC) else throw RuntimeException("Unknown instruction: $shave") }else{ var result: MicroInstruction? = null