⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 outas68.c

📁 CC386 is a general-purpose 32-bit C compiler. It is not an optimizing compiler but given that the co
💻 C
📖 第 1 页 / 共 5 页
字号:
/* 
Copyright 1994-2003 Free Software Foundation, Inc.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.  

This program is derived from the cc68k complier by 
Matthew Brandt (mattb@walkingdog.net) 

You may contact the author of this derivative at:

mailto::camille@bluegrass.net

or by snail mail at:

David Lindauer
850 Washburn Ave Apt 99
Louisville, KY 40222
 */
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include "lists.h"
#include "expr.h"
#include "c.h"
#include "gen68.h"
#include "diag.h"

/*      variable initialization         */
extern int prm_cplusplus;
extern HASHREC **templateFuncs;
extern struct _templatelist *templateList;
extern int global_flag;
extern SYM *currentfunc;
extern HASHREC **gsyms;
extern OCODE *peep_insert,  *peep_head,  *peep_tail;
extern int prm_datarel, prm_pcrel;
extern long nextlabel;
extern FILE *outputFile;
extern int prm_asmfile;
extern int prm_lines;
extern int prm_cmangle;
extern int prm_optmult;
extern LIST *localfuncs,  *localdata;
extern LIST *libincludes;

struct slit *strtab;
enum e_gt gentype = nogen; /* Current DC type */
enum e_sg curseg = noseg; /* Current seg */
int outcol = 0; /* Curront col (roughly) */
int dataofs; /* Offset from last label */
SYM *datasp; /* Symbol of last named label */
static DATALINK *datahead,  *datatail; /* links for fixup gen */
static LIST *mpthunklist;

//ASMREG reglst[] = {
//   { 0 , 0 , 0 },
//};
/* List of opcodes
 * This list MUST be in the same order as the op_ enums 
 */
