hp-saturn/opcodes/6xxx_GOTO.v

34 lines
930 B
Coq
Raw Normal View History

2019-02-07 22:54:06 +01:00
/******************************************************************************
* 6xxx GOTO xxx
*
*
*/
`include "decstates.v"
2019-02-08 19:09:13 +01:00
`include "bus_commands.v"
2019-02-07 22:54:06 +01:00
`DEC_GOTO: begin
//$display("DEC_GOTO : nibble %h", nibble);
jump_base <= PC;
jump_offset <= 0;
t_cnt <= 2;
t_ctr <= 1;
2019-02-09 19:18:58 +01:00
jump_offset[3:0] <= nb_in;
2019-02-07 22:54:06 +01:00
decstate <= `DEC_GOTO_LOOP;
end
`DEC_GOTO_LOOP: begin
//$display("jump_base %h | t_cnt %d | t_ctr %d | jump_offset %h", jump_base, t_cnt, t_ctr, jump_offset);
2019-02-09 19:18:58 +01:00
jump_offset[t_ctr*4+:4] <= nb_in;
2019-02-07 22:54:06 +01:00
if (t_ctr == t_cnt) begin
2019-02-09 19:18:58 +01:00
new_PC <= jump_base + {8'h00, nb_in, jump_offset[7:0]};
2019-02-08 19:09:13 +01:00
next_cycle <= `BUSCMD_LOAD_PC;
decstate <= `DEC_START;
2019-02-07 22:54:06 +01:00
`ifdef SIM
2019-02-08 19:09:13 +01:00
$display("%5h GOTO\t%3h\t=> %05h",
inst_start_PC,
2019-02-09 19:18:58 +01:00
{nb_in, jump_offset[7:0]},
jump_base + {8'h00, nb_in, jump_offset[7:0]});
2019-02-07 22:54:06 +01:00
`endif
2019-02-08 19:09:13 +01:00
end else t_ctr <= t_ctr + 1;
2019-02-07 22:54:06 +01:00
end