src/emu/cpu/tms9900/tms9995.c
| r15587 | r15588 | |
| 2261 | 2261 | // value in m_current_value |
| 2262 | 2262 | // The destination address is still in m_address |
| 2263 | 2263 | // Prefetch will not change m_current_value and m_address |
| 2264 | if (m_instruction->byteop) |
| 2265 | { |
| 2266 | set_status_parity((UINT8)(m_source_value>>8)); |
| 2267 | } |
| 2264 | 2268 | compare_and_set_lae(m_source_value, m_current_value); |
| 2265 | 2269 | if (VERBOSE>7) LOG("tms9995: ST = %04x (val1=%04x, val2=%04x)\n", ST, m_source_value, m_current_value); |
| 2266 | 2270 | } |
| r15587 | r15588 | |
| 2759 | 2763 | void tms9995_device::alu_mov() |
| 2760 | 2764 | { |
| 2761 | 2765 | m_current_value = m_source_value; |
| 2766 | if (m_instruction->byteop) |
| 2767 | { |
| 2768 | set_status_parity((UINT8)(m_current_value>>8)); |
| 2769 | } |
| 2762 | 2770 | compare_and_set_lae(m_current_value, 0); |
| 2763 | 2771 | if (VERBOSE>7) LOG("tms9995: ST = %04x (val=%04x)\n", ST, m_current_value); |
| 2764 | 2772 | // No clock pulse, as next instruction is prefetch |
| r15587 | r15588 | |
| 2971 | 2979 | // O if >8000 |
| 2972 | 2980 | // C is always reset |
| 2973 | 2981 | set_status_bit(ST_OV, m_current_value == 0x8000); |
| 2982 | set_status_bit(ST_C, false); |
| 2974 | 2983 | compare_and_set_lae(m_current_value, 0); |
| 2975 | 2984 | |
| 2976 | 2985 | if ((m_current_value & 0x8000)!=0) |
src/emu/cpu/tms9900/tms9900.c
| r15587 | r15588 | |
| 1928 | 1928 | m_address = 0x0040 + ((IR >> 4) & 0x003c); |
| 1929 | 1929 | break; |
| 1930 | 1930 | case 1: |
| 1931 | | m_value = WP; // save the old WP |
| 1931 | m_value_copy = WP; // save the old WP |
| 1932 | 1932 | WP = m_current_value & m_prgaddr_mask; // the new WP has been read in the previous microoperation |
| 1933 | 1933 | m_current_value = m_address_saved; // we saved the address of the source operand; retrieve it |
| 1934 | 1934 | m_address = WP + 0x0016; // Next register is R11 |
| r15587 | r15588 | |
| 1943 | 1943 | break; |
| 1944 | 1944 | case 4: |
| 1945 | 1945 | m_address = WP + 0x001a; |
| 1946 | | m_current_value = m_value; // old WP into new R13 |
| 1946 | m_current_value = m_value_copy; // old WP into new R13 |
| 1947 | 1947 | break; |
| 1948 | 1948 | case 5: |
| 1949 | 1949 | m_address = 0x0042 + ((IR >> 4) & 0x003c); // location of new PC |
| r15587 | r15588 | |
| 1984 | 1984 | check_ov = false; |
| 1985 | 1985 | break; |
| 1986 | 1986 | case NEG: |
| 1987 | | // LAEO |
| 1987 | // LAECO |
| 1988 | 1988 | // Overflow occurs for value=0x8000 |
| 1989 | 1989 | dest_new = ((~src_val) & 0x0000ffff) + 1; |
| 1990 | 1990 | check_ov = false; |
| r15587 | r15588 | |
| 2044 | 2044 | |
| 2045 | 2045 | if ((m_current_value & 0x8000)!=0) |
| 2046 | 2046 | { |
| 2047 | | m_current_value = (-m_current_value) & 0xffff; |
| 2047 | m_current_value = (((~m_current_value) & 0x0000ffff) + 1) & 0xffff; |
| 2048 | 2048 | pulse_clock(2); // If ABS is performed it takes one machine cycle more |
| 2049 | 2049 | } |
| 2050 | 2050 | else |