projects
/
fw
/
sdcc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* as/z80/z80mch.c: fixed bug #1704376: missing as-z80 errors
[fw/sdcc]
/
src
/
hc08
/
main.c
diff --git
a/src/hc08/main.c
b/src/hc08/main.c
index 2e1c7cd055b33236e98505adc1d827ee16e2cc88..da5fd14fcaf69c3c4a6b9e5bfa1d67ba2ab6a13d 100644
(file)
--- a/
src/hc08/main.c
+++ b/
src/hc08/main.c
@@
-8,9
+8,9
@@
#include "main.h"
#include "ralloc.h"
#include "gen.h"
#include "main.h"
#include "ralloc.h"
#include "gen.h"
+#include "dbuf_string.h"
#include "../SDCCutil.h"
#include "../SDCCutil.h"
-void copyFile(FILE *dest, FILE *src);
extern char * iComments2;
extern DEBUGFILE dwarf2DebugFile;
extern int dwarf2FinalizeFile(FILE *);
extern char * iComments2;
extern DEBUGFILE dwarf2DebugFile;
extern int dwarf2FinalizeFile(FILE *);
@@
-68,7
+68,7
@@
_hc08_reset_regparm (void)
}
static int
}
static int
-_hc08_regparm (sym_link * l)
+_hc08_regparm (sym_link * l
, bool reentrant
)
{
int size = getSize(l);
{
int size = getSize(l);
@@
-164,10
+164,11
@@
_hc08_genAssemblerPreamble (FILE * of)
symbol *mainExists=newSymbol("main", 0);
mainExists->block=0;
symbol *mainExists=newSymbol("main", 0);
mainExists->block=0;
- fprintf (of, "\t.area %s\n",
port->mem.code_name
);
+ fprintf (of, "\t.area %s\n",
HOME_NAME
);
fprintf (of, "\t.area GSINIT0 (CODE)\n");
fprintf (of, "\t.area %s\n",port->mem.static_name);
fprintf (of, "\t.area %s\n",port->mem.post_static_name);
fprintf (of, "\t.area GSINIT0 (CODE)\n");
fprintf (of, "\t.area %s\n",port->mem.static_name);
fprintf (of, "\t.area %s\n",port->mem.post_static_name);
+ fprintf (of, "\t.area %s\n",CODE_NAME);
fprintf (of, "\t.area %s\n",port->mem.xinit_name);
fprintf (of, "\t.area %s\n",port->mem.const_name);
fprintf (of, "\t.area %s\n",port->mem.data_name);
fprintf (of, "\t.area %s\n",port->mem.xinit_name);
fprintf (of, "\t.area %s\n",port->mem.const_name);
fprintf (of, "\t.area %s\n",port->mem.data_name);
@@
-251,28
+252,28
@@
_hc08_genExtraAreas (FILE * asmFile, bool mainExists)
fprintf (asmFile, "%s", iComments2);
fprintf (asmFile, "; extended address mode data\n");
fprintf (asmFile, "%s", iComments2);
fprintf (asmFile, "%s", iComments2);
fprintf (asmFile, "; extended address mode data\n");
fprintf (asmFile, "%s", iComments2);
-
copyFile (asmFile, xdata->o
File);
+
dbuf_write_and_destroy (&xdata->oBuf, asm
File);
}
/* Generate interrupt vector table. */
static int
}
/* Generate interrupt vector table. */
static int
-_hc08_genIVT (
FILE * o
f, symbol ** interrupts, int maxInterrupts)
+_hc08_genIVT (
struct dbuf_s * oBu
f, symbol ** interrupts, int maxInterrupts)
{
int i;
{
int i;
-
fprintf (o
f, "\t.area\tCODEIVT (ABS)\n");
-
fprintf (o
f, "\t.org\t0x%04x\n",
+
dbuf_printf (oBu
f, "\t.area\tCODEIVT (ABS)\n");
+
dbuf_printf (oBu
f, "\t.org\t0x%04x\n",
(0xfffe - (maxInterrupts * 2)));
for (i=maxInterrupts;i>0;i--)
{
if (interrupts[i])
(0xfffe - (maxInterrupts * 2)));
for (i=maxInterrupts;i>0;i--)
{
if (interrupts[i])
-
fprintf (o
f, "\t.dw\t%s\n", interrupts[i]->rname);
+
dbuf_printf (oBu
f, "\t.dw\t%s\n", interrupts[i]->rname);
else
else
-
fprintf (o
f, "\t.dw\t0xffff\n");
+
dbuf_printf (oBu
f, "\t.dw\t0xffff\n");
}
}
-
fprintf (o
f, "\t.dw\t%s", "__sdcc_gs_init_startup\n");
+
dbuf_printf (oBu
f, "\t.dw\t%s", "__sdcc_gs_init_startup\n");
return TRUE;
}
return TRUE;
}
@@
-418,6
+419,9
@@
PORT hc08_port =
/* Sizes: char, short, int, long, ptr, fptr, gptr, bit, float, max */
1, 2, 2, 4, 2, 2, 2, 1, 4, 4
},
/* Sizes: char, short, int, long, ptr, fptr, gptr, bit, float, max */
1, 2, 2, 4, 2, 2, 2, 1, 4, 4
},
+ /* tags for generic pointers */
+ { 0x00, 0x40, 0x60, 0x80 }, /* far, near, xstack, code */
+
{
"XSEG",
"STACK",
{
"XSEG",
"STACK",
@@
-434,7
+438,10
@@
PORT hc08_port =
"HOME (CODE)",
"XISEG", // initialized xdata
"XINIT", // a code copy of xiseg
"HOME (CODE)",
"XISEG", // initialized xdata
"XINIT", // a code copy of xiseg
- "CONST (CODE)", // const_name - const data (code or not)
+ "CONST (CODE)", // const_name - const data (code or not)
+ "CABS (ABS,CODE)", // cabs_name - const absolute data (code or not)
+ "XABS (ABS)", // xabs_name - absolute xdata
+ "IABS (ABS)", // iabs_name - absolute data
NULL,
NULL,
1
NULL,
NULL,
1