From a659abea2af569e5c91ffb6f5c4d8125a9ccff31 Mon Sep 17 00:00:00 2001 From: Arthur Lu Date: Sat, 13 Aug 2022 23:34:46 +0000 Subject: [PATCH] add new instruction support :DNE, move devcontainer to firmware folder, implement RTL ALU PC RegFile, --- firmware/assembler.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/firmware/assembler.py b/firmware/assembler.py index 162907b..67f06fd 100644 --- a/firmware/assembler.py +++ b/firmware/assembler.py @@ -37,6 +37,7 @@ op_type = { 'PTY': 'G', 'CHK': 'A', 'XOR': 'A', + 'DNE': 'N', 'JNZ': 'G', 'JEZ': 'G', 'JMP': 'G', @@ -59,6 +60,7 @@ op_codes = { 'PTY': 0b0_1000_1000, 'CHK': 0b0_1001_0000, 'XOR': 0b0_1010_0000, + 'DNE': 0b0_1011_1111, 'JNZ': 0b0_1110_0000, 'JEZ': 0b0_1110_1000, 'JMP': 0b0_1111_0000, @@ -73,6 +75,8 @@ def get_reg(type, opcode): return reg_map[opcode] elif type == 'A': return reg_map[opcode] + elif type == 'N': + return 0 else: print('invalid opcode detected: ' + opcode) exit(1)