From: <to...@us...> - 2004-01-20 17:08:52
|
Update of /cvsroot/ro-oslib/OSLib/!OsLib/Tools/DefMod2/defmod/sources In directory sc8-pr-cvs1:/tmp/cvs-serv10228/OSLib/!OsLib/Tools/DefMod2/defmod/sources Modified Files: Tag: unix-build defmod.y hdr.c objasm.c Log Message: Unix Build Index: defmod.y =================================================================== RCS file: /cvsroot/ro-oslib/OSLib/!OsLib/Tools/DefMod2/defmod/sources/defmod.y,v retrieving revision 1.2.4.1 retrieving revision 1.2.4.2 diff -C2 -d -r1.2.4.1 -r1.2.4.2 *** defmod.y 14 Jan 2004 13:44:31 -0000 1.2.4.1 --- defmod.y 20 Jan 2004 17:08:47 -0000 1.2.4.2 *************** *** 32,35 **** --- 32,36 ---- /*From CLib*/ #include <ctype.h> + #include <errno.h> #include <stddef.h> #include <stdlib.h> *************** *** 179,184 **** { os_error *error; if ((error = lookup_insert (needses, $1, NULL)) != NULL) ! { yyerror (error->errmess); YYERROR; } --- 180,188 ---- { os_error *error; + tracef( "needs: Inserting \"%s\"\n" _ $1 ); if ((error = lookup_insert (needses, $1, NULL)) != NULL) ! { ! tracef( "Error %s\n" _ error -> errmess ); ! yyerror (error->errmess); YYERROR; } *************** *** 190,195 **** { os_error *error; if ((error = lookup_insert (needsatends, $1, NULL)) != NULL) ! { yyerror (error->errmess); YYERROR; } --- 194,202 ---- { os_error *error; + tracef( "needsatend: Inserting \"%s\"\n" _ $1 ); if ((error = lookup_insert (needsatends, $1, NULL)) != NULL) ! { ! tracef( "Error %s\n" _ error -> errmess ); ! yyerror (error->errmess); YYERROR; } *************** *** 201,204 **** --- 208,212 ---- ID EQUALS type COLON const DESCRIPTION_OPTION { os_error *error; + tracef( "const_defn\n"); def_c c = qalloc (sizeof *c); def_t t = qalloc (def_sizeof_TYPE ($3.tag)); *************** *** 209,214 **** c->description = EMPTY ($6)? NULL: qstrdup ($6); if ((error = lookup_insert (consts, $1, c)) != NULL) ! { yyerror (error->errmess); YYERROR; } --- 217,225 ---- c->description = EMPTY ($6)? NULL: qstrdup ($6); + tracef( "Inserting \"%s\"\n" _ $1 ); if ((error = lookup_insert (consts, $1, c)) != NULL) ! { ! tracef( "Error %s\n" _ error -> errmess ); ! yyerror (error->errmess); YYERROR; } *************** *** 221,226 **** def_c c; if ((error = lookup (consts, $1, (void **) &c)) != NULL) ! { yyerror (error->errmess); YYERROR; } --- 232,240 ---- def_c c; + tracef( "const: looking up: \"%s\"\n" _ $1 ); if ((error = lookup (consts, $1, (void **) &c)) != NULL) ! { ! tracef( "Error %s\n" _ error -> errmess ); ! yyerror (error->errmess); YYERROR; } *************** *** 242,245 **** --- 256,260 ---- ID DESCRIPTION_OPTION { os_error *error; + tracef( "type_defn\n" ); def_t t = qalloc (def_sizeof_TYPE (def_TYPE_ABSTRACT)); *************** *** 249,254 **** t->description = EMPTY ($2)? NULL: qstrdup ($2); if ((error = lookup_insert (types, $1, t)) != NULL) ! { yyerror (error->errmess); YYERROR; } --- 264,272 ---- t->description = EMPTY ($2)? NULL: qstrdup ($2); + tracef( "Inserting \"%s\"\n" _ $1 ); if ((error = lookup_insert (types, $1, t)) != NULL) ! { ! tracef( "Error %s\n" _ error -> errmess ); ! yyerror (error->errmess); YYERROR; } *************** *** 256,259 **** --- 274,278 ---- ID EQUALS type DESCRIPTION_OPTION { os_error *error; + tracef( "type_defn\n" ); def_t t = qalloc (def_sizeof_TYPE ($3.tag)); *************** *** 261,266 **** t->description = EMPTY ($4)? NULL: qstrdup ($4); if ((error = lookup_insert (types, $1, t)) != NULL) ! { yyerror (error->errmess); YYERROR; } --- 280,288 ---- t->description = EMPTY ($4)? NULL: qstrdup ($4); + tracef( "Inserting \"%s\"\n" _ $1 ); if ((error = lookup_insert (types, $1, t)) != NULL) ! { ! tracef( "Error %s\n" _ error -> errmess ); ! yyerror (error->errmess); YYERROR; } *************** *** 274,280 **** def_t t; if ((error = lookup (types, $2, (void **) &t)) != NULL && error->errnum != os_GLOBAL_NO_ANY) ! { yyerror (error->errmess); YYERROR; } --- 296,305 ---- def_t t; + tracef( "base_type: looking up: \"%s\"\n" _ $2 ); if ((error = lookup (types, $2, (void **) &t)) != NULL && error->errnum != os_GLOBAL_NO_ANY) ! { ! tracef( "Error %s\n" _ error -> errmess ); ! yyerror (error->errmess); YYERROR; } *************** *** 318,322 **** $$.value = def_VALUE_REGISTER; $$.description = NULL;} | REF type ! { def_t t = qalloc (def_sizeof_TYPE ($2.tag)); memcpy (t, &$2, def_sizeof_TYPE ($2.tag)); --- 343,349 ---- $$.value = def_VALUE_REGISTER; $$.description = NULL;} | REF type ! { ! tracef( "type\n" ); ! def_t t = qalloc (def_sizeof_TYPE ($2.tag)); memcpy (t, &$2, def_sizeof_TYPE ($2.tag)); *************** *** 345,349 **** $$.description = NULL; if ($2.tag != def_TYPE_VOID) ! { $$.data AS list.base = qalloc (def_sizeof_TYPE ($2.tag)); memcpy ($$.data AS list.base, &$2, def_sizeof_TYPE ($2.tag)); } --- 372,378 ---- $$.description = NULL; if ($2.tag != def_TYPE_VOID) ! { ! tracef( "type\n" ); ! $$.data AS list.base = qalloc (def_sizeof_TYPE ($2.tag)); memcpy ($$.data AS list.base, &$2, def_sizeof_TYPE ($2.tag)); } *************** *** 358,362 **** } | SUB const BUS type ! { def_t t = qalloc (def_sizeof_TYPE ($4.tag)); if ($4.value == def_VALUE_VARIABLE) --- 387,393 ---- } | SUB const BUS type ! { ! tracef( "type\n" ); ! def_t t = qalloc (def_sizeof_TYPE ($4.tag)); if ($4.value == def_VALUE_VARIABLE) *************** *** 379,385 **** def_t t; if ((error = lookup (types, $1, (void **) &t)) != NULL && error->errnum != os_GLOBAL_NO_ANY) ! { yyerror (error->errmess); YYERROR; } --- 410,419 ---- def_t t; + tracef( "type: looking up ID: \"%s\"\n" _ $1 ); if ((error = lookup (types, $1, (void **) &t)) != NULL && error->errnum != os_GLOBAL_NO_ANY) ! { ! tracef( "Error %s\n" _ error -> errmess ); ! yyerror (error->errmess); YYERROR; } *************** *** 390,393 **** --- 424,428 ---- { /*have to make an optimistic assumption*/ $$.value = def_VALUE_REGISTER; + tracef( "type \"%s\" undefined\n" _ $1 ); if (Verbose && !Quiet) fprintf (stderr, "warning: type \"%s\" undefined at line " *************** *** 398,401 **** --- 433,438 ---- $$.description = NULL; strcpy ($$.data AS id, $1); + + tracef( "type: ID done\n" ); }; *************** *** 404,408 **** typed_var: type COLON ID DESCRIPTION_OPTION ! { $$ = $1; $$.name = qstrdup ($3); $$.description = EMPTY ($4)? NULL: qstrdup ($4); --- 441,447 ---- typed_var: type COLON ID DESCRIPTION_OPTION ! { ! tracef( "type\n" ); ! $$ = $1; $$.name = qstrdup ($3); $$.description = EMPTY ($4)? NULL: qstrdup ($4); *************** *** 410,414 **** toided_var: toid COLON ID DESCRIPTION_OPTION ! { $$ = $1; $$.name = qstrdup ($3); $$.description = EMPTY ($4)? NULL: qstrdup ($4); --- 449,455 ---- toided_var: toid COLON ID DESCRIPTION_OPTION ! { ! tracef( "type\n" ); ! $$ = $1; $$.name = qstrdup ($3); $$.description = EMPTY ($4)? NULL: qstrdup ($4); *************** *** 420,429 **** ID EQUALS swi { os_error *error; def_s s = qalloc (sizeof *s); *s = $3; if ((error = lookup_insert (swis, $1, s)) != NULL) ! { yyerror (error->errmess); YYERROR; } --- 461,474 ---- ID EQUALS swi { os_error *error; + tracef( "type\n" ); def_s s = qalloc (sizeof *s); *s = $3; + tracef( "Inserting \"%s\"\n" _ $1 ); if ((error = lookup_insert (swis, $1, s)) != NULL) ! { ! tracef( "Error %s\n" _ error -> errmess ); ! yyerror (error->errmess); YYERROR; } *************** *** 447,452 **** entry_condition: REG CONTAINS typed_var ! { if ($3.value != def_VALUE_REGISTER) ! { yyerror ("type cannot occur in a register"); YYERROR; } --- 492,501 ---- entry_condition: REG CONTAINS typed_var ! { ! tracef( "entry_condition\n" ); ! if ($3.value != def_VALUE_REGISTER) ! { ! tracef( "Error: type cannot occur in a register\n" ); ! yyerror ("type cannot occur in a register"); YYERROR; } *************** *** 454,461 **** $$.i |= 1 << $1; $$.inputs [$1] = qalloc (def_sizeof_TYPE ($3.tag)); memcpy ($$.inputs [$1], &$3, def_sizeof_TYPE ($3.tag)); } | REG REFERENCES typed_var ! { $$ = Empty; $$.i |= 1 << $1; $$.ri |= 1 << $1; --- 503,514 ---- $$.i |= 1 << $1; $$.inputs [$1] = qalloc (def_sizeof_TYPE ($3.tag)); + tracef( "memcpy to 0x%x\n" _ $$.inputs [$1] ); memcpy ($$.inputs [$1], &$3, def_sizeof_TYPE ($3.tag)); + tracef( "done\n" ); } | REG REFERENCES typed_var ! { ! tracef( "entry_condition\n" ); ! $$ = Empty; $$.i |= 1 << $1; $$.ri |= 1 << $1; *************** *** 463,467 **** memcpy ($$.inputs [$1], &$3, def_sizeof_TYPE ($3.tag)); } | - /* REG CONSTANT NUM description_OPTION */ /* TV 990418 */ REG CONSTANT const description_OPTION { $$ = $4; --- 516,519 ---- *************** *** 473,477 **** } | REG DISJOINS typed_var ! { if ($3.value != def_VALUE_REGISTER) { yyerror ("type cannot occur in a register"); YYERROR; --- 525,531 ---- } | REG DISJOINS typed_var ! { ! tracef( "entry_condition\n" ); ! if ($3.value != def_VALUE_REGISTER) { yyerror ("type cannot occur in a register"); YYERROR; *************** *** 488,492 **** } | REG ADDS typed_var ! { if ($3.value != def_VALUE_REGISTER) { yyerror ("type cannot occur in a register"); YYERROR; --- 542,548 ---- } | REG ADDS typed_var ! { ! tracef( "entry_condition\n" ); ! if ($3.value != def_VALUE_REGISTER) { yyerror ("type cannot occur in a register"); YYERROR; *************** *** 499,503 **** } | REG EXCLUSIVELY_DISJOINS typed_var ! { if ($3.value != def_VALUE_REGISTER) { yyerror ("type cannot occur in a register"); YYERROR; --- 555,561 ---- } | REG EXCLUSIVELY_DISJOINS typed_var ! { ! tracef( "entry_condition\n" ); ! if ($3.value != def_VALUE_REGISTER) { yyerror ("type cannot occur in a register"); YYERROR; *************** *** 516,520 **** exit_condition: REG pling_OPTION CONTAINS typed_var ! { if ($4.value != def_VALUE_REGISTER) { yyerror ("type cannot occur in a register"); YYERROR; --- 574,580 ---- exit_condition: REG pling_OPTION CONTAINS typed_var ! { ! tracef( "exit_condition\n" ); ! if ($4.value != def_VALUE_REGISTER) { yyerror ("type cannot occur in a register"); YYERROR; *************** *** 527,531 **** } | REG pling_OPTION REFERENCES typed_var ! { $$ = Empty; if ($2) $$.value = 1 << $1; $$.o |= 1 << $1; --- 587,593 ---- } | REG pling_OPTION REFERENCES typed_var ! { ! tracef( "exit_condition\n" ); ! $$ = Empty; if ($2) $$.value = 1 << $1; $$.o |= 1 << $1; *************** *** 568,573 **** TITLE: t i t l e ws {tracef ("TITLE\n");}; AUTHOR: a u t h o r ws {tracef ("AUTHOR\n");}; - /* TV 20021116 fix the 16 shift/reduce errors - NEEDS: n e e d s ws {tracef ("NEEDS\n");};*/ NEEDS: n e e d s ws_item_SEQUENCE {tracef ("NEEDS\n");}; NEEDSATEND: n e e d s a t e n d ws {tracef ("NEEDSATEND\n");}; --- 630,633 ---- *************** *** 961,971 **** /* perform a malloc with error checking */ void *qalloc (size_t t) ! { void *p; ! if ((p = malloc (t)) == NULL) ! { yyerror ("not enough memory for |qalloc()|"); exit (1); } return p; } --- 1021,1035 ---- /* perform a malloc with error checking */ void *qalloc (size_t t) ! { void *p = 0; ! //tracef( "qalloc(0x%x)\n" _ t ); ! p = malloc (t); ! if (!p) ! { ! yyerror ("not enough memory for |qalloc()|"); exit (1); } + //tracef( "qalloc returns 0x%x\n" _ p ); return p; } *************** *** 1031,1034 **** --- 1095,1111 ---- trace_initialise ("Trace$To"); + #if TRACE + { + int ii; + tracef( "Main:" ); + for ( ii = 0; ii<argc; ++ii ) + { + os_writec( ' ' ); + os_write0( argv[ii] ); + } + os_new_line(); + } + #endif + if ( (error = lookup_new (&needses, 16)) != NULL || (error = lookup_new (&needsatends, 16)) != NULL || *************** *** 1038,1042 **** (error = lookup_new (&main_byte_wide, 16)) != NULL ) ! goto finish; yydebug = 0; --- 1115,1122 ---- (error = lookup_new (&main_byte_wide, 16)) != NULL ) ! { ! tracef( "Error %s\n" _ error -> errmess ); ! goto finish; ! } yydebug = 0; *************** *** 1069,1113 **** output = argv [++i]; else if (strcmp (argv [i], "-help") == 0) - #if 0 /* TV 20021116 get rid of the macro > 10 lines warning */ - { if ((error = xos_pretty_print ("DefMod " VERSION_INFO - ". Copyright © Jonathan Coxhead, 1994.\r" - "DefMod comes with ABSOLUTELY NO WARRANTY.\r" - "This is free software, and you are welcome to redistribute it " - "under certain conditions. See the file Copying for details.\r" - "Usage: DefMod <type> [-v] [-help] " - "[-o <output-dir> | > <output-file>] " - "[-byte_wide <byte-wide-file>] " - "[-26bit | -32bit] " - "< <module-interface-file>\r" - "Purpose: generate output from a module interface file\r" - "-v\t\t" "verbose\r" - "-q\t\t" "quiet\r" - "-o\t\t" "is required when generating a " - "directory\r" - "<output-dir>\t" "directory to create\r" - "-byte_wide\t" "is required with -s or -l for a " - "module interface using byte-wide " - "types defined elsewhere\r" - "<byte-wide-file>\t" "file containing whitespace-separated " - "names of byte-wide types\r" - "-26bit\t\t" "generate 26 bit code" HELP_STRING_26 "\r" - "-32bit\t\t" "generate 32 bit code" HELP_STRING_32 "\r" - - "<type> is one of:\r" - "\t-asmhelp\t" "SrcEdit assembler help file\r" - "\t-asmstrong\t" "StrongHelp assembler help " - "directory (not implemented)\r" - "\t-chelp\t\t" "SrcEdit C help file\r" - "\t-cstrong\t" "StrongHelp C help directory\r" - "\t-h\t\t" "C header file\r" - "\t-hdr\t\t" "ObjAsm header file\r" - "\t-h++\t\t" "C++ header file (experimental)\r" - "\t-l\t\t" "Directory for running LibFile -c " - "-via ViaFile\r" - "\t-p\t\t" "Pascal header file (not " - "implemented)\r" - "\t-s\t\t" "ObjAsm source file\r", - NULL, NULL)) != NULL) - #else { const char* helptext = "DefMod " VERSION_INFO ". Copyright © Jonathan Coxhead, 1994.\r" --- 1149,1152 ---- *************** *** 1150,1158 **** if ((error = xos_pretty_print (helptext, NULL, NULL)) != NULL) ! #endif ! goto finish; } else if (strcmp (argv [i], "-byte_wide") == 0) ! { /*Add the contents of the given file to the byte wide table.*/ char buffer [256], *cc; #ifdef EXECUTE_ON_UNIX --- 1189,1197 ---- if ((error = xos_pretty_print (helptext, NULL, NULL)) != NULL) ! goto finish; } else if (strcmp (argv [i], "-byte_wide") == 0) ! { ! /*Add the contents of the given file to the byte wide table.*/ char buffer [256], *cc; #ifdef EXECUTE_ON_UNIX *************** *** 1166,1169 **** --- 1205,1210 ---- i++; + // tracef( "Main opening file: %s\n" _ argv[i] ); + #ifdef EXECUTE_ON_UNIX if ((f = fopen(argv[i],"r")) == NULL) { *************** *** 1184,1188 **** #ifdef EXECUTE_ON_UNIX *cc = c = getc(f); ! if (ferror(f)) { error = (os_error *)_kernel_last_oserror(); goto finish; --- 1225,1231 ---- #ifdef EXECUTE_ON_UNIX *cc = c = getc(f); ! if (ferror(f)) ! { ! // tracef( "Error reading character from input stream: %d\n" _ errno ); error = (os_error *)_kernel_last_oserror(); goto finish; *************** *** 1198,1201 **** --- 1241,1246 ---- #endif + // tracef( "State = %d\n" _ state ); + switch (state) { case Skipping: *************** *** 1211,1219 **** else { *cc = '\0'; ! if ((error = lookup_insert (main_byte_wide, buffer, (void *) 1)) != NULL) ! goto finish; ! cc = buffer; state = Skipping; --- 1256,1267 ---- else { *cc = '\0'; ! tracef( "Inserting \"%s\"\n" _ buffer ); if ((error = lookup_insert (main_byte_wide, buffer, (void *) 1)) != NULL) ! { ! tracef( "Error %s\n" _ error -> errmess ); ! goto finish; ! } ! tracef( "Done: \"%s\"\n" _ buffer ); cc = buffer; state = Skipping; *************** *** 1246,1258 **** if (option == None) ! { Parse_Error = TRUE; goto finish; } yyparse (); ! if (Parse_Error) goto finish; switch (option) { case Objasm: if ((error = objasm_output (stdout, Title, Author, needses, needsatends, consts, types, swis, /*separate?*/ FALSE, --- 1294,1314 ---- if (option == None) ! { ! tracef( "Parse error: No option\n" ); ! Parse_Error = TRUE; goto finish; } + tracef( "yyparse\n" ); yyparse (); ! if (Parse_Error) ! { ! tracef( "yyparse error\n" ); ! goto finish; ! } switch (option) { case Objasm: + tracef( "Objasm\n" ); if ((error = objasm_output (stdout, Title, Author, needses, needsatends, consts, types, swis, /*separate?*/ FALSE, *************** *** 1262,1265 **** --- 1318,1322 ---- case C_Header: + tracef( "C_Header\n" ); if ((error = cheader_output (stdout, Title, Author, needses, needsatends, consts, types, swis, /*C++?*/ FALSE)) != NULL) *************** *** 1268,1271 **** --- 1325,1329 ---- case C_Plus_Plus_Header: + tracef( "C_Plus_Plus_Header\n" ); if ((error = cheader_output (stdout, Title, Author, needses, needsatends, consts, types, swis, /*C++?*/ TRUE)) != NULL) *************** *** 1274,1277 **** --- 1332,1336 ---- case C_Help: + tracef( "C_Help\n" ); if ((error = chelp_output (stdout, Title, Author, needses, needsatends, consts, types, swis)) != NULL) *************** *** 1280,1283 **** --- 1339,1343 ---- case Asm_Help: + tracef( "Asm_Help\n" ); if ((error = asmhelp_output (stdout, Title, Author, needses, needsatends, consts, types, swis)) != NULL) *************** *** 1286,1289 **** --- 1346,1350 ---- case Library: + tracef( "Library\n" ); if (output != NULL) if ((error = objasm_output (SKIP, Title, Author, needses, *************** *** 1295,1298 **** --- 1356,1360 ---- case Hdr: + tracef( "Hdr\n" ); if ((error = hdr_output (stdout, Title, Author, needses, needsatends, consts, types, swis)) != NULL) *************** *** 1301,1304 **** --- 1363,1367 ---- case C_Strong: + tracef( "C_Strong\n" ); if (output != NULL) if ((error = cstrong_output (output, Title, Author, needses, *************** *** 1308,1312 **** default: ! break; } --- 1371,1376 ---- default: ! tracef( "default\n" ); ! break; } *************** *** 1329,1334 **** */ int yylex (void) ! { int c; return (c = getchar ()) == EOF? --- 1393,1400 ---- */ int yylex (void) ! { ! int c; + #if 0 return (c = getchar ()) == EOF? *************** *** 1350,1353 **** --- 1416,1446 ---- c ); + #else + c = getchar (); + if ( c == EOF ) c = 0; + + if ( Verbose /* && (c != 0) */ ) + { + if ( ' ' <= c && c <= '~' ) + fputc( c, stderr ); + else if ( c == '\n' ) + { + fputc ('\n', stderr); + fputc ('\r', stderr); + } + else + { + fputc ('\\', stderr); + fputc ('x', stderr); + fputc (UCHAR (c/0x10), stderr); + fputc (UCHAR (c%0x10), stderr); + } + } + + if ( c == 0 ) + tracef( "\nyylex: End of file\n" ); + + return c; + #endif } Index: hdr.c =================================================================== RCS file: /cvsroot/ro-oslib/OSLib/!OsLib/Tools/DefMod2/defmod/sources/hdr.c,v retrieving revision 1.3.2.1 retrieving revision 1.3.2.2 diff -C2 -d -r1.3.2.1 -r1.3.2.2 *** hdr.c 14 Jan 2004 13:44:31 -0000 1.3.2.1 --- hdr.c 20 Jan 2004 17:08:48 -0000 1.3.2.2 *************** *** 388,391 **** --- 388,394 ---- goto finish; break; + + default: + break; } *************** *** 537,541 **** #ifdef EXECUTE_ON_UNIX ! if ((rc = sprintf (s, "\"GET oslib/Hdr/%s\"", name)) < 0) #else if ((rc = sprintf (s, "\"GET oslib.Hdr.%s\"", name)) < 0) --- 540,544 ---- #ifdef EXECUTE_ON_UNIX ! if ((rc = sprintf (s, "\"GET oslib/%s.Hdr\"", name)) < 0) #else if ((rc = sprintf (s, "\"GET oslib.Hdr.%s\"", name)) < 0) *************** *** 662,666 **** --- 665,673 ---- else { + #if 0 if ((rc = sprintf (v1, ":CHR: &%.2X", c->value)) < 0) + #else + if ((rc = sprintf (v1, "&%.2X", c->value)) < 0) + #endif goto finish; } Index: objasm.c =================================================================== RCS file: /cvsroot/ro-oslib/OSLib/!OsLib/Tools/DefMod2/defmod/sources/objasm.c,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** objasm.c 11 Mar 2002 15:09:26 -0000 1.1 --- objasm.c 20 Jan 2004 17:08:48 -0000 1.1.4.1 *************** *** 21,24 **** --- 21,27 ---- */ + #undef TRACE + #define TRACE 0 + /*From CLib*/ #include <ctype.h> *************** *** 31,34 **** --- 34,38 ---- #include "oslib/os.h" #include "oslib/osfile.h" + #include "oslib/macros.h" /*From Support*/ *************** *** 44,51 **** #define MEM_FOR_OBJASM (1024*1024) ! #ifdef EXECUTE_ON_UNIX ! # define ASMCMD "armasm" ! #else ! # define ASMCMD "ObjAsm" #endif --- 48,57 ---- #define MEM_FOR_OBJASM (1024*1024) ! #if !defined ASMCMD ! # ifdef EXECUTE_ON_UNIX ! # define ASMCMD armasm ! # else ! # define ASMCMD ObjAsm ! # endif #endif *************** *** 669,673 **** { if (!nonx) ! if ((rc = Emit1 (file, "BVS", "%99")) < 0) goto finish; --- 675,679 ---- { if (!nonx) ! if ((rc = Emit1 (file, "BVS", "%a99")) < 0) goto finish; *************** *** 1005,1009 **** #endif ! #ifndef EXECUTE_ON_UNIX if ((via_file = fopen ("ViaFile", "w+")) == NULL) { --- 1011,1015 ---- #endif ! //#ifndef EXECUTE_ON_UNIX if ((via_file = fopen ("ViaFile", "w+")) == NULL) { *************** *** 1012,1016 **** } done_fopen_via_file = TRUE; ! #endif context = 0; --- 1018,1022 ---- } done_fopen_via_file = TRUE; ! //#endif context = 0; *************** *** 1121,1126 **** name1, name2, apcs32 ? 32 : 26)) < 0) goto finish; #else ! if ((rc = sprintf (cmd, ASMCMD " -from %s -to %s " "-apcs 3/%dbit/SWstackcheck", name1, name2, apcs32 ? 32 : 26)) < 0) --- 1127,1138 ---- name1, name2, apcs32 ? 32 : 26)) < 0) goto finish; + + #elif ASMCMD == as + if ((rc = sprintf (cmd, STR(ASMCMD) " -objasm -o %s %s %s", + name2, apcs32 ? "-apcs32 -target SA110" : "", name1)) < 0) + goto finish; + #else ! if ((rc = sprintf (cmd, STR(ASMCMD) " -from %s -to %s " "-apcs 3/%dbit/SWstackcheck", name1, name2, apcs32 ? 32 : 26)) < 0) *************** *** 1130,1134 **** tracef ("%s ...\n" _ cmd); if (!Quiet) ! if ((rc = printf ("Assembling %s\n", name1)) < 0) goto finish; --- 1142,1146 ---- tracef ("%s ...\n" _ cmd); if (!Quiet) ! if ((rc = printf ("%s\n", cmd)) < 0) goto finish; |