summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/assembler.c3
-rw-r--r--po/ProjetArchi.pot144
-rw-r--r--samples/Makefile.am2
-rw-r--r--samples/p4.s69
4 files changed, 132 insertions, 86 deletions
diff --git a/lib/assembler.c b/lib/assembler.c
index 0acf738..ceda7d5 100644
--- a/lib/assembler.c
+++ b/lib/assembler.c
@@ -228,6 +228,9 @@ static void pushstring(char *s)
case 'b':
pushdword('\b', NULL);
break;
+ case 'e':
+ pushdword(27, NULL);
+ break;
case 'f':
pushdword('\f', NULL);
break;
diff --git a/po/ProjetArchi.pot b/po/ProjetArchi.pot
index a032bed..b2f16dc 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-23 23:07+0200\n"
+"POT-Creation-Date: 2001-04-23 23:13+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"
@@ -22,285 +22,285 @@ msgstr ""
msgid "Label already defined"
msgstr ""
-#: lib/assembler.c:268
+#: lib/assembler.c:271
msgid "You can't have the startpoint elsewhere than the .text segment"
msgstr ""
-#: lib/assembler.c:422
+#: lib/assembler.c:425
msgid "Not a valid . directive"
msgstr ""
-#: lib/assembler.c:451
+#: lib/assembler.c:454
msgid "Not a valid # directive"
msgstr ""
#. Cas des directives .
-#: lib/assembler.c:459
+#: lib/assembler.c:462
msgid "Error: extra parameters to a . directive."
msgstr ""
-#: lib/assembler.c:576
+#: lib/assembler.c:579
msgid "Too much arguments to #undef"
msgstr ""
-#: lib/assembler.c:580
+#: lib/assembler.c:583
msgid "Defined symbol not found."
msgstr ""
-#: lib/assembler.c:586
+#: lib/assembler.c:589
msgid "Too much arguments to #include"
msgstr ""
-#: lib/assembler.c:588
+#: lib/assembler.c:591
#, c-format
msgid "Including file at line %i"
msgstr ""
-#: lib/assembler.c:591
+#: lib/assembler.c:594
msgid "Error reading include file"
msgstr ""
-#: lib/assembler.c:629 lib/assembler.c:635
+#: lib/assembler.c:632 lib/assembler.c:638
msgid "Zero divide."
msgstr ""
-#: lib/assembler.c:649 lib/assembler.c:656
+#: lib/assembler.c:652 lib/assembler.c:659
msgid "Error: unable to compute the immediate value"
msgstr ""
-#: lib/assembler.c:665
+#: lib/assembler.c:668
msgid "Function unknow"
msgstr ""
-#: lib/assembler.c:673
+#: lib/assembler.c:676
msgid "Addresses addition not allowed"
msgstr ""
-#: lib/assembler.c:677
+#: lib/assembler.c:680
msgid "You can only use the decal operator on labels"
msgstr ""
-#: lib/assembler.c:683 lib/assembler.c:687 lib/assembler.c:719
+#: lib/assembler.c:686 lib/assembler.c:690 lib/assembler.c:722
msgid "Address operation invalid"
msgstr ""
-#: lib/assembler.c:690 lib/assembler.c:723
+#: lib/assembler.c:693 lib/assembler.c:726
msgid "Addresses operations not allowed"
msgstr ""
-#: lib/assembler.c:693 lib/assembler.c:816 lib/assembler.c:853
-#: lib/assembler.c:925
+#: lib/assembler.c:696 lib/assembler.c:819 lib/assembler.c:856
+#: lib/assembler.c:928
msgid "Expression too complex or invalid"
msgstr ""
-#: lib/assembler.c:727 lib/assembler.c:740 lib/assembler.c:793
-#: lib/assembler.c:805 lib/assembler.c:842
+#: lib/assembler.c:730 lib/assembler.c:743 lib/assembler.c:796
+#: lib/assembler.c:808 lib/assembler.c:845
msgid "Address type not supported"
msgstr ""
-#: lib/assembler.c:809
+#: lib/assembler.c:812
msgid "Address addition not supported"
msgstr ""
-#: lib/assembler.c:846 lib/assembler.c:898
+#: lib/assembler.c:849 lib/assembler.c:901
msgid "Expression invalid"
msgstr ""
#. Bon si l'on est ici, c'est pas bon signe non plus...
-#: lib/assembler.c:969
+#: lib/assembler.c:972
msgid "Expression too complex"
msgstr ""
-#: lib/assembler.c:1035
+#: lib/assembler.c:1038
msgid "Something wrong, nested operator called..."
msgstr ""
-#: lib/assembler.c:1106
+#: lib/assembler.c:1109
msgid "Something wrong, lparenthesis operator called..."
msgstr ""
-#: lib/assembler.c:1109
+#: lib/assembler.c:1112
msgid "Something wrong, should never got here..."
msgstr ""
-#: lib/assembler.c:1293
+#: lib/assembler.c:1296
msgid "Unknow predefined string into the meta language"
msgstr ""
-#: lib/assembler.c:1352
+#: lib/assembler.c:1355
msgid "Pattern not matching..."
msgstr ""
-#: lib/assembler.c:1360 lib/assembler.c:1393 lib/assembler.c:1647
-#: lib/assembler.c:1662 lib/assembler.c:1681
+#: lib/assembler.c:1363 lib/assembler.c:1396 lib/assembler.c:1650
+#: lib/assembler.c:1665 lib/assembler.c:1684
msgid "Unknow constant type in the meta language"
msgstr ""
-#: lib/assembler.c:1372 lib/assembler.c:1417 lib/assembler.c:1446
+#: lib/assembler.c:1375 lib/assembler.c:1420 lib/assembler.c:1449
msgid ""
"Error in the metalanguage (pattern should be here if not a constant type)"
msgstr ""
-#: lib/assembler.c:1405 lib/assembler.c:1432 lib/assembler.c:1440
-#: lib/assembler.c:1715
+#: lib/assembler.c:1408 lib/assembler.c:1435 lib/assembler.c:1443
+#: lib/assembler.c:1718
msgid "Logical error in meta language"
msgstr ""
-#: lib/assembler.c:1477
+#: lib/assembler.c:1480
msgid "Unknow field in metalanguage"
msgstr ""
-#: lib/assembler.c:1487
+#: lib/assembler.c:1490
msgid "Can't evaluate directly expression"
msgstr ""
-#: lib/assembler.c:1493
+#: lib/assembler.c:1496
msgid "Value too large for field"
msgstr ""
-#: lib/assembler.c:1545 lib/assembler.c:1746
+#: lib/assembler.c:1548 lib/assembler.c:1749
msgid "Unknow instruction"
msgstr ""
-#: lib/assembler.c:1570
+#: lib/assembler.c:1573
msgid "Unknow constant"
msgstr ""
-#: lib/assembler.c:1579
+#: lib/assembler.c:1582
msgid "Bad constant for an immediate value"
msgstr ""
-#: lib/assembler.c:1596
+#: lib/assembler.c:1599
msgid "Bad constant for a string"
msgstr ""
-#: lib/assembler.c:1613
+#: lib/assembler.c:1616
msgid "Bad array size"
msgstr ""
-#: lib/assembler.c:1623
+#: lib/assembler.c:1626
msgid "You can only have an instruction into a .text segment"
msgstr ""
-#: lib/assembler.c:1626
+#: lib/assembler.c:1629
msgid "Unmatched instruction"
msgstr ""
-#: lib/assembler.c:1771 lib/assembler.c:1813 lib/linker.c:45 lib/linker.c:67
+#: lib/assembler.c:1774 lib/assembler.c:1816 lib/linker.c:45 lib/linker.c:67
msgid "Error writing file"
msgstr ""
-#: lib/assembler.c:1822 lib/assembler.c:2217 lib/linker.c:56
+#: lib/assembler.c:1825 lib/assembler.c:2220 lib/linker.c:56
#: lib/simulator.c:40
msgid "Error reading file"
msgstr ""
-#: lib/assembler.c:1839
+#: lib/assembler.c:1842
msgid "Creating temporary files"
msgstr ""
-#: lib/assembler.c:1842
+#: lib/assembler.c:1845
msgid "Error writing file __text__"
msgstr ""
-#: lib/assembler.c:1846
+#: lib/assembler.c:1849
msgid "Error writing file __symbols__"
msgstr ""
-#: lib/assembler.c:1850
+#: lib/assembler.c:1853
msgid "Dumping memory into object file"
msgstr ""
#. Segment de texte
-#: lib/assembler.c:1855
+#: lib/assembler.c:1858
msgid "Dumping text segment"
msgstr ""
-#: lib/assembler.c:1859 lib/assembler.c:2003 lib/assembler.c:2092
+#: lib/assembler.c:1862 lib/assembler.c:2006 lib/assembler.c:2095
#, c-format
msgid "Processing word number %i coming from line %i of the file %s."
msgstr ""
-#: lib/assembler.c:1941 lib/assembler.c:1944 lib/assembler.c:2031
-#: lib/assembler.c:2034
+#: lib/assembler.c:1944 lib/assembler.c:1947 lib/assembler.c:2034
+#: lib/assembler.c:2037
msgid "Can't evaluate expression for a direct value"
msgstr ""
-#: lib/assembler.c:1948 lib/assembler.c:2038
+#: lib/assembler.c:1951 lib/assembler.c:2041
msgid "Can only use the diff() function onto labels"
msgstr ""
-#: lib/assembler.c:1953 lib/assembler.c:1958 lib/assembler.c:2043
-#: lib/assembler.c:2048
+#: lib/assembler.c:1956 lib/assembler.c:1961 lib/assembler.c:2046
+#: lib/assembler.c:2051
msgid "Can only evaluate a diff on local symbols"
msgstr ""
-#: lib/assembler.c:1962 lib/assembler.c:2052
+#: lib/assembler.c:1965 lib/assembler.c:2055
msgid "Can only evaluate a diff on symbols from the same segment"
msgstr ""
-#: lib/assembler.c:1968 lib/assembler.c:2058
+#: lib/assembler.c:1971 lib/assembler.c:2061
msgid "Can't evaluate expression"
msgstr ""
#. Segment de data
-#: lib/assembler.c:1999
+#: lib/assembler.c:2002
msgid "Dumping data segment"
msgstr ""
#. Segment bss
-#: lib/assembler.c:2088
+#: lib/assembler.c:2091
msgid "Dumping bss segment"
msgstr ""
-#: lib/assembler.c:2139
+#: lib/assembler.c:2142
#, c-format
msgid ""
"Statistics: %i words of text, %i words of data, and %i words reserved.\n"
"%i symbols generated with %i internal and %i external.\n"
msgstr ""
-#: lib/assembler.c:2168
+#: lib/assembler.c:2171
msgid "Loading file"
msgstr ""
-#: lib/assembler.c:2169 lib/meta.c:540
+#: lib/assembler.c:2172 lib/meta.c:540
#, c-format
msgid "Opening file '%s'"
msgstr ""
-#: lib/assembler.c:2178 lib/meta.c:548
+#: lib/assembler.c:2181 lib/meta.c:548
msgid "Reading file"
msgstr ""
-#: lib/assembler.c:2180 lib/meta.c:550
+#: lib/assembler.c:2183 lib/meta.c:550
#, c-format
msgid "Reading line %i"
msgstr ""
-#: lib/assembler.c:2189
+#: lib/assembler.c:2192
#, c-format
msgid "Summering line %s"
msgstr ""
-#: lib/assembler.c:2208
+#: lib/assembler.c:2211
#, c-format
msgid "Assembling file %s...\n"
msgstr ""
-#: lib/assembler.c:2209
+#: lib/assembler.c:2212
msgid "Opening output file"
msgstr ""
-#: lib/assembler.c:2212
+#: lib/assembler.c:2215
msgid "Error writing output file"
msgstr ""
-#: lib/assembler.c:2219 lib/linker.c:284
+#: lib/assembler.c:2222 lib/linker.c:284
msgid "Writing output file"
msgstr ""
-#: lib/assembler.c:2220
+#: lib/assembler.c:2223
#, c-format
msgid "Generating output file %s...\n"
msgstr ""
diff --git a/samples/Makefile.am b/samples/Makefile.am
index cc31c35..1001b2a 100644
--- a/samples/Makefile.am
+++ b/samples/Makefile.am
@@ -4,4 +4,4 @@ all:
make -f Makefile.samples
clean:
- male -f Makefile.samples clean
+ make -f Makefile.samples clean
diff --git a/samples/p4.s b/samples/p4.s
index 28b79fd..ce534e4 100644
--- a/samples/p4.s
+++ b/samples/p4.s
@@ -11,13 +11,15 @@ MsgTour1 DS "C'est au tour du joueur "
MsgTour2 DS " de jouer\n"
MsgGagne1 DS "Le joueur "
MsgGagne2 DS " a gagné\n"
+MsgEgalite DS "Égalité\n"
MsgDraw DS "| "
-MsgDrawJ1 DS "|\e[31m;O\e[0m;"
-MsgDrawJ2 DS "|\e[34m;O\e[0m;"
+MsgDrawJ1 DS "|\e[31mO\e[0m"
+MsgDrawJ2 DS "|\e[34mO\e[0m"
MsgDrawWall DS "|\n"
-MsgsDraw DD MsgDraw, MsgDrawJ1, MsgDrawJ2, MsgDraw
+MsgsDraw DD MsgDraw, MsgDrawJ1, MsgDrawJ2, MsgDrawWall
MsgDrawBegin DS "\e[2J 1 2 3 4 5 6 7\n"
MsgDrawEnd DS "+-+-+-+-+-+-+-+\n"
+MsgEndl DS "\n"
.text
@@ -52,14 +54,14 @@ BoucleInit1: MOV, [R5], R0
MOV R6, 3
BoucleInit2: MOV, [R5], R6
MOV, [R5 + 8], R6
- ADD R5, 1
+ ADD R5, 9
JNE R5, R4, BoucleInit2
; On met à 3 les 'murs' haut et bas.
MOV R4, Table + 9;
MOV R5, R1
BoucleInit3: MOV, [R5], R6
- MOV, [R5 + (8 * 9)], R6
+ MOV, [R5 + 8 * 9], R6
ADD R5, 1
JNE R5, R4, BoucleInit3
@@ -86,7 +88,7 @@ LitMot: PUSH R4
;
-; Sert à afficher la table.
+; Sert à afficher la table
;
AfficheP4: PUSH R4
@@ -97,17 +99,26 @@ AfficheP4: PUSH R4
PUSH R9
MOV, [0xffffff04], MsgDrawBegin
-
- MOV R5, Table + 9;
- ADD R4, R5, 7 * 9;
-BoucleAffiche: MOV R9, [R5]
- MOV R6, Table[R9]
- MOV, [0xffffff04], R6
+ MOV R8, 8
+ MOV R9, 9
+ ADD R4, R1, 10
+ MOV R5, 1
+BoucleAffiche2: MOV R6, 1
+BoucleAffiche1: MOV R7, [R4]
+ MOV R7, MsgsDraw[R7]
+ MOV, [0xffffff04], R7
+ ADD R4, 1
+ ADD R6, 1
+ JNE R6, R9, BoucleAffiche1
ADD R5, 1
- JNE R5, R4, BoucleAffiche
+ ADD R4, 1
+ JNE R5, R8, BoucleAffiche2
MOV, [0xffffff04], MsgDrawEnd
+ MOV, [0xffffff04], MsgTour1
+ MOV, [0xffffff06], R2
+ MOV, [0xffffff04], MsgTour2
POP R9
POP R8
@@ -117,6 +128,38 @@ BoucleAffiche: MOV R9, [R5]
POP R4
RET
+;
+; Sert pour le debuggage lors du developpement de l'application.
+;
+
+AfficheDebug: PUSH R4
+ PUSH R5
+ PUSH R6
+ PUSH R7
+ PUSH R9
+
+ MOV, [0xffffff04], MsgEndl
+
+ MOV R9, 9
+ MOV R4, R1
+ MOV R5, R0
+BoucleDebug2: MOV R6, R0
+BoucleDebug1: MOV R7, [R4]
+ MOV, [0xffffff06], R7
+ ADD R4, 1
+ ADD R6, 1
+ JNE R6, R9, BoucleDebug1
+ MOV, [0xffffff04], MsgEndl
+ ADD R5, 1
+ JNE R5, R9, BoucleDebug2
+
+ POP R9
+ POP R7
+ POP R6
+ POP R5
+ POP R4
+ RET
+
.start
CALL InitP4
CALL AfficheP4