X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?p=rmac;a=blobdiff_plain;f=mach.c;h=f979c9e98985d1eb8166c5011867271bed7f6c62;hp=08a9bab8f14e78e62ceb76c4813783a108582a88;hb=c59f7a33730dacf753e066a4002e2f749051a137;hpb=9153334781cd2e23750f4dc002e847606c07a1f0 diff --git a/mach.c b/mach.c index 08a9bab..f979c9e 100644 --- a/mach.c +++ b/mach.c @@ -1,7 +1,7 @@ // // RMAC - Reboot's Macro Assembler for all Atari computers // MACH.C - Code Generation -// Copyright (C) 199x Landon Dyer, 2011-2018 Reboot and Friends +// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986 // Source utilised with the kind permission of Landon Dyer // @@ -60,7 +60,7 @@ int m_cas2(WORD inst, WORD siz); int m_chk2(WORD inst, WORD siz); int m_cmp2(WORD inst, WORD siz); int m_bkpt(WORD inst, WORD siz); -int m_cpbr(WORD inst, WORD siz); +int m_cpbcc(WORD inst, WORD siz); int m_cpdbr(WORD inst, WORD siz); int m_muls(WORD inst, WORD siz); int m_move16a(WORD inst, WORD siz); @@ -92,6 +92,7 @@ int m_ploadw(WORD inst, WORD siz); // FPU int m_fabs(WORD inst, WORD siz); +int m_fbcc(WORD inst, WORD siz); int m_facos(WORD inst, WORD siz); int m_fadd(WORD inst, WORD siz); int m_fasin(WORD inst, WORD siz); @@ -1542,13 +1543,10 @@ int m_chk2(WORD inst, WORD siz) // -// cpbcc(68020, 68030, 68040 (FBcc), 68060 (FBcc)) -// TODO: Better checks for different instructions? +// cpbcc(68020, 68030, 68040 (FBcc), 68060 (FBcc)), pbcc (68851) // -int m_cpbr(WORD inst, WORD siz) +int m_fpbr(WORD inst, WORD siz) { - if ((activecpu & (CPU_68020 | CPU_68030)) && (!activefpu == 0)) - return error(unsupport); if (a0exattr & DEFINED) { @@ -1602,6 +1600,38 @@ int m_cpbr(WORD inst, WORD siz) } +// +// cpbcc(68020, 68030, 68040 (FBcc), 68060 (FBcc)) +// +int m_cpbcc(WORD inst, WORD siz) +{ + if (!(activecpu & (CPU_68020 | CPU_68030))) + return error(unsupport); + + return m_fpbr(inst, siz); +} + + +// +// fbcc(6808X, 68040, 68060) +// +int m_fbcc(WORD inst, WORD siz) +{ + CHECKNOFPU; + return m_fpbr(inst, siz); +} + + +// +// pbcc(68851 but let's assume 68020 only) +// +int m_pbcc(WORD inst, WORD siz) +{ + CHECKNO20; + return m_fpbr(inst, siz); +} + + // // cpdbcc(68020, 68030) // @@ -2109,16 +2139,6 @@ int m_moves(WORD inst, WORD siz) } -// -// PBcc (MC68851) -// -int m_pbcc(WORD inst, WORD siz) -{ - CHECKNO20; - return error("Not implemented yet."); -} - - // // pflusha (68030, 68040) // @@ -2948,14 +2968,12 @@ int m_flogn(WORD inst, WORD siz) // -// flognp1 (68040FPSP, 68060FPSP) +// flognp1 (6888X, 68040FPSP, 68060FPSP) // int m_flognp1(WORD inst, WORD siz) { - if (activefpu & (FPU_68040 | FPU_68060)) - return gen_fpu(inst, siz, B8(00000110), FPU_FPSP); - - return error("Unsupported in current FPU"); + CHECKNOFPU; + return gen_fpu(inst, siz, B8(00000110), FPU_FPSP); }