ldih/l
[calu.git] / cpu / src / alu_b.vhd
index e19b52dfd544cbdb0a4eb4b5d0f9036ff3fbb4b9..a7374face2fa6497cad465f36a972af0acf01fcf 100755 (executable)
@@ -132,7 +132,18 @@ begin
                --right_o <= displacement;
                addr <= std_logic_vector(unsigned(left_operand)+unsigned(displacement));
                 if op_detail(IMM_OPT) = '1' then
-                        result_v.result := right_operand;
+                                        
+                                                               result_v.result := right_operand;
+                                        
+                                                               if (op_detail(LDI_REPLACE_OPT) = '0') then
+                                                                       result_v.result := left_operand;
+                                                                       if (op_detail(LOW_HIGH_OPT) = '1') then
+                                                                               result_v.result(31 downto 16) := right_operand(31 downto 16);
+                                                                       else
+                                                                               result_v.result(15 downto 0) := right_operand(15 downto 0);
+                                                                       end if;
+                                                               end if;
+
                         res_prod := '1';
                         mem_op := '0';
                                                                addr(DATA_ADDR_WIDTH + 2) <= '0';