comparison z80.cpu @ 1756:093e323dc683

Added in block instructions, fixed IO address calculation in out block instructions in new Z80 core
author Michael Pavone <pavone@retrodev.com>
date Fri, 15 Feb 2019 23:59:34 -0800
parents 33ec5df77fac
children 6e4faa10f9ee
comparison
equal deleted inserted replaced
1755:28635b733d97 1756:093e323dc683
81 mov pc scratch1 81 mov pc scratch1
82 ocall read_8 82 ocall read_8
83 add 1 pc pc 83 add 1 pc pc
84 84
85 z80_run_op 85 z80_run_op
86 #printf "Z80: %X @ %d\n" pc cycles 86 #printf "Z80: %X - A: %X, B: %X, C: %X D: %X, E: %X, H: %X, L: %X, SP: %X, IX: %X, IY: %X @ %d\n" pc a b c d e h l sp ix iy cycles
87 z80_op_fetch 87 z80_op_fetch
88 dispatch scratch1 88 dispatch scratch1
89 89
90 z80_interrupt 90 z80_interrupt
91 cmp int_cycle cycles 91 cmp int_cycle cycles
1704 lsl b 8 scratch1 1704 lsl b 8 scratch1
1705 or c scratch1 scratch1 1705 or c scratch1 scratch1
1706 ocall io_read8 1706 ocall io_read8
1707 mov scratch1 main.R 1707 mov scratch1 main.R
1708 1708
1709 z80_ini_ind
1710 arg change 16
1711 local tmp 8
1712 cycles 1
1713
1714 lsl 8 b wz
1715 or c wz wz
1716 add change wz wz
1717
1718 sub 1 b b
1719 update_flags SZYX
1720
1721 lsl b 8 scratch1
1722 or c scratch1 scratch1
1723 ocall io_read8
1724
1725 and 0x80 scratch1 nflag
1726
1727 mov wz tmp
1728 add tmp scratch1 tmp
1729 update_flags C
1730
1731 z80_store_hl
1732
1733 lsl h 8 scratch2
1734 or l scratch2 scratch2
1735 add change scratch2 scratch2
1736 mov scratch2 l
1737 lsr scratch2 8 h
1738
1739 and 7 tmp tmp
1740 xor b tmp tmp
1741 update_flags P
1742 lsr chflags 4 tmp
1743 or tmp chflags chflags
1744
1745 ed 10100010 ini
1746 z80_ini_ind 1
1747
1748 ed 10110010 inir
1749 z80_ini_ind 1
1750 if zflag
1751 else
1752 sub 2 pc pc
1753 cycles 5
1754 end
1755
1756 ed 10101010 ind
1757 z80_ini_ind -1
1758
1759 ed 10111010 indr
1760 z80_ini_ind -1
1761 if zflag
1762 else
1763 sub 2 pc pc
1764 cycles 5
1765 end
1766
1709 11010011 out_abs 1767 11010011 out_abs
1710 z80_fetch_immed 1768 z80_fetch_immed
1711 mov scratch1 scratch2 1769 mov scratch1 scratch2
1712 mov a scratch1 1770 mov a scratch1
1713 ocall io_write8 1771 ocall io_write8
1734 1792
1735 add l scratch1 tmp 1793 add l scratch1 tmp
1736 update_flags C 1794 update_flags C
1737 and 7 tmp tmp 1795 and 7 tmp tmp
1738 1796
1739 lsl 8 b scratch2 1797 lsl b 8 scratch2
1740 or c scratch2 scratch2 1798 or c scratch2 scratch2
1741 ocall io_write8 1799 ocall io_write8
1742 1800
1801 sub 1 b b
1802 update_flags SZYX
1803
1743 lsl 8 b wz 1804 lsl 8 b wz
1744 or c wz wz 1805 or c wz wz
1745 1806 add change wz wz
1746 sub 1 b b 1807
1747 update_flags SZYX
1748 xor b tmp tmp 1808 xor b tmp tmp
1749 update_flags P 1809 update_flags P
1750 lsr chflags 4 tmp 1810 lsr chflags 4 tmp
1751 or tmp chflags chflags 1811 or tmp chflags chflags
1752 1812