diff options
-rw-r--r-- | lib/assembler.c | 49 | ||||
-rw-r--r-- | po/ProjetArchi.pot | 148 | ||||
-rw-r--r-- | po/cat-id-tbl.c | 42 |
3 files changed, 139 insertions, 100 deletions
diff --git a/lib/assembler.c b/lib/assembler.c index bc9d5d2..646d48f 100644 --- a/lib/assembler.c +++ b/lib/assembler.c @@ -2,6 +2,7 @@ #include <stdlib.h> #include <string.h> #include <errno.h> +#include <unistd.h> #include "config.h" #include "meta.h" @@ -1789,6 +1790,27 @@ static void writestring(char * string, FILE * f) { */ +void appendfile(FILE * f, char * name) { + unsigned long int a; + FILE * g; + + if (!(g = fopen(name, "rb"))) { + pushcontext(strerror(errno)); + exception(1, _("Error writing file")); + } + + while (fread(&a, sizeof(a), 1, g) == 1) { + writeword(a, f, 1); + } + + if (ferror(f)) { + pushcontext(strerror(errno)); + exception(1, _("Error reading file")); + } + + fclose(g); +} + void asm_eof(FILE * f) { bytestream_t * t, * u; @@ -1906,7 +1928,7 @@ void asm_eof(FILE * f) a = tdata->Expr->avalue; nbsymbols++; writeword(0, f2, 1); - writeword(tdata->offset, f2, 1); + writeword(tdata->offset + s_text, f2, 1); writeword(strlen(tdata->Expr->symbol), f2, 1); writestring(tdata->Expr->symbol, f2); break; @@ -1951,7 +1973,7 @@ void asm_eof(FILE * f) if (tdata->Label) { nbsymbols++; writeword(0, f2, 1); - writeword(tdata->offset, f2, 1); + writeword(tdata->offset + s_text, f2, 1); writeword(strlen(tdata->Expr->symbol), f2, 1); writestring(tdata->Expr->symbol, f2); } @@ -1972,7 +1994,7 @@ void asm_eof(FILE * f) if (tbss->Label) { nbsymbols++; writeword(0, f2, 1); - writeword(tbss->offset, f2, 1); + writeword(tbss->offset + s_text + s_data, f2, 1); writeword(strlen(tbss->Expr->symbol), f2, 1); writestring(tbss->Expr->symbol, f2); } @@ -1980,12 +2002,29 @@ void asm_eof(FILE * f) popcontext(); } popcontext(); - - popcontext(); fclose(f1); + + fprintf(stderr, "------\n"); + + writeword(0x4f424e4e, f, 1); + fprintf(stderr, "Pointeur de f2: %i taille de data: %i taille de text: %i\n", ftell(f2), s_data, s_text); + writeword(ftell(f2) + s_data + s_text + 7, f, 1); fclose(f2); + t = (bytestream_t *) NomVarToVar("__start__", labels, &trouve); + if (trouve) { + writeword(t->offset, f, 1); + } else { + writeword(-1, f, 1); + } + + appendfile(f, "__symbols__"); + appendfile(f, "__text__"); + fclose(f); + + unlink("__symbols__"); + unlink("__text__"); } static void delete_bytestream(bytestream_t * s) diff --git a/po/ProjetArchi.pot b/po/ProjetArchi.pot index a4a4cba..c6877dd 100644 --- a/po/ProjetArchi.pot +++ b/po/ProjetArchi.pot @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2001-04-16 03:17+0200\n" +"POT-Creation-Date: 2001-04-16 03:39+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -14,273 +14,273 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: ENCODING\n" -#: lib/assembler.c:171 +#: lib/assembler.c:172 msgid "You have to be into the .text or the .data segment to define a value." msgstr "" -#: lib/assembler.c:197 +#: lib/assembler.c:198 msgid "Label already defined" msgstr "" -#: lib/assembler.c:260 +#: lib/assembler.c:261 msgid "You can't have the startpoint elsewhere than the .text segment" msgstr "" -#: lib/assembler.c:404 +#: lib/assembler.c:405 msgid "Not a valid . directive" msgstr "" -#: lib/assembler.c:433 +#: lib/assembler.c:434 msgid "Not a valid # directive" msgstr "" #. Cas des directives . -#: lib/assembler.c:441 +#: lib/assembler.c:442 msgid "Error: extra parameters to a . directive." msgstr "" -#: lib/assembler.c:557 +#: lib/assembler.c:558 msgid "Too much arguments to #undef" msgstr "" -#: lib/assembler.c:561 +#: lib/assembler.c:562 msgid "Defined symbol not found." msgstr "" -#: lib/assembler.c:567 +#: lib/assembler.c:568 msgid "Too much arguments to #include" msgstr "" -#: lib/assembler.c:569 +#: lib/assembler.c:570 #, c-format msgid "Including file at line %i" msgstr "" -#: lib/assembler.c:572 +#: lib/assembler.c:573 msgid "Error reading include file" msgstr "" -#: lib/assembler.c:624 lib/assembler.c:630 +#: lib/assembler.c:625 lib/assembler.c:631 msgid "Zero divide." msgstr "" -#: lib/assembler.c:643 lib/assembler.c:650 +#: lib/assembler.c:644 lib/assembler.c:651 msgid "Error: unable to compute the immediate value" msgstr "" -#: lib/assembler.c:659 +#: lib/assembler.c:660 msgid "Function unknow" msgstr "" -#: lib/assembler.c:666 +#: lib/assembler.c:667 msgid "Addresses addition not allowed" msgstr "" -#: lib/assembler.c:670 +#: lib/assembler.c:671 msgid "You can only use the decal operator on labels" msgstr "" -#: lib/assembler.c:675 lib/assembler.c:678 lib/assembler.c:709 +#: lib/assembler.c:676 lib/assembler.c:679 lib/assembler.c:710 msgid "Address operation invalid" msgstr "" -#: lib/assembler.c:681 lib/assembler.c:713 +#: lib/assembler.c:682 lib/assembler.c:714 msgid "Addresses operations not allowed" msgstr "" -#: lib/assembler.c:684 lib/assembler.c:806 lib/assembler.c:843 -#: lib/assembler.c:917 +#: lib/assembler.c:685 lib/assembler.c:807 lib/assembler.c:844 +#: lib/assembler.c:918 msgid "Expression too complex or invalid" msgstr "" -#: lib/assembler.c:717 lib/assembler.c:730 lib/assembler.c:783 -#: lib/assembler.c:795 lib/assembler.c:832 +#: lib/assembler.c:718 lib/assembler.c:731 lib/assembler.c:784 +#: lib/assembler.c:796 lib/assembler.c:833 msgid "Address type not supported" msgstr "" -#: lib/assembler.c:799 +#: lib/assembler.c:800 msgid "Address addition not supported" msgstr "" -#: lib/assembler.c:836 lib/assembler.c:888 +#: lib/assembler.c:837 lib/assembler.c:889 msgid "Expression invalid" msgstr "" #. Bon si l'on est ici, c'est pas bon signe non plus... -#: lib/assembler.c:961 +#: lib/assembler.c:962 msgid "Expression too complex" msgstr "" -#: lib/assembler.c:1025 +#: lib/assembler.c:1026 msgid "Something wrong, nested operator called..." msgstr "" -#: lib/assembler.c:1096 +#: lib/assembler.c:1097 msgid "Something wrong, lparenthesis operator called..." msgstr "" -#: lib/assembler.c:1099 +#: lib/assembler.c:1100 msgid "Something wrong, should never got here..." msgstr "" -#: lib/assembler.c:1276 +#: lib/assembler.c:1277 msgid "Unknow predefined string into the meta language" msgstr "" -#: lib/assembler.c:1333 +#: lib/assembler.c:1334 msgid "Pattern not matching..." msgstr "" -#: lib/assembler.c:1344 lib/assembler.c:1376 lib/assembler.c:1633 -#: lib/assembler.c:1650 lib/assembler.c:1666 +#: lib/assembler.c:1345 lib/assembler.c:1377 lib/assembler.c:1634 +#: lib/assembler.c:1651 lib/assembler.c:1667 msgid "Unknow constant type in the meta language" msgstr "" -#: lib/assembler.c:1358 lib/assembler.c:1401 lib/assembler.c:1428 +#: lib/assembler.c:1359 lib/assembler.c:1402 lib/assembler.c:1429 msgid "" "Error in the metalanguage (pattern should be here if not a constant type)" msgstr "" -#: lib/assembler.c:1389 lib/assembler.c:1414 lib/assembler.c:1422 -#: lib/assembler.c:1697 +#: lib/assembler.c:1390 lib/assembler.c:1415 lib/assembler.c:1423 +#: lib/assembler.c:1698 msgid "Logical error in meta language" msgstr "" -#: lib/assembler.c:1456 +#: lib/assembler.c:1457 msgid "Unknow field in metalanguage" msgstr "" -#: lib/assembler.c:1468 +#: lib/assembler.c:1469 msgid "Can't evaluate directly expression" msgstr "" -#: lib/assembler.c:1475 +#: lib/assembler.c:1476 msgid "Value too large for field" msgstr "" -#: lib/assembler.c:1528 lib/assembler.c:1724 +#: lib/assembler.c:1529 lib/assembler.c:1725 msgid "Unknow instruction" msgstr "" -#: lib/assembler.c:1554 +#: lib/assembler.c:1555 msgid "Unknow constant" msgstr "" -#: lib/assembler.c:1564 +#: lib/assembler.c:1565 msgid "Bad constant for an immediate value" msgstr "" -#: lib/assembler.c:1581 +#: lib/assembler.c:1582 msgid "Bad constant for a string" msgstr "" -#: lib/assembler.c:1598 +#: lib/assembler.c:1599 msgid "Bad array size" msgstr "" -#: lib/assembler.c:1608 +#: lib/assembler.c:1609 msgid "You can only have an instruction into a .text segment" msgstr "" -#: lib/assembler.c:1611 +#: lib/assembler.c:1612 msgid "Unmatched instruction" msgstr "" -#: lib/assembler.c:1761 +#: lib/assembler.c:1762 lib/assembler.c:1799 msgid "Error writing file" msgstr "" -#: lib/assembler.c:1802 +#: lib/assembler.c:1808 lib/assembler.c:2098 +msgid "Error reading file" +msgstr "" + +#: lib/assembler.c:1824 msgid "Creating temporary files" msgstr "" -#: lib/assembler.c:1805 +#: lib/assembler.c:1827 msgid "Error writing file __text__" msgstr "" -#: lib/assembler.c:1809 +#: lib/assembler.c:1831 msgid "Error writing file __symbols__" msgstr "" -#: lib/assembler.c:1813 +#: lib/assembler.c:1835 msgid "Dumping memory into object file" msgstr "" -#: lib/assembler.c:1815 +#: lib/assembler.c:1837 msgid "Dumping text segment" msgstr "" -#: lib/assembler.c:1817 lib/assembler.c:1891 lib/assembler.c:1967 +#: lib/assembler.c:1839 lib/assembler.c:1913 lib/assembler.c:1989 #, c-format msgid "Processing word number %i coming from line %i of the file %s." msgstr "" -#: lib/assembler.c:1842 lib/assembler.c:1845 lib/assembler.c:1916 -#: lib/assembler.c:1919 +#: lib/assembler.c:1864 lib/assembler.c:1867 lib/assembler.c:1938 +#: lib/assembler.c:1941 msgid "Can't evaluate expression for a direct value" msgstr "" -#: lib/assembler.c:1848 lib/assembler.c:1922 +#: lib/assembler.c:1870 lib/assembler.c:1944 msgid "Can only use the diff() function onto labels" msgstr "" -#: lib/assembler.c:1853 lib/assembler.c:1857 lib/assembler.c:1927 -#: lib/assembler.c:1931 +#: lib/assembler.c:1875 lib/assembler.c:1879 lib/assembler.c:1949 +#: lib/assembler.c:1953 msgid "Can only evaluate a diff on local symbols" msgstr "" -#: lib/assembler.c:1861 lib/assembler.c:1935 +#: lib/assembler.c:1883 lib/assembler.c:1957 msgid "Can only evaluate a diff on symbols from the same segment" msgstr "" -#: lib/assembler.c:1867 lib/assembler.c:1941 +#: lib/assembler.c:1889 lib/assembler.c:1963 msgid "Can't evaluate expression" msgstr "" -#: lib/assembler.c:1889 +#: lib/assembler.c:1911 msgid "Dumping data segment" msgstr "" -#: lib/assembler.c:1965 +#: lib/assembler.c:1987 msgid "Dumping bss segment" msgstr "" -#: lib/assembler.c:2015 +#: lib/assembler.c:2054 msgid "Loading file" msgstr "" -#: lib/assembler.c:2016 lib/meta.c:516 +#: lib/assembler.c:2055 lib/meta.c:516 #, c-format msgid "Opening file '%s'" msgstr "" -#: lib/assembler.c:2024 lib/meta.c:524 +#: lib/assembler.c:2063 lib/meta.c:524 msgid "Reading file" msgstr "" -#: lib/assembler.c:2026 lib/meta.c:526 +#: lib/assembler.c:2065 lib/meta.c:526 #, c-format msgid "Reading line %i" msgstr "" -#: lib/assembler.c:2035 +#: lib/assembler.c:2074 #, c-format msgid "Summering line %s" msgstr "" -#: lib/assembler.c:2052 +#: lib/assembler.c:2091 msgid "Opening output file" msgstr "" -#: lib/assembler.c:2055 +#: lib/assembler.c:2094 msgid "Error writing output file" msgstr "" -#: lib/assembler.c:2059 -msgid "Error reading file" -msgstr "" - -#: lib/assembler.c:2061 +#: lib/assembler.c:2100 msgid "Writing output file" msgstr "" diff --git a/po/cat-id-tbl.c b/po/cat-id-tbl.c index 2c1c253..1466fe7 100644 --- a/po/cat-id-tbl.c +++ b/po/cat-id-tbl.c @@ -51,27 +51,27 @@ Error in the metalanguage (pattern should be here if not a constant type)", 31}, {"You can only have an instruction into a .text segment", 41}, {"Unmatched instruction", 42}, {"Error writing file", 43}, - {"Creating temporary files", 44}, - {"Error writing file __text__", 45}, - {"Error writing file __symbols__", 46}, - {"Dumping memory into object file", 47}, - {"Dumping text segment", 48}, - {"Processing word number %i coming from line %i of the file %s.", 49}, - {"Can't evaluate expression for a direct value", 50}, - {"Can only use the diff() function onto labels", 51}, - {"Can only evaluate a diff on local symbols", 52}, - {"Can only evaluate a diff on symbols from the same segment", 53}, - {"Can't evaluate expression", 54}, - {"Dumping data segment", 55}, - {"Dumping bss segment", 56}, - {"Loading file", 57}, - {"Opening file '%s'", 58}, - {"Reading file", 59}, - {"Reading line %i", 60}, - {"Summering line %s", 61}, - {"Opening output file", 62}, - {"Error writing output file", 63}, - {"Error reading file", 64}, + {"Error reading file", 44}, + {"Creating temporary files", 45}, + {"Error writing file __text__", 46}, + {"Error writing file __symbols__", 47}, + {"Dumping memory into object file", 48}, + {"Dumping text segment", 49}, + {"Processing word number %i coming from line %i of the file %s.", 50}, + {"Can't evaluate expression for a direct value", 51}, + {"Can only use the diff() function onto labels", 52}, + {"Can only evaluate a diff on local symbols", 53}, + {"Can only evaluate a diff on symbols from the same segment", 54}, + {"Can't evaluate expression", 55}, + {"Dumping data segment", 56}, + {"Dumping bss segment", 57}, + {"Loading file", 58}, + {"Opening file '%s'", 59}, + {"Reading file", 60}, + {"Reading line %i", 61}, + {"Summering line %s", 62}, + {"Opening output file", 63}, + {"Error writing output file", 64}, {"Writing output file", 65}, {"Internal error into hashing", 66}, {"Read line '%s'", 67}, |