1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-28 22:30:12 +00:00

Small fixes for Watcom-C

git-svn-id: svn://svn.cc65.org/cc65/trunk@752 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2001-05-24 08:04:42 +00:00
parent d96baa7c42
commit 1d458e9f33
5 changed files with 88 additions and 50 deletions

View File

@ -79,6 +79,7 @@ OBJS = condasm.obj \
incpath.obj \
instr.obj \
istack.obj \
lineinfo.obj \
listing.obj \
macpack.obj \
macro.obj \
@ -126,6 +127,7 @@ FILE global.obj
FILE incpath.obj
FILE instr.obj
FILE istack.obj
FILE lineinfo.obj
FILE listing.obj
FILE macpack.obj
FILE macro.obj

View File

@ -68,41 +68,49 @@ CCCFG = $(CCCFG) -i=..\common
# All library OBJ files
OBJS = anonname.obj \
asmcode.obj \
asmcode.obj \
asmlabel.obj \
asmline.obj \
codeent.obj \
codegen.obj \
codelab.obj \
codeinfo.obj \
codeopt.obj \
codeseg.obj \
compile.obj \
cpu.obj \
coptind.obj \
cpu.obj \
dataseg.obj \
datatype.obj \
declare.obj \
declattr.obj \
error.obj \
expr.obj \
exprheap.obj \
expr.obj \
exprheap.obj \
exprnode.obj \
funcdesc.obj \
function.obj \
global.obj \
goto.obj \
ident.obj \
incpath.obj \
incpath.obj \
input.obj \
lineinfo.obj \
litpool.obj \
locals.obj \
loop.obj \
macrotab.obj \
main.obj \
optimize.obj \
pragma.obj \
opcodes.obj \
preproc.obj \
stmt.obj \
scanner.obj \
segname.obj \
stdfunc.obj \
symentry.obj \
symtab.obj \
typecmp.obj \
pragma.obj \
scanner.obj \
segments.obj \
stdfunc.obj \
stmt.obj \
symentry.obj \
symtab.obj \
textseg.obj \
typecmp.obj \
util.obj
LIBS = ..\common\common.lib
@ -129,10 +137,16 @@ NAME $<
FILE anonname.obj
FILE asmcode.obj
FILE asmlabel.obj
FILE asmline.obj
FILE codeent.obj
FILE codegen.obj
FILE codelab.obj
FILE codeinfo.obj
FILE codeopt.obj
FILE codeseg.obj
FILE compile.obj
FILE coptind.obj
FILE cpu.obj
FILE dataseg.obj
FILE datatype.obj
FILE declare.obj
FILE declattr.obj
@ -147,20 +161,22 @@ FILE goto.obj
FILE ident.obj
FILE incpath.obj
FILE input.obj
FILE lineinfo.obj
FILE litpool.obj
FILE locals.obj
FILE loop.obj
FILE macrotab.obj
FILE main.obj
FILE optimize.obj
FILE pragma.obj
FILE opcodes.obj
FILE preproc.obj
FILE stmt.obj
FILE pragma.obj
FILE scanner.obj
FILE segname.obj
FILE segments.obj
FILE stdfunc.obj
FILE stmt.obj
FILE symentry.obj
FILE symtab.obj
FILE textseg.obj
FILE typecmp.obj
FILE util.obj
LIBRARY ..\common\common.lib

View File

