comparison z80.cpu @ 1734:88fbc4e711fd

Implemented the rest of the block move instructions in new Z80 core
author Michael Pavone <pavone@retrodev.com>
date Sun, 03 Feb 2019 10:40:41 -0800
parents 1f0a86f5e055
children ca2336469397
comparison
equal deleted inserted replaced
1733:1f0a86f5e055 1734:88fbc4e711fd
2014 local tmp 8 2014 local tmp 8
2015 z80_set_index B tmp 2015 z80_set_index B tmp
2016 2016
2017 fdcb 11BBBRRR set_iyd_reg 2017 fdcb 11BBBRRR set_iyd_reg
2018 z80_set_index B main.R 2018 z80_set_index B main.R
2019 2019
2020 ed 10100000 ldi 2020 z80_fetch_mod_hl
2021 local tmp 16
2022 arg change 16
2023 lsl h 8 tmp
2024 or l tmp tmp
2025 mov tmp scratch1
2026 add change tmp tmp
2027 mov tmp l
2028 lsr tmp 8 h
2029 ocall read_8
2030 cycles 1
2031
2032 z80_ldd_ldi
2033 arg change 16
2021 local tmp 16 2034 local tmp 16
2022 local tmp8 8 2035 local tmp8 8
2023 lsl h 8 tmp 2036 z80_fetch_mod_hl change
2024 or l tmp tmp
2025 mov tmp scratch1
2026 add 1 tmp tmp
2027 mov tmp l
2028 lsr tmp 8 h
2029 ocall read_8
2030 cycles 1
2031 2037
2032 add a scratch1 tmp8 2038 add a scratch1 tmp8
2033 update_flags H0XN0 2039 update_flags H0XN0
2034 2040
2035 and 0x2 tmp8 tmp8 2041 and 0x2 tmp8 tmp8
2036 lsl 4 tmp8 tmp8 2042 lsl tmp8 4 tmp8
2037 and 0x88 last_flag_result last_flag_result 2043 and 0x88 last_flag_result last_flag_result
2038 or tmp8 last_flag_result last_flag_result 2044 or tmp8 last_flag_result last_flag_result
2039 2045
2040 lsl d 8 tmp 2046 lsl d 8 tmp
2041 or e tmp tmp 2047 or e tmp tmp
2042 mov tmp scratch2 2048 mov tmp scratch2
2043 add 1 tmp tmp 2049 add change tmp tmp
2044 mov tmp e 2050 mov tmp e
2045 lsr tmp 8 d 2051 lsr tmp 8 d
2046 ocall write_8 2052 ocall write_8
2047 2053
2048 lsl b 8 tmp 2054 lsl b 8 tmp
2052 mov tmp c 2058 mov tmp c
2053 lsr tmp 8 b 2059 lsr tmp 8 b
2054 mov c pvflag 2060 mov c pvflag
2055 or b pvflag pvflag 2061 or b pvflag pvflag
2056 2062
2057
2058
2059 cycles 5 2063 cycles 5
2060 2064
2065
2066 ed 10100000 ldi
2067 z80_ldd_ldi 1
2068
2069 ed 10101000 ldd
2070 z80_ldd_ldi -1
2071
2072 ed 10110000 ldir
2073 z80_ldd_ldi 1
2074 if pvflag
2075
2076 add 1 pc wz
2077 sub 1 pc pc
2078 cycles 5
2079
2080 end
2081
2082 ed 10111000 lddr
2083 z80_ldd_ldi -1
2084 if pvflag
2085
2086 add 1 pc wz
2087 sub 1 pc pc
2088 cycles 5
2089
2090 end
2091
2092
2093