From bba230fbce1e228dca7a9d8b88a28b77202a990e Mon Sep 17 00:00:00 2001 From: "(Tim) Efthimis Kritikos" Date: Fri, 10 Feb 2023 15:30:59 +0000 Subject: [PATCH] Added the MOV immediate to register instruction --- cpu/boot_code.asm | 1 + cpu/processor.v | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/cpu/boot_code.asm b/cpu/boot_code.asm index 4b013f9..87220fa 100644 --- a/cpu/boot_code.asm +++ b/cpu/boot_code.asm @@ -1,3 +1,4 @@ +MOV CX,#0x1234 ADD AX,#0xDEAD ADD CX,#0xBEEF ADD CX,#0x4111 diff --git a/cpu/processor.v b/cpu/processor.v index 64defe5..e6e8271 100644 --- a/cpu/processor.v +++ b/cpu/processor.v @@ -73,7 +73,7 @@ mux4 #(.WIDTH(16)) MUX16_1A( ADDER16_1A); mux4 #(.WIDTH(16)) MUX16_1B( - 16'b0, + PARAM2, reg_read_data, 16'b0, 16'b0, @@ -186,6 +186,20 @@ always @(posedge clock) begin end endcase end + 6'b101100, + 6'b101101, + 6'b101110, + 6'b101111 : begin + /*Move Immediate to register*/ + unaligned_access=~unaligned_access; + in1_sel=2'b00; + in2_sel=2'b00; + out_sel=2'b11; + reg_addr=CIR[10:8]; + ALU_OUT=0; + PARAM2=0; + state=`PROC_DE_LOAD_16_PARAM; + end 6'b111111 : begin /* INC */ if (CIR[9:9] == 1 ) begin