hp-saturn/opcodes/13x_ptr_and_AC.v
Raphael Jacquot 9799ea7618 use the ALU for 13x opcodes
comment debug code
add some debug code elsewhere
2019-02-11 13:17:18 +01:00

36 lines
876 B
Verilog

/******************************************************************************
* 13X
*
*
*/
`include "decstates.v"
`DEC_13X: begin
field <= `T_FIELD_A;
alu_first <= 0;
alu_last <= nb_in[3]?3:4;
alu_reg_dest <= {1'b0, !nb_in[1], nb_in[2] && nb_in[1], !nb_in[1] && nb_in[0]};
alu_reg_src1 <= {1'b0, nb_in[1], nb_in[2] && !nb_in[1], nb_in[1] && nb_in[0]};
alu_op <= nb_in[1]?`ALU_OP_EXCH:`ALU_OP_COPY;
next_cycle <= `BUSCMD_NOP;
decstate <= `DEC_ALU_INIT;
alu_return <= `DEC_START;
alu_debug <= 1;
`ifdef SIM
$write("%5h ", inst_start_PC);
if (!nb_in[1])
$write("D");
else
$write("%sD", nb_in[3]?"C":"A");
$write("%b", nb_in[0]);
if (!nb_in[1])
$write("=%s%s", nb_in[2]?"C":"A", nb_in[3]?"S":"");
else
$write("%s", nb_in[3]?"XS":"EX");
$display("");
`endif
end