- cmp abs
- cmp abs, x
- cmp indir, y supported.
- test case added.
front_we(acc_cmd, '1');
front_we(x_cmd, '1');
front_we(y_cmd, '1');
front_we(acc_cmd, '1');
front_we(x_cmd, '1');
front_we(y_cmd, '1');
end procedure;
procedure a2_abs_xy (is_x : in boolean) is
end procedure;
procedure a2_abs_xy (is_x : in boolean) is
elsif instruction = conv_std_logic_vector(16#d5#, dsize) then
--zp, x
d_print("cmp");
elsif instruction = conv_std_logic_vector(16#d5#, dsize) then
--zp, x
d_print("cmp");
+ a2_zp_xy(true);
+ if exec_cycle = T3 then
+ arith_en_n <= '0';
+ back_oe(acc_cmd, '0');
+ set_nzc_from_alu;
+ end if;
elsif instruction = conv_std_logic_vector(16#cd#, dsize) then
--abs
d_print("cmp");
elsif instruction = conv_std_logic_vector(16#cd#, dsize) then
--abs
d_print("cmp");
+ a2_abs;
+ if exec_cycle = T3 then
+ arith_en_n <= '0';
+ back_oe(acc_cmd, '0');
+ set_nzc_from_alu;
+ end if;
elsif instruction = conv_std_logic_vector(16#dd#, dsize) then
--abs, x
d_print("cmp");
elsif instruction = conv_std_logic_vector(16#dd#, dsize) then
--abs, x
d_print("cmp");
+ a2_abs_xy(true);
+ if exec_cycle = T3 or exec_cycle = T4 then
+ arith_en_n <= '0';
+ back_oe(acc_cmd, '0');
+ set_nzc_from_alu;
+ end if;
elsif instruction = conv_std_logic_vector(16#d9#, dsize) then
--abs, y
elsif instruction = conv_std_logic_vector(16#d9#, dsize) then
--abs, y
elsif instruction = conv_std_logic_vector(16#d1#, dsize) then
--(indir), y
d_print("cmp");
elsif instruction = conv_std_logic_vector(16#d1#, dsize) then
--(indir), y
d_print("cmp");
+ a2_indir_y;
+ if exec_cycle = T4 or exec_cycle = T5 then
+ arith_en_n <= '0';
+ back_oe(acc_cmd, '0');
+ set_nzc_from_alu;
+ end if;
elsif instruction = conv_std_logic_vector(16#e0#, dsize) then
--imm
elsif instruction = conv_std_logic_vector(16#e0#, dsize) then
--imm
;c9&07=01\r
and ($07), y\r
\r
;c9&07=01\r
and ($07), y\r
\r
+ ;;cmp zp, x/abs/abs, x/indir, y\r
+ lda #$de\r
+ ldx #$e4\r
+ sta $a4\r
+ ;c5-de=-19 > (e7)\r
+ lda #$c5\r
+ cmp $c0, x\r
+\r
+ sec\r
+ lda #$75\r
+ stx $0734\r
+ ;75-e4=-6f > 91\r
+ cmp $0650, x\r
+\r
+ ldx #$c9\r
+ stx $0825\r
+ lda #$34\r
+ sta $07\r
+ lda #$07\r
+ sta $08\r
+ ldy #$f1\r
+ lda #$c9\r
+ ;page crossing\r
+ ;c9-c9=0\r
+ cmp ($07), y\r
+\r
+\r
;;infinite loop.\r
mainloop:\r
jmp mainloop\r
;;infinite loop.\r
mainloop:\r
jmp mainloop\r