68000 instruction test suite QL
- XorA
- Site Admin
- Posts: 1368
- Joined: Thu Jun 02, 2011 11:31 am
- Location: Shotts, North Lanarkshire, Scotland, UK
68000 instruction test suite QL
Did anyone ever develop a 68k instruction set test suite for QL?
Interested for emulator testing.
G
Interested for emulator testing.
G
- mk79
- QL Wafer Drive
- Posts: 1349
- Joined: Sun Feb 02, 2014 10:54 am
- Location: Esslingen/Germany
- Contact:
Re: 68000 instruction test suite QL
If the emulator is already advanced enough to run QDOS then yes, I ported a test suite to run within QDOS.
- XorA
- Site Admin
- Posts: 1368
- Joined: Thu Jun 02, 2011 11:31 am
- Location: Shotts, North Lanarkshire, Scotland, UK
Re: 68000 instruction test suite QL
Yes, it is running QDOS, its the uQlx port to 64bit I have been working on.
- mk79
- QL Wafer Drive
- Posts: 1349
- Joined: Sun Feb 02, 2014 10:54 am
- Location: Esslingen/Germany
- Contact:
Re: 68000 instruction test suite QL
I'm leaving for the Chaos Communication Congress early tomorrow plus a little bit of holidays afterwards, I can dig up the files when I return.
Cheers, Marcel
Cheers, Marcel
Re: 68000 instruction test suite QL
Apologies for the revival; have these files surfaced anywhere public?
- XorA
- Site Admin
- Posts: 1368
- Joined: Thu Jun 02, 2011 11:31 am
- Location: Shotts, North Lanarkshire, Scotland, UK
Re: 68000 instruction test suite QL
It seems I could use your testsuite, as the following code from uqlx I guess means its nbcd instruction does not work.
Note the shifting d all 8 bits, then checking for a value > 0
Code: Select all
IDECL(nbcd)
{
w8 d,r;
w8 d2,r2;
d=ModifyAtEA_b((code>>3)&7,code&7);
d2=((d&0x0f)>9? 9:(d&0x0f));
d>>=8;
if(d>9) d2+=90; else d2+=d*10;
carry=d2!=0;
r2=100-d2;
if(xflag) r2--;
xflag=carry;
zero=zero && r2==0;
r=(r2%10)+((r2/10)<<4);
RewriteEA_b(r);
NEXT;
}
- XorA
- Site Admin
- Posts: 1368
- Joined: Thu Jun 02, 2011 11:31 am
- Location: Shotts, North Lanarkshire, Scotland, UK
Re: 68000 instruction test suite QL
The only two results for d I can see are 0 and -1 (if it sign extends the top bit) so always < 9XorA wrote:It seems I could use your testsuite, as the following code from uqlx I guess means its nbcd instruction does not work.
Note the shifting d all 8 bits, then checking for a value > 0Code: Select all
IDECL(nbcd) { w8 d,r; w8 d2,r2; d=ModifyAtEA_b((code>>3)&7,code&7); d2=((d&0x0f)>9? 9:(d&0x0f)); d>>=8; if(d>9) d2+=90; else d2+=d*10; carry=d2!=0; r2=100-d2; if(xflag) r2--; xflag=carry; zero=zero && r2==0; r=(r2%10)+((r2/10)<<4); RewriteEA_b(r); NEXT; }
- janbredenbeek
- Super Gold Card
- Posts: 633
- Joined: Wed Jan 21, 2015 4:54 pm
- Location: Hilversum, The Netherlands
Re: 68000 instruction test suite QL
Something interesting I hit upon:
When tracing 68000 instructions using the 68000's SR Trace bit, when I trace a TRAP instruction, the code of the TRAP itself can be traced too on a 68000.
However, on QPC2 which emulates the 68020, the trace is skipped during the trap and the next instruction after TRAP. Apparently the Trace bit is automatically reset during the trap on the 68020 but not on the 68000. I've tested this with Multimon (which always sets the Trace bit even with TRAP instructions) and QMON (which by default doesn't trace TRAPs but can optionally do).
The interesting part is that this feature is apparently not documented. I could't find anything about it in the Motorola/NXP manuals. Yes, I know that the Trace bit is reset during exceptions such as interrupts but that would mean that, if implemented consequently, TRAPs couldn't be traced too on the 68000.
Unfortunately I don't have hardware with a 'real' 68020 to test this...
Jan
When tracing 68000 instructions using the 68000's SR Trace bit, when I trace a TRAP instruction, the code of the TRAP itself can be traced too on a 68000.
However, on QPC2 which emulates the 68020, the trace is skipped during the trap and the next instruction after TRAP. Apparently the Trace bit is automatically reset during the trap on the 68020 but not on the 68000. I've tested this with Multimon (which always sets the Trace bit even with TRAP instructions) and QMON (which by default doesn't trace TRAPs but can optionally do).
The interesting part is that this feature is apparently not documented. I could't find anything about it in the Motorola/NXP manuals. Yes, I know that the Trace bit is reset during exceptions such as interrupts but that would mean that, if implemented consequently, TRAPs couldn't be traced too on the 68000.
Unfortunately I don't have hardware with a 'real' 68020 to test this...
Jan
- mk79
- QL Wafer Drive
- Posts: 1349
- Joined: Sun Feb 02, 2014 10:54 am
- Location: Esslingen/Germany
- Contact:
Re: 68000 instruction test suite QL
I finally uploaded one version to https://www.kilgus.net/soft/m68k_tester_gz.zip. You probably only need to adapt the dev$ variable in the boot file. It can run very long on slower machines, days even, so it makes a screenshot after every instruction tested. Not so much a problem for an emulator like yours I guess.XorA wrote:It seems I could use your testsuite, as the following code from uqlx I guess means its nbcd instruction does not work.
Cheers, Marcel
- mk79
- QL Wafer Drive
- Posts: 1349
- Joined: Sun Feb 02, 2014 10:54 am
- Location: Esslingen/Germany
- Contact:
Re: 68000 instruction test suite QL
I haven't though about this stuff for 10 years, so I'm a bit rusty. But as far as I can see that is simply a bug because the TRAP shares code with other exceptions where the T bit must be cleared. Amazing that nobody including myself has ever noticed itjanbredenbeek wrote:When tracing 68000 instructions using the 68000's SR Trace bit, when I trace a TRAP instruction, the code of the TRAP itself can be traced too on a 68000.
However, on QPC2 which emulates the 68020, the trace is skipped during the trap and the next instruction after TRAP. Apparently the Trace bit is automatically reset during the trap on the 68020 but not on the 68000. I've tested this with Multimon (which always sets the Trace bit even with TRAP instructions) and QMON (which by default doesn't trace TRAPs but can optionally do).
Cheers, Marcel