comparison z80.cpu @ 1715:4fd84c3efc72

Implement 16-bit addition in new Z80 core along with necessary CPU DSL fixes to make them work right
author Michael Pavone <pavone@retrodev.com>
date Tue, 29 Jan 2019 23:56:48 -0800
parents e170a0f75c4f
children b11cfa655c61
comparison
equal deleted inserted replaced
1714:e170a0f75c4f 1715:4fd84c3efc72
523 11000110 add_immed 523 11000110 add_immed
524 z80_fetch_immed 524 z80_fetch_immed
525 add a scratch1 a 525 add a scratch1 a
526 update_flags SZYHVXN0C 526 update_flags SZYHVXN0C
527 527
528 z80_add16_hl
529 arg src 16
530 lsl h 8 hlt
531 or l hlt hlt
532 add 1 hlt wz
533 add src hlt hlt
534 update_flags YHXN0C
535 mov hlt l
536 lsr hlt 8 h
537
538 00001001 add_hl_bc
539 local hlw 16
540 local bcw 16
541 meta hlt hlw
542 lsl b 8 bcw
543 or c bcw bcw
544 z80_add16_hl bcw
545
546 00011001 add_hl_de
547 local hlw 16
548 local dew 16
549 meta hlt hlw
550 lsl d 8 dew
551 or e dew dew
552 z80_add16_hl dew
553
554 00101001 add_hl_hl
555 local hlw 16
556 meta hlt hlw
557 z80_add16_hl hlw
558
559
560 00111001 add_hl_sp
561 local hlw 16
562 meta hlt hlw
563 z80_add16_hl sp
564
528 10001RRR adc_reg 565 10001RRR adc_reg
529 adc a main.R a 566 adc a main.R a
530 update_flags SZYHVXN0C 567 update_flags SZYHVXN0C
531 568
532 10001110 adc_hl 569 10001110 adc_hl
536 573
537 11001110 adc_immed 574 11001110 adc_immed
538 z80_fetch_immed 575 z80_fetch_immed
539 adc a scratch1 a 576 adc a scratch1 a
540 update_flags SZYHVXN0C 577 update_flags SZYHVXN0C
578
579 z80_adc16_hl
580 arg src 16
581 lsl h 8 hlt
582 or l hlt hlt
583 add 1 hlt wz
584 adc src hlt hlt
585 update_flags SZYHVXN0C
586 mov hlt l
587 lsr hlt 8 h
588
589 ed 01001010 adc_hl_bc
590 local hlw 16
591 local bcw 16
592 meta hlt hlw
593 lsl b 8 bcw
594 or c bcw bcw
595 z80_adc16_hl bcw
596
597 ed 01011010 adc_hl_de
598 local hlw 16
599 local dew 16
600 meta hlt hlw
601 lsl d 8 dew
602 or e dew dew
603 z80_adc16_hl dew
604
605 ed 01101010 adc_hl_hl
606 local hlw 16
607 meta hlt hlw
608 z80_adc16_hl hlw
609
610
611 ed 01111010 adc_hl_sp
612 local hlw 16
613 meta hlt hlw
614 z80_adc16_hl sp
541 615
542 10010RRR sub_reg 616 10010RRR sub_reg
543 sub main.R a a 617 sub main.R a a
544 update_flags SZYHVXN1C 618 update_flags SZYHVXN1C
545 619