| 419 | } |
| 420 | |
| 421 | static void cpu_call(uint32_t address, bool mode, bool mixed) { |
| 422 | #ifdef DEBUG_SUPPORT |
| 423 | debug_record_call(cpu.registers.PC, cpu.L); |
| 424 | #endif |
| 425 | if (mixed) { |
| 426 | bool stack = cpu.IL || (cpu.L && !cpu.ADL); |
| 427 | cpu.registers.R += cpu.IL << 1; |
| 428 | if (cpu.ADL) { |
| 429 | cpu_push_byte_mode(cpu.registers.PCU, true); |
| 430 | if (!cpu.IL) { |
| 431 | cpu_push_byte_mode((cpu.MADL << 1) | cpu.ADL, true); |
| 432 | } |
| 433 | } |
| 434 | cpu_push_byte_mode(cpu.registers.PCH, stack); |
| 435 | cpu_push_byte_mode(cpu.registers.PCL, stack); |
| 436 | if (cpu.IL || !cpu.ADL) { |
| 437 | cpu_push_byte_mode((cpu.MADL << 1) | cpu.ADL, true); |
| 438 | } |
| 439 | } else { |
| 440 | cpu_push_word(cpu.registers.PC); |
| 441 | } |
| 442 | cpu_prefetch(address, mode); |
| 443 | } |
| 444 | |
| 445 | static void cpu_interrupt(uint32_t address) { |
| 446 | cpu_rst(address, cpu.ADL, cpu.ADL | cpu.MADL, cpu.MADL); |
no test coverage detected