and - Jean-Louis VERN.jlvern@writeme.com (1999)
Bug Fixes - Wojciech Stryjewski wstryj1@tiger.lsu.edu (1999 v2.1.9a)
PIC port - Scott Dattalo scott@dattalo.com (2000)
- cont'd - Raphael Neider rneider@web.de (2005)
+ cont'd - Raphael Neider <rneider AT web.de> (2005)
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
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
+#ifndef __sun__
+#if defined(_MSC_VER)
+ #include "pstdint.h"
+#else
+ #include <stdint.h>
+#endif
+#endif
#include "SDCCglobl.h"
-#include "newalloc.h"
+#include "newalloc.h"
#include "common.h"
#include "SDCCpeeph.h"
static int labelOffset=0;
extern int debug_verbose;
+extern int pic14_hasInterrupt;
//static int optimized_for_speed = 0;
/* max_key keeps track of the largest label number used in
{
va_list ap;
char lb[INITIAL_INLINEASM];
- unsigned char *lbp = lb;
+ unsigned char *lbp = (unsigned char *)lb;
if(!debug_verbose && !options.debug)
return;
{
va_list ap;
char lb[INITIAL_INLINEASM];
- unsigned char *lbp = lb;
+ unsigned char *lbp = (unsigned char *)lb;
va_start(ap,fmt);
/* else spill location */
if (sym->usl.spillLoc)
{
+ asmop *oldAsmOp = NULL;
+
if (getSize(sym->type) != getSize(sym->usl.spillLoc->type))
{
/* force a new aop if sizes differ */
+ oldAsmOp = sym->usl.spillLoc->aop;
sym->usl.spillLoc->aop = NULL;
}
DEBUGpic14_emitcode(";","%s %d %s sym->rname = %s, offset %d",
sym->rname, sym->usl.spillLoc->offset);
sym->aop = op->aop = aop = newAsmop(AOP_PCODE);
+ if (getSize(sym->type) != getSize(sym->usl.spillLoc->type))
+ {
+ /* Don't reuse the new aop, go with the last one */
+ sym->usl.spillLoc->aop = oldAsmOp;
+ }
//aop->aopu.pcop = popGetImmd(sym->usl.spillLoc->rname,0,sym->usl.spillLoc->offset);
aop->aopu.pcop = popRegFromString(sym->usl.spillLoc->rname,
getSize(sym->type),
{
sym_link *dtype;
symbol *sym;
- unsigned char *name;
+ char *name;
int isExtern;
FENTRY;
*/
emitpcode(POC_CALL,popGetLabel(albl->key));
pcop = popGetLabel(blbl->key);
- emitpcode(POC_PAGESEL,popGetWithString(pcop->name,0)); /* Must restore PCLATH before goto, without destroying W */
+ emitpcode(POC_PAGESEL,pcop); /* Must restore PCLATH before goto, without destroying W */
emitpcode(POC_GOTO,pcop);
emitpLabel(albl->key);
emitpcode(POC_CLRF, popCopyReg(&pc_pclath));/* during an interrupt PCLATH must be cleared before a goto or call statement */
pBlockConvert2ISR(pb);
+ pic14_hasInterrupt = 1;
#if 0
if (!inExcludeList("acc"))
pic14_emitcode ("push","acc");
{
union {
float d;
- unsigned long l;
+ uint32_t l;
} float_long;
- assert (sizeof (float) == sizeof (long));
+ assert (sizeof (float) == sizeof (uint32_t));
//fprintf (stderr, "%s:%u(%s): val=%lf, type: %d, etype: %d\n", __FILE__, __LINE__, __FUNCTION__, floatFromVal(val), SPEC_NOUN(val->type), SPEC_NOUN(val->etype));
pic14_toBoolean(cond);
else
isbit = 1;
- /* the result is now in the accumulator */
- freeAsmop(cond,NULL,ic,TRUE);
/* if there was something to be popped then do it */
if (popIc)
if (IC_TRUE(ic))
{
assert (!IC_FALSE(ic));
- emitSKPNC;
+ emitpcode(POC_BTFSC, popGet(AOP(cond), 0));
+ //emitSKPNC;
emitpcode(POC_GOTO, popGetLabel(IC_TRUE(ic)->key));
} else {
assert (IC_FALSE(ic));
- emitSKPC;
+ emitpcode(POC_BTFSS, popGet(AOP(cond), 0));
+ //emitSKPC;
emitpcode(POC_GOTO, popGetLabel(IC_FALSE(ic)->key));
}
+ if (0)
{
static int hasWarned = 0;
if (!hasWarned)
ic->generated = 1;
+ /* the result is now in the accumulator */
+ freeAsmop(cond,NULL,ic,TRUE);
}
/*-----------------------------------------------------------------*/