Skip to content

Commit

Permalink
Fix JIN, XCH, INX.
Browse files Browse the repository at this point in the history
  • Loading branch information
ei9 committed Apr 12, 2021
1 parent fae7d6d commit 049b5c3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/sap2_mini.v
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ module ctrl(output[29:0] con, output hlt, input clk,clr,am,az,xm,xz, input[7:0]
assign con[5] = (sc[3] & CMB) | (sc[4] & (ADD|SUB|LDB)); // LB
assign con[4] = (sc[4] & LDX) | (sc[5] & XCH); // LX
assign con[3] = sc[3] & INX; // INX
assign con[2] = (sc[3] & DEX) | (sc[4] & XCH); // DEX
assign con[2] = sc[3] & DEX; // DEX
assign con[1] = sc[4] & XCH; // EX
assign con[0] = sc[3] & OUT; // LO

Expand Down
11 changes: 11 additions & 0 deletions src/tb_sap2_mini.v
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,17 @@ module tb_sap2_mini;
// HLT
// End [Subroutine test]

// Start [Pointer test]
#4 a = 8'h0; d = 12'h004; // LDA 04H
#4 a = 8'h1; d = 12'hf2x; // XCH
#4 a = 8'h2; d = 12'hf4x; // INX
#4 a = 8'h3; d = 12'h905; // JIN 05H
#4 a = 8'h4; d = 12'heff; // EFFH
#4 a = 8'h5; d = 12'hf2x; // XCH
#4 a = 8'h6; d = 12'hfex; // OUT
#4 a = 8'h7; d = 12'hffx; // HLT
// End [Pointer test]

#4 prog = 0; clr = 1;
#4 clr = 0;
end
Expand Down

0 comments on commit 049b5c3

Please sign in to comment.