When writing Next layer 2 screen code I found a problem with the intrinsic_ldi() function for sdcc_ix. It works fine for sccz80 and sdcc_iy but not for sdcc_ix.
Below is a test program that should clear the layer 2 screen to a given color (yellow) using intrinsic_ldi():
l_layer2_clear_screen_section_00101:
ld b, c
dec c
ld a, b
or a, a
ret Z
ld de,_buf_256
push hl
pop iy
push hl
push bc
push de
push iy
pop de
pop hl
pop bc
pop hl ;; *
push hl
push bc
call ____sdcc_ldi_256
All that pushing and popping is about doing an effective "ex de,hl" and it bungles that by the pop marked * above.
Alvin, I'm sorry for misleading you. When I retested intrinsic_ldi() for sdcc_ix, I must have used the wrong version of z88dk. My intention was to use the snapshot from 2017-08-27 but I must have used another one... I have over twenty different z88dk installations on my computer. I save the older ones when I upgrade in case I need to revert. I guess I have hit my limit on how many z88dk versions I'm capable of managing - time to do some clean-up now