TRAPV/TRAPcc don't use the TRAP7 vector, they use the TRAPV vector

This commit is contained in:
Philip Pemberton 2019-04-24 16:35:59 +01:00 committed by Ryan Kurtz
parent 919762c1cc
commit a8f27f6484

View file

@ -302,6 +302,7 @@ attach values quick [ 8 1 2 3 4 5 6 7 ];
define pcodeop kfactor;
define pcodeop ftrap;
define pcodeop __m68k_trap;
define pcodeop __m68k_trapv;
define pcodeop reset;
define pcodeop saveFPUStateFrame;
define pcodeop restoreFPUStateFrame;
@ -1679,9 +1680,9 @@ ptestLevel: "#"^mregn is mregn { export *[const]:1 mregn; }
:trap "#"^op03 is opbig=0x4e & op67=1 & op45=0 & op03 { vector:1 = op03; __m68k_trap(vector); }
:trap^cc is op=5 & cc & op37=31 & op02=4 { if (!cc) goto inst_next; SP = SP - 4; *:4 SP = PC; vector:1 = 7; __m68k_trap(vector); }
:trap^cc^".w" "#"^d16 is op=5 & cc & op37=31 & op02=2; d16 { if (!cc) goto inst_next; SP = SP - 4; *:4 SP = PC; vector:1 = 7; __m68k_trap(vector); }
:trap^cc^".l" "#"^d32 is op=5 & cc & op37=31 & op02=3; d32 { if (!cc) goto inst_next; SP = SP - 4; *:4 SP = PC; vector:1 = 7; __m68k_trap(vector); }
:trapv is opbig=0x4e & op37=14 & op02=6 { if (!VF) goto inst_next; vector:1 = 7; __m68k_trap(vector); }
:trap^cc^".w" "#"^d16 is op=5 & cc & op37=31 & op02=2; d16 { if (!cc) goto inst_next; SP = SP - 4; *:4 SP = PC; __m68k_trapv(); }
:trap^cc^".l" "#"^d32 is op=5 & cc & op37=31 & op02=3; d32 { if (!cc) goto inst_next; SP = SP - 4; *:4 SP = PC; __m68k_trapv(); }
:trapv is opbig=0x4e & op37=14 & op02=6 { if (!VF) goto inst_next; __m68k_trapv(); }
:tst.b eab is (opbig=0x4a & op67=0)... & eab { logflags(); resflags(eab); }
:tst.w eaw is (opbig=0x4a & op67=1)... & eaw { logflags(); resflags(eaw); }