some more avr intermediate stuff
[fw/sdcc] / src / avr / main.c
index eb7eb3c648bbd2cdd52a4b5addadb0902a69d78e..9e4ed5bb27294bc88602e0a19390c4e12498e5e2 100644 (file)
@@ -37,6 +37,11 @@ static char *_avr_keywords[] =     {
 
 static int regParmFlg = 0; /* determine if we can register a parameter */
 
+static void _avr_init(void)
+{
+    asm_addTree(&asm_asxxxx_mapping);
+}
+
 static void _avr_reset_regparm()
 {
     regParmFlg = 0;
@@ -86,10 +91,13 @@ static void _avr_finaliseOptions(void)
        BIT-ACCESS     -   NO
        CODE-ACESS     -   NO 
        DEBUG-NAME     -   'B'
-       POINTER-TYPE   -   POINTER
+       POINTER-TYPE   -   FPOINTER
     */
     istack       = allocMap (0, 1, 0, 0, 0, 0,options.stack_loc, ISTACK_NAME,'B',FPOINTER);
 
+    /* also change xdata to be direct space since we can use lds/sts */
+    xdata->direct = 1;
+
 }
 
 static void _avr_setDefaultOptions(void)
@@ -135,14 +143,19 @@ PORT avr_port = {
     "ATMEL AVR",               /* Target name */
     {
        TRUE,                   /* Emit glue around main */
+       MODEL_LARGE | MODEL_SMALL,
+       MODEL_SMALL
     },
     {  
        _asmCmd,
        "-plosgffc",            /* Options with debug */
        "-plosgff",             /* Options without debug */
+       0
     },
     {
-       _linkCmd
+       _linkCmd, 
+       NULL,
+       ".rel"
     },
     {
        _defaultRules
@@ -163,17 +176,20 @@ PORT avr_port = {
        "GSINIT  (CODE)",
        "OSEG    (OVR,DATA)",
        "GSFINAL (CODE)",
+       "HOME    (CODE)",
        NULL,
        NULL,
+       0,
     },
     { 
-       -1, 1, 4, 1, 1
+       -1, 1, 4, 1, 1, 0
     },
     /* avr has an 8 bit mul */
     {
-       1
+       1, 0
     },
-    NULL,
+    "_",
+    _avr_init,
     _avr_parseOptions,
     _avr_finaliseOptions,
     _avr_setDefaultOptions,
@@ -183,6 +199,15 @@ PORT avr_port = {
     _avr_genAssemblerPreamble,
     _avr_genIVT,
     _avr_reset_regparm,
-    _avr_regparm
+    _avr_regparm,
+    NULL,
+    FALSE,
+    0,   /* leave lt */
+    1,   /* transform gt ==> not le */
+    0,   /* leave le */
+    0,   /* leave ge */
+    0,   /* leave !=  */
+    0,   /* leave == */
+
 };