Z80Explorer icon indicating copy to clipboard operation
Z80Explorer copied to clipboard

ZEXALL Test

Open Merilix opened this issue 10 months ago • 2 comments

This ZEXALL output doesnt look right.

Z80all instruction exerciser
msg  OK
msg  OK
msg  OK
msg  OK
msg  OK
msg  OK
msg  OK
msg  ERROR **** crc expected:26db477e found:f13c985a
msg  OK
msg  ERROR **** crc expected:b0818935 found:b1d68b3f
msg  OK
msg  ERROR **** crc expected:94f42769 found:3be584a8
msg  ERROR **** crc expected:39dd3de1 found:96cc9e20
msg  ERROR **** crc expected:f782b0d1 found:5b1ce87f
msg  ERROR **** crc expected:e9ead0ae found:45748800
msg  OK
msg  OK
msg  OK
msg

Obviously the 'msg' parameter was not expanded properly. Assembling zexall.asm again will fix that. But more important: ZEXALL (especially msbt and spbt variables) have to lie on the exact address 103h in order to match with precalculated CRCs for some tests.

Easy to fix by moving the bdos part to the very end and including an org 100h ...

    aseg

include trickbox.inc

    org 0
start:
    jmp boot

; important, there should be a jump which address also mark the top of usable ram
; often used by CPM programms as top of stack.
;
    org 5
    jp	sim_bdos 

; CPM progs usually start here:
    org 100h
    
start100:
    jp  main

; machine state before test (needs to be at predictably constant address)
msbt:   ds    14
spbt:   ds    2
msbthi  equ   msbt / 0100h
msbtlo  equ   msbt & 0ffh

;...

main:
	ld	hl,(6)
	ld	sp,hl
	ld	de,msg1
...

and so on till the very end.

;-----------------
; reserve 400h stack space before bdos entry.
;
    ds   100h-($ and 0ffh)	; align 100h
    ds   400h			; reserve stack 

    ; BDOS entry point for various functions
    ; We implement subfunctions:
    ;  C=2  Print a character given in E
    ;  C=9  Print a string pointed to by DE; string ends with '$'

sim_bdos:
    ld  a,c
    cp  a,2
    jz  bdos_ascii
    cp  a,9
    jz  bdos_msg
    ret

bdos_ascii:
    ld a, e
    out (IO_CHAR), a
    ret

bdos_msg:
    push de
    pop hl
lp0:
    ld  e,(hl)
    ld  a,e
    cp  a,'$'
    ret z
    call bdos_ascii
    inc hl
    jmp lp0
;
boot:
	ld	sp,sim_bdos
	call    start100
	halt
	jmp	$
;-------------------------

Thats it. Looks much better now:

Z80all instruction exerciser
ld hl,(nnnn)..................  OK
ld sp,(nnnn)..................  OK
ld (nnnn),hl..................  OK
ld (nnnn),sp..................  OK
ld <bc,de>,(nnnn).............  OK
ld <ix,iy>,(nnnn).............  OK
ld <ix,iy>,nnnn...............  OK
ld (<ix,iy>+1),nn.............  OK
ld <ixh,ixl,iyh,iyl>,nn.......  OK
ld a,<(bc),(de)>..............  OK
ld a,(nnnn) / ld (nnnn),a.....  OK
ldd<r> (1)....................  OK
ldd<r> (2)....................  OK
ldi<r> (1)....................  OK
ldi<r> (2)....................  OK
ld (nnnn),<bc,de>.............  OK
ld (nnnn),<ix,iy>.............  OK
ld <bc,de,hl,sp>,nnnn.........  OK
ld <b,c,d,e,h,l,(hl),a>,nn....  OK
ld (<ix,iy>+1),a..............  OK
ld (<bc,de>),a................  OK
ld a,(<ix,iy>+1)..............  OK
ld <h,l>,(<ix,iy>+1)..........  OK
ld (<ix,iy>+1),<h,l>..........

Merilix avatar Apr 04 '24 21:04 Merilix

Thanks, can you push a change?

gdevic avatar Apr 05 '24 00:04 gdevic

Sorry, I cant. I have no experience with push/pull requests to a third-party repository on github yet.

Fun fact: zexall still running since days without errors and not yet finished.

sim.hz      2528
sim.hcycle  1145175238

Merilix avatar Apr 09 '24 20:04 Merilix