/* ** cpu.c Motorola M68k, CPU32 and ColdFire cpu-description file ** (c) in 2002-2020 by Frank Wille */ #include #include "vasm.h" #include "error.h" #include "operands.h" struct specreg SpecRegs[] = { #include "specregs.h" }; static int specreg_cnt = sizeof(SpecRegs)/sizeof(SpecRegs[0]); mnemonic mnemonics[] = { #include "opcodes.h" }; int mnemonic_cnt = sizeof(mnemonics)/sizeof(mnemonics[0]); struct cpu_models models[] = { #include "cpu_models.h" }; int model_cnt = sizeof(models)/sizeof(models[0]); char *cpu_copyright="vasm M68k/CPU32/ColdFire cpu backend 2.3k (c) 2002-2020 Frank Wille"; char *cpuname = "M68k"; int bitsperbyte = 8; int bytespertaddr = 4; int m68k_mid = 1; /* default a.out MID: 68000/68010 */ static uint32_t cpu_type = m68000; static expr *baseexp[7]; /* basereg: expression loaded to reg. */ static signed char sdreg = -1; /* current small-data base register */ static signed char last_sdreg = -1; static unsigned char phxass_compat = 0; static unsigned char devpac_compat = 0; static unsigned char gas = 0; /* true enables GNU-as mnemonics */ static unsigned char sgs = 0; /* true enables & as immediate prefix */ static unsigned char no_fpu = 0; /* true: FPU code/direct. disallowed */ static unsigned char elfregs = 0; /* true: %Rn instead of Rn reg. names */ static unsigned char fpu_id = 1; /* default coprocessor id for FPU */ static unsigned char opt_gen = 1; /* generic optimizations (not Devpac) */ static unsigned char opt_movem = 0; /* MOVEM Rn -> MOVE Rn */ static unsigned char opt_pea = 0; /* MOVE.L #x,-(sp) -> PEA x */ static unsigned char opt_clr = 0; /* MOVE #0, -> CLR */ static unsigned char opt_st = 0; /* MOVE.B #-1, -> ST */ static unsigned char opt_lsl = 0; /* LSL #1,Dn -> ADD Dn,Dn */ static unsigned char opt_mul = 0; /* MULU/MULS #n,Dn -> LSL/ASL #n,Dn */ static unsigned char opt_div = 0; /* DIVU/DIVS.L #n,Dn -> LSR/ASR #n,Dn */ static unsigned char opt_fconst = 1; /* Fxxx.D #m,FPn -> Fxxx.S #m,FPn */ static unsigned char opt_brajmp = 0; /* branch to different sect. into jump */ static unsigned char opt_pc = 1; /*