ASMNAME oplst[] = 
{
    {
        "?reserved", op_reserved, 0
    } , 
    {
        "?line#", op_reserved, 0
    }
    , 
    {
        "?seq@", op_reserved, 0
    }
    , 
    {
        "?slit", op_reserved, 0
    }
    , 
    {
        "?label", op_reserved, 0
    }
    , 
    {
        "?flabel", op_reserved, 0
    }
    , 
    {
        "dc", op_reserved, 0
    }
    , 
    {
        "?void", op_reserved, 0
    }
    , 
    {
        "dc", op_reserved, 0
    }
    , 
    {
        "dc", op_reserved, 0
    }
    , 
    {
        "?bstart", op_reserved, 0
    }
    , 
    {
        "?bend", op_reserved, 0
    }
    , 
    {
        "abcd", op_abcd, OPE_NEGBCD
    }
    , 
    {
        "add", op_add, OPE_MATH
    }
    , 
    {
        "adda", op_adda, OPE_AMATH
    }
    , 
    {
        "addi", op_addi, OPE_IMATH
    }
    , 
    {
        "addq", op_addq, OPE_QMATH
    }
    , 
    {
        "addx", op_addx, OPE_ADDX
    }
    , 
    {
        "and", op_and, OPE_LOG
    }
    , 
    {
        "andi", op_andi, OPE_ILOG
    }
    , 
    {
        "asl", op_asl, OPE_SHIFT
    }
    , 
    {
        "asr", op_asr, OPE_SHIFT
    }
    , 
    {
        "bra", op_bra, OPE_BRA
    }
    , 
    {
        "beq", op_beq, OPE_BRA
    }
    , 
    {
        "bne", op_bne, OPE_BRA
    }
    , 
    {
        "blt", op_blt, OPE_BRA
    }
    , 
    {
        "ble", op_ble, OPE_BRA
    }
    , 
    {
        "bgt", op_bgt, OPE_BRA
    }
    , 
    {
        "bge", op_bge, OPE_BRA
    }
    , 
    {
        "bhi", op_bhi, OPE_BRA
    }
    , 
    {
        "bhs", op_bhs, OPE_BRA
    }
    , 
    {
        "blo", op_blo, OPE_BRA
    }
    , 
    {
        "bls", op_bls, OPE_BRA
    }
    , 
    {
        "bsr", op_bsr, OPE_BRA
    }
    , 
    {
        "bcc", op_bcc, OPE_BRA
    }
    , 
    {
        "bcs", op_bcs, OPE_BRA
    }
    , 
    {
        "bmi", op_bmi, OPE_BRA
    }
    , 
    {
        "bpl", op_bpl, OPE_BRA
    }
    , 
    {
        "bvc", op_bvc, OPE_BRA
    }
    , 
    {
        "bvs", op_bvs, OPE_BRA
    }
    , 
    {
        "bchg", op_bchg, OPE_BIT
    }
    , 
    {
        "bclr", op_bclr, OPE_BIT
    }
    , 
    {
        "bfchg", op_bfchg, OPE_BF1
    }
    , 
    {
        "bfclr", op_bfclr, OPE_BF1
    }
    , 
    {
        "bfexts", op_bfexts, OPE_BF2
    }
    , 
    {
        "bfextu", op_bfextu, OPE_BF2
    }
    , 
    {
        "bfffo", op_bfffo, OPE_BF2
    }
    , 
    {
        "bfins", op_bfins, OPE_BF3
    }
    , 
    {
        "bfset", op_bfset, OPE_BF1
    }
    , 
    {
        "bftst", op_bftst, OPE_BF1
    }
    , 
    {
        "bkpt", op_bkpt, OPE_I
    }
    , 
    {
        "bset", op_bset, OPE_BIT
    }
    , 
    {
        "btst", op_btst, OPE_BIT
    }
    , 
    {
        "chk", op_chk, OPE_EAD
    }
    , 
    {
        "chk2", op_chk2, OPE_EAR
    }
    , 
    {
        "clr", op_clr, OPE_EA
    }
    , 
    {
        "cmp", op_cmp, OPE_CMP
    }
    , 
    {
        "cmpa", op_cmpa, OPE_EAA
    }
    , 
    {
        "cmpi", op_cmpi, OPE_IEA
    }
    , 
    {
        "cmpm", op_cmpm, OPE_POSBCD
    }
    , 
    {
        "cmp2", op_cmp2, OPE_EAR
    }
    , 
    {
        "dbeq", op_dbeq, OPE_DBR
    }
    , 
    {
        "dbne", op_dbne, OPE_DBR
    }
    , 
    {
        "dblt", op_dblt, OPE_DBR
    }
    , 
    {
        "dble", op_dble, OPE_DBR
    }
    , 
    {
        "dbgt", op_dbgt, OPE_DBR
    }
    , 
    {
        "dbge", op_dbge, OPE_DBR
    }
    , 
    {
        "dbhi", op_dbhi, OPE_DBR
    }
    , 
    {
        "dbhs", op_dbhs, OPE_DBR
    }
    , 
    {
        "dblo", op_dblo, OPE_DBR
    }
    , 
    {
        "dbls", op_dbls, OPE_DBR
    }
    , 
    {
        "dbsr", op_dbsr, OPE_DBR
    }
    , 
    {
        "dbcc", op_dbcc, OPE_DBR
    }
    , 
    {
        "dbcs", op_dbcs, OPE_DBR
    }
    , 
    {
        "dbmi", op_dbmi, OPE_DBR
    }
    , 
    {
        "dbpl", op_dbpl, OPE_DBR
    }
    , 
    {
        "dbvc", op_dbvc, OPE_DBR
    }
    , 
    {
        "dbvs", op_dbvs, OPE_DBR
    }
    , 
    {
        "dbt", op_dbt, OPE_DBR
    }
    , 
    {
        "dbf", op_dbf, OPE_DBR
    }
    , 
    {
        "dbra", op_dbra, OPE_DBR
    }
    , 
    {
        "divs", op_divs, OPE_DIV
    }
    , 
    {
        "divu", op_divu, OPE_DIV
    }
    , 
    {
        "divsl", op_divsl, OPE_DIVL
    }
    , 
    {
        "divul", op_divul, OPE_DIVL
    }
    , 
    {
        "eor", op_eor, OPE_EOR
    }
    , 
    {
        "eori", op_eori, OPE_ILOG
    }
    , 
    {
        "exg", op_exg, OPE_RRL
    }
    , 
    {
        "ext", op_ext, OPE_EXT
    }
    , 
    {
        "extb", op_extb, OPE_EXTB
    }
    , 
    {
        "illegal", op_illegal, 0
    }
    , 
    {
        "jmp", op_jmp, OPE_JEA
    }
    , 
    {
        "jsr", op_jsr, OPE_JEA
    }
    , 
    {
        "lea", op_lea, OPE_LEA
    }
    , 
    {
        "link", op_link, OPE_AI
    }
    , 
    {
        "lsl", op_lsl, OPE_SHIFT
    }
    , 
    {
        "lsr", op_lsr, OPE_SHIFT
    }
    , 
    {
        "move", op_move, OPE_MOVE
    }
    , 
    {
        "movea", op_movea, OPE_MOVEA
    }
    , 
    {
        "movec", op_movec, OPE_MOVEC
    }
    , 
    {
        "movem", op_movem, OPE_MOVEM
    }
    , 
    {
        "movep", op_movep, OPE_MOVEP
    }
    , 
    {
        "moveq", op_moveq, OPE_MOVEQ
    }
    , 
    {
        "moves", op_moves, OPE_MOVES
    }
    , 
    {
        "muls", op_muls, OPE_MUL
    }
    , 
    {
        "mulu", op_mulu, OPE_MUL
    }
    , 
    {
        "nbcd", op_nbcd, OPE_EAB
    }
    , 
    {
        "neg", op_neg, OPE_EA
    }
    , 
    {
        "negx", op_negx, OPE_EA
    }
    , 
    {
        "nop", op_nop, 0
    }
    , 
    {
        "not", op_not, OPE_EA
    }
    , 
    {
        "or", op_or, OPE_LOG
    }
    , 
    {
        "ori", op_ori, OPE_ILOG
    }
    , 
    {
        "pack", op_pack, OPE_PACK
    }
    , 
    {
        "pea", op_pea, OPE_JEA
    }
    , 
    {
        "rems", op_rems, OPE_DIV
    }
    , 
    {
        "remu", op_remu, OPE_DIV
    }
    , 
    {
        "reset", op_reset, 0
    }
    , 
    {
        "rol", op_rol, OPE_SHIFT
    }
    , 
    {
        "ror", op_ror, OPE_SHIFT
    }
    , 
    {
        "roxl", op_roxl, OPE_SHIFT
    }
    , 
    {
        "roxr", op_roxr, OPE_SHIFT
    }
    , 
    {
        "rtd", op_rtd, OPE_I
    }
    , 
    {
        "rte", op_rte, 0
    }
    , 
    {
        "rtr", op_rtr, 0
    }
    , 
    {
        "rts", op_rts, 0
    }
    , 
    {
        "sbcd", op_sbcd, OPE_NEGBCD
    }
    , 
    {
        "seq", op_seq, OPE_SET
    }
    , 
    {
        "sne", op_sne, OPE_SET
    }
    , 
    {
        "slt", op_slt, OPE_SET
    }
    , 
    {
        "sle", op_sle, OPE_SET
    }
    , 
    {
        "sgt", op_sgt, OPE_SET
    }
    , 
    {
        "sge", op_sge, OPE_SET
    }
    , 
    {
        "shi", op_shi, OPE_SET
    }
    , 
    {
        "shs", op_shs, OPE_SET
    }
    , 
    {
        "slo", op_slo, OPE_SET
    }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -