add Dn=(2)

This commit is contained in:
Raphael Jacquot 2019-02-10 23:00:20 +01:00
parent 43dd894888
commit d6b59740dd
4 changed files with 11 additions and 5 deletions

View file

@ -12,9 +12,11 @@
`define DEC_MEMAXX 12'h152 // 1[45]x[y]
`define DEC_MEMAXX_END 12'h153
`define DEC_PTR_MATH 12'h160 // 1[678C]n D[01]=D[01][+-] (n+1)
`define DEC_D0_EQ_4N 12'h1A0 // 1B
`define DEC_D0_EQ_2N 12'h190 // 19
`define DEC_D0_EQ_4N 12'h1A0 // 1A
`define DEC_D0_EQ_5N 12'h1B0 // 1B
`define DEC_D0_EQ_LOOP 12'h1B1 // 1Bxxxxx (exec)
`define DEC_D1_EQ_2N 12'h1D0 // 1D
`define DEC_D1_EQ_4N 12'h1E0 // 1E
`define DEC_D1_EQ_5N 12'h1F0 // 1F
`define DEC_D1_EQ_LOOP 12'h1F1 // 1[EF]xxxxx (exec)

View file

@ -6,19 +6,21 @@
`include "decstates.v"
`DEC_D0_EQ_2N, `DEC_D1_EQ_2N,
`DEC_D0_EQ_4N, `DEC_D1_EQ_4N,
`DEC_D0_EQ_5N, `DEC_D1_EQ_5N: begin
case (decstate)
`DEC_D0_EQ_2N, `DEC_D1_EQ_2N: t_cnt <= 1;
`DEC_D0_EQ_4N, `DEC_D1_EQ_4N: t_cnt <= 3;
`DEC_D0_EQ_5N, `DEC_D1_EQ_5N: t_cnt <= 4;
endcase
t_ctr <= 1;
case (decstate)
`DEC_D0_EQ_4N, `DEC_D0_EQ_5N: begin
`DEC_D0_EQ_2N, `DEC_D0_EQ_4N, `DEC_D0_EQ_5N: begin
D0[3:0] <= nb_in;
decstate <= `DEC_D0_EQ_LOOP;
end
`DEC_D1_EQ_4N, `DEC_D1_EQ_5N: begin
`DEC_D1_EQ_2N, `DEC_D1_EQ_4N, `DEC_D1_EQ_5N: begin
D1[3:0] <= nb_in;
decstate <= `DEC_D1_EQ_LOOP;
end

View file

@ -16,8 +16,10 @@
t_add_sub <= nb_in[3];
decstate <= `DEC_PTR_MATH;
end
4'h9: decstate <= `DEC_D0_EQ_2N;
4'hA: decstate <= `DEC_D0_EQ_4N;
4'hB: decstate <= `DEC_D0_EQ_5N;
4'hD: decstate <= `DEC_D1_EQ_2N;
4'hE: decstate <= `DEC_D1_EQ_4N;
4'hF: decstate <= `DEC_D1_EQ_5N;
default: begin

View file

@ -360,7 +360,7 @@ always @(posedge ph2) begin
end
always @(posedge ph3) begin
if (cycle_ctr == 260)
if (cycle_ctr == 750)
debug_stop <= 1;
end
@ -433,7 +433,7 @@ always @(posedge dec_strobe) begin
`include "opcodes/13x_ptr_and_AC.v"
`include "opcodes/1[45]_memaccess.v"
`include "opcodes/1[678C]n_D[01]_math_n.v"
`include "opcodes/1[ABEF]nnnnn_D[01]_EQ_5n.v"
`include "opcodes/1[9ABDEF]nnnnn_D[01]_EQ_[245]n.v"
`include "opcodes/2n_P_EQ_n.v"
`include "opcodes/3n[x...]_LC.v"
`include "opcodes/6xxx_GOTO.v"