diff --git a/microcompiler.kt b/microcompiler.kt index c4d2c10..7d11a60 100644 --- a/microcompiler.kt +++ b/microcompiler.kt @@ -267,6 +267,13 @@ fun parseALU(instr: String): MicroInstruction { val args = instr.split(" ") if(args.size != 2) throw RuntimeException("Unexpected arguments: $instr") + try{ + val num = readNumber(args[1], 65535) + return MicroInstruction(ALU.matchName(args[0])!!, num) + }catch(e: NumberFormatException){ + // NaN + } + val source = Register.lookup(args[1]) if(!source.canRead) throw RuntimeException("Cannot read from source: $instr")