@ -181,23 +181,25 @@ unsigned GetInsnSize (opc_t OPC, am_t AM)
/* Get the opcode desc and check the size given there */
const OPCDesc* D = &OPCTable[OPC];
if (D->Size != 0) {
return D->Size;
return D->Size;
}
/* Check the addressing mode. */
switch (AM) {
case AM_IMP: return 1;
case AM_ACC: return 1;
case AM_IMM: return 2;
case AM_ZP: return 2;
case AM_ZPX: return 2;
case AM_ABS: return 3;
case AM_ABSX: return 3;
case AM_ABSY: return 3;
case AM_ZPX_IND: return 2;
case AM_ZP_INDY: return 2;
case AM_ZP_IND: return 2;
default: FAIL ("Invalid addressing mode");
case AM_IMP: return 1;
case AM_ACC: return 1;
case AM_IMM: return 2;
case AM_ZP: return 2;
case AM_ZPX: return 2;
case AM_ABS: return 3;
case AM_ABSX: return 3;
case AM_ABSY: return 3;
case AM_ZPX_IND: return 2;
case AM_ZP_INDY: return 2;
case AM_ZP_IND: return 2;
default:
Internal ("Invalid addressing mode");
return 0;
}
}
@ -242,7 +244,9 @@ opc_t GetInverseBranch (opc_t OPC)
case OPC_JPL: return OPC_JMI;
case OPC_JVC: return OPC_JVS;
case OPC_JVS: return OPC_JVC;
default: Internal ("GetInverseBranch: Invalid opcode: %d", OPC);
default:
Internal ("GetInverseBranch: Invalid opcode: %d", OPC);
return 0;
}
}
@ -272,7 +276,9 @@ opc_t MakeShortBranch (opc_t OPC)
case OPC_JVS: return OPC_BVS;
case OPC_BRA:
case OPC_JMP: return (CPU == CPU_65C02)? OPC_BRA : OPC_JMP;
default: Internal ("GetShortBranch: Invalid opcode: %d", OPC);
default:
Internal ("GetShortBranch: Invalid opcode: %d", OPC);
return 0;
}
}
@ -302,7 +308,9 @@ opc_t MakeLongBranch (opc_t OPC)
case OPC_JVS: return OPC_JVS;
case OPC_BRA:
case OPC_JMP: return OPC_JMP;
default: Internal ("GetShortBranch: Invalid opcode: %d", OPC);
default:
Internal ("GetShortBranch: Invalid opcode: %d", OPC);
return 0;
}
}
@ -328,7 +336,9 @@ bc_t GetBranchCond (opc_t OPC)
case OPC_JPL: return BC_PL;
case OPC_JVC: return BC_VC;
case OPC_JVS: return BC_VS;
default: Internal ("GetBranchCond: Invalid opcode: %d", OPC);
default:
Internal ("GetBranchCond: Invalid opcode: %d", OPC);
return 0;
}
}
@ -346,7 +356,9 @@ bc_t GetInverseCond (bc_t BC)
case BC_PL: return BC_MI;
case BC_VC: return BC_VS;
case BC_VS: return BC_VC;
default: Internal ("GetInverseCond: Invalid condition: %d", BC);
default:
Internal ("GetInverseCond: Invalid condition: %d", BC);
return 0;
}
}
@ -356,15 +368,17 @@ opc_t GetLongBranch (bc_t BC)
/* Return a long branch for the given branch condition */
{
switch (BC) {
case BC_CC: return OPC_JCC;
case BC_CS: return OPC_JCS;
case BC_EQ: return OPC_JEQ;
case BC_MI: return OPC_JMI;
case BC_NE: return OPC_JNE;
case BC_PL: return OPC_JPL;
case BC_VC: return OPC_JVC;
case BC_VS: return OPC_JVS;
default: Internal ("GetLongBranch: Invalid condition: %d", BC);
case BC_CC: return OPC_JCC;
case BC_CS: return OPC_JCS;
case BC_EQ: return OPC_JEQ;
case BC_MI: return OPC_JMI;
case BC_NE: return OPC_JNE;
case BC_PL: return OPC_JPL;
case BC_VC: return OPC_JVC;
case BC_VS: return OPC_JVS;
default:
Internal ("GetLongBranch: Invalid condition: %d", BC);
return 0;
}
}
@ -382,7 +396,9 @@ opc_t GetShortBranch (bc_t BC)
case BC_PL: return OPC_BPL;
case BC_VC: return OPC_BVC;
case BC_VS: return OPC_BVS;
default: Internal ("GetShortBranch: Invalid condition: %d", BC);
default:
Internal ("GetShortBranch: Invalid condition: %d", BC);
return 0;
}
}

View File

@ -187,7 +187,9 @@ struct DataSeg* GetDataSeg (void)
case SEG_BSS: return CS->BSS;
case SEG_DATA: return CS->Data;
case SEG_RODATA: return CS->ROData;
default: FAIL ("Invalid data segment");
default:
FAIL ("Invalid data segment");
return 0;
}
}

View File

@ -120,10 +120,12 @@ FILE error.obj
FILE exports.obj
FILE expr.obj
FILE extsyms.obj
FILE fileinfo.obj
FILE fileio.obj
FILE fragment.obj
FILE global.obj
FILE library.obj
FILE library.obj
FILE lineinfo.obj
FILE main.obj
FILE mapfile.obj
FILE o65.obj