diff --git a/src/Makefile b/src/Makefile index 9feb5c6..95190ab 100644 --- a/src/Makefile +++ b/src/Makefile @@ -4,7 +4,7 @@ NAME = z80test VERSION = 1.1a PKG := $(NAME)-$(VERSION) -PROGS := z80full z80flags z80doc z80docflags z80ccf z80memptr +PROGS := z80full z80flags z80doc z80docflags z80ccf z80memptr z80ccfscr SRCS := main idea crctab tests testmacros print all: $(addsuffix .tap,$(PROGS)) diff --git a/src/z80ccfscr.asm b/src/z80ccfscr.asm new file mode 100644 index 0000000..d19b3c3 --- /dev/null +++ b/src/z80ccfscr.asm @@ -0,0 +1,32 @@ +; Z80 test - monitor random behavior of bits 5 and 3 after CCF. +; +; Copyright (C) 2022 Patrik Rak (patrik@raxoft.cz) +; +; This source code is released under the MIT license, see included license.txt. + + org 0x8000 + +main: di + ld sp,22528+512 + ld hl,0x7838 + ld b,0 +.fill push hl + djnz .fill + ld sp,49152 + ld hl,16384 + ld d,0xEF +.loop push hl + pop af + ccf + push af + pop bc + ld a,l + xor c + ld (hl),a + inc hl + ld a,h + and d + ld h,a + jp .loop + +; EOF ;