Re: [hatari-devel] Basic cpu testsuite |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [hatari-devel] Basic cpu testsuite
- From: Thomas Huth <th.huth@xxxxxxxxx>
- Date: Sun, 3 Jun 2018 18:09:39 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1528042188; bh=P+2cel0YGd9wsFDw+WMtzOOWGWt7PNv0Wrl/j5rf++g=; h=Date:From:To:Subject:From; b=HUo2p61rlekxfM/vQHtF1ct+chtWkG83feEnYKKc0F+q8o7KDrqY31wu7Oj1vLly+ V2g8X0G9P6ZQvJvYcf24rwIAA6iaOpmjgGG/tE1AgTWCva2HgRjjPWeeXVI8h3N6w3 NgHZ4JP/S38I7bksKLhoHJScVeSUPdI0vUU914Uj3G1ELUgvAgY6NAwrWKYE/YQoD+ Vq1VJTb8QlvLSXj1hZGPdEFfi0AWYsdnyjmhBD6/ON/TGLFHFWt+leoANwtjHk+uFD /UY/DpCL7t/c+LdxdL1J31FM3iwJQ6krAgbm+LqrdNqOB2vsQZXSAo9PDrkP9gG/Be HDCCFMTqTmlnQ==
Am Sun, 27 May 2018 19:35:54 +0200
schrieb Thomas Huth <th.huth@xxxxxxxxx>:
> Am Sat, 26 May 2018 15:44:53 +0200
> schrieb Thorsten Otto <admin@xxxxxxxxxxx>:
>
> > > - Stuff like the "move sr,d0" vs. "move ccr,d0" ifdeffery of
> > > course won't work if the binary should be used for both, 68000
> > > and 68010+ CPU levels. We'd need to think of a way to solve that
> > > before such a test could be included...
> >
> > The attached patch should solve that. It will install exception
> > handlers that immediately terminate the program in tos-less mode,
> > thus solving also the problem of bus-errors jumping to nowhere land.
> > The exception handler for privilege violation will simulate move
> > sr,<ea> by move ccr,<ea>, just like TOS would do.
>
> Ok, thanks for the patch! But I think slowly the fake_tos array gets
> to a size where dealing with the hand-crafted binary code is not
> really managable anymore.
> I think we should put all that assembler code into a proper .S file
> instead and handle it like cart_asm.s ... I'll try to do come up with
> something like that in the next few days.
I've now moved the fake-tos to a separate source file, so it can be
easier re-assembled now. I also added code that sets up the exception
handlers to terminate Hatari in case of unexpected exceptions.
However, after having a closer look at that "move SR" stuff, I think
that's already too much for the minimalistic fake-TOS. There are easier
ways to work around this problem:
1) We could simply run such code in supervisor mode.
2) We could set the _longframe (0x59e) system variable in the non-TOS
mode. If it's set, test code must use "move ccr,..." and if it's not
set, test code must use "move sr,...".
Thomas