comparison z80.cpu @ 1719:fb5ae8c20b85

Fix cp instruction in new Z80 core and implement its DD/FD prefixes
author Michael Pavone <pavone@retrodev.com>
date Wed, 30 Jan 2019 21:47:35 -0800
parents c7d18b8ec29a
children 1648c685083a
comparison
equal deleted inserted replaced
1718:c7d18b8ec29a 1719:fb5ae8c20b85
877 z80_fetch_immed 877 z80_fetch_immed
878 xor a scratch1 a 878 xor a scratch1 a
879 update_flags SZYH0PXN0C0 879 update_flags SZYH0PXN0C0
880 880
881 10111RRR cp_reg 881 10111RRR cp_reg
882 mov main.R last_flag_result
882 cmp main.R a 883 cmp main.R a
883 update_flags SZYHVXN1C 884 update_flags SZHVN1C
885
886 dd 10111100 cp_ixh
887 lsr ix 8 last_flag_result
888 cmp last_flag_result a
889 update_flags SZHVN1C
890
891 dd 10111101 cp_ixl
892 mov ix last_flag_result
893 cmp last_flag_result a
894 update_flags SZHVN1C
895
896 fd 10111100 cp_iyh
897 lsr iy 8 last_flag_result
898 cmp last_flag_result a
899 update_flags SZHVN1C
900
901 fd 10111101 cp_iyl
902 mov iy last_flag_result
903 cmp last_flag_result a
904 update_flags SZHVN1C
884 905
885 10111110 cp_hl 906 10111110 cp_hl
886 z80_fetch_hl 907 z80_fetch_hl
908 mov scratch1 last_flag_result
887 cmp scratch1 a 909 cmp scratch1 a
888 update_flags SZYHVXN1C 910 update_flags SZHVN1C
911
912 dd 10111110 cp_ixd
913 z80_fetch_index ix
914 mov scratch1 last_flag_result
915 cmp scratch1 a
916 update_flags SZHVN1C
917
918 fd 10111110 cp_iyd
919 z80_fetch_index iy
920 mov scratch1 last_flag_result
921 cmp scratch1 a
922 update_flags SZHVN1C
889 923
890 11111110 cp_immed 924 11111110 cp_immed
891 z80_fetch_immed 925 z80_fetch_immed
926 mov scratch1 last_flag_result
892 cmp scratch1 a 927 cmp scratch1 a
893 update_flags SZYHVXN1C 928 update_flags SZHVN1C
894 929
895 00RRR100 inc_reg 930 00RRR100 inc_reg
896 add 1 main.R main.R 931 add 1 main.R main.R
897 update_flags SZYHVXN0 932 update_flags SZYHVXN0
898 933