Skip to content

Commit

Permalink
Merge pull request #32 from kommisar5150/master
Browse files Browse the repository at this point in the history
Updated documentation based on new assembler
  • Loading branch information
pg-cse committed Jun 26, 2018
2 parents 2e989c6 + e3c434c commit a258b98
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 56 deletions.
38 changes: 12 additions & 26 deletions Documentation/SpartacusReference-EN.md
Expand Up @@ -411,8 +411,7 @@ software development. Therefore, they do
present some bugs and, as a developer, you have to
be careful to use these tools exactly as this text
explains their use. Know that these bugs are being
addressed. We are planning on a re-write
of these.
addressed. We are planning to re-write some of these.

## Compiler
We do not currently have a compiler. This is one of the major area where
Expand All @@ -421,22 +420,11 @@ open source contribution would be more than welcome!
## Assembler.py
##### Overview
Capua has its own assembler. It’s easy to use. The implementation is fairly
straightforward. Please remember
that the current version of the assembler has been
written as a testing tool for Capua. Be extra careful to
straightforward. Be extra careful to
fully respect the syntax described here since error
messages might not always be easy to understand.
Also, in it’s current state, the assembler is very
“typo” sensitive. Every part of an instruction needs
to be separated by a white space. This includes the end
of line comment:
>**MOV $A $B;This is not good enough**
>**MOV $A $B ;This is fine**
Obviously many of these problems are easy
fixes. Feel free to jump in and contribute some
code.
Every part of an instruction needs
to be separated by a white space.

When running the assembler, the input file is
transformed into a .o file. Please note that, the
Expand Down Expand Up @@ -470,7 +458,7 @@ directives. These directives are to be used when writing code.
value in the mov instruction displayed. Colons
are not permitted to be a part of the label name
itself. Thus the only colon should be the last
character on the line. Symbols
character on the line when labels are declared initially. Symbols
may also be used in loops:
**JMP <> loopStart**
* ".global symbolName"
Expand All @@ -481,26 +469,24 @@ directives. These directives are to be used when writing code.
* The “;” character, like in many other
assembly languages, indicates a comment.
These can either be on a line of their own or
at the end of a line, after an instruction.
Please note that, in case a comment is put
after an instruction, a space must separate
the end of the instruction from the
beginning of the comment (the “;”
character)
at the end of a line, after an instruction. Note that
anything following a semi-colon ";" character will be ignored
by the assembler.

* ".dataAlpha"
* This can be used anywhere as long as it sits
on a line of it’s own. This directive is
followed by a white space and by free
formed text. The text does not need to be
quoted. In fact, it MUST NOT be quoted.
quoted. If you do, the quotes will simply be included in your text.
The string ends at the end of the line. The
assembler will add a 0x00 termination
character at the end of the string at
assembling time. Usage example
testString:
**.dataAlpha This is a test string**
*Please note that no comment can follow this
line.*
*Please note that comments can't be added after a .dataAlpha
declaration. If you do, comments will simply be included in the string.*
* ".dataMemRef"
* This is similar to .dataNumeric except that it
allows the programmer to specify a memory reference.
Expand Down
32 changes: 10 additions & 22 deletions Documentation/SpartacusReference-FR.md
Expand Up @@ -426,7 +426,7 @@ présentent des "bugs" et, en tant que développeur,
vous devez vous assurer de les utiliser exactement
de la manière décrite. Plusieurs de ces problèmes
ont été corrigés depuis la version 1.0. Une réécriture
de ces outils est planifiée.
de certains outils est planifiée.

## Compilateur
Nous n'avons présentemant aucun compilateur. C'est un des éléments majeurs
Expand All @@ -437,20 +437,9 @@ bienvenue.
##### Survol
Capua possède son propre assembleur. Il est facile à utiliser et son implémentation est assez
simple.
N'oubliez pas que la version actuelle de l'assembleur a été
écrite comme outil de test pour Capua.
Veuillez respecter la syntaxe décrite ici puisque
les messages d'erreur ne sont pas toujours faciles à comprendre.
L'assembleur est très sensible aux erreurs typographique.
Par exemple, chaque partie d'une instruction doit
être séparée par un espace blanc. Cela inclut les commentaires en fin de ligne:

>**MOV $A $B;This is not good enough**
>**MOV $A $B ;This is fine**
De toute évidence, un bon nombre de ces problèmes sont faciles
à corriger. N'hésitez pas à vous impliquer et à contribuer.
Toute partie d'un instruction doit être séparée par des espaces.

Lors de l'assemblage, le fichier d'entrée est
transformé en un fichier .o. Veuillez noter que
Expand Down Expand Up @@ -491,25 +480,24 @@ sur les directives de l'assembleur. Ces directives doivent
* Le caractère ";", comme dans beaucoup
d’autres langages assembleur, indique un
commentaire. Les commentaires peuvent être soit sur
leur propre ligne, soit à la fin d’une ligne, à la
suite d’une instruction. Veuillez noter que,
dans le cas où un commentaire est mis après
une instruction, un espace doit séparer la fin
de l’instruction du début du commentaire (le
caractère ";").
leur propre ligne, soit à la fin d’une ligne, ou à la
suite d’une instruction. Veuillez noter que tout texte suivi
du caractère ";" sera ignoré par l'assembleur.

* ".dataAlpha"
* On peut l’utiliser n’importe où tant qu’elle se
trouve sur sa propre ligne. Cette directive est
suivie par un espace blanc et un texte au
format libre. Le texte n’a pas besoin d’être
mis entre guillemets. En fait, il ne doit pas
être mis entre guillemets. La chaîne de caractères se
mis entre guillemets. Si on ajoute des guillmets,
ils seront tout simplement ajoutés au texte. La chaîne de caractères se
termine à la fin de la ligne. L’assembleur
ajoute un caractère de fin (0x00) à la fin de la
chaîne au moment de l’assemblage. Exemple
d’utilisation:
**.dataAlpha This is a test string**
*Notez qu'aucun commentaire ne peut suivre cette ligne.*
*Notez qu'un commentaire peut suivre cette ligne, mais ce dernier sera ajouté au texte
comme du texte régulier.*
* ".dataMemRef"
* Ceci est semblable à .dataNumeric, sauf
qu'un programmeur peut spécifier une référence en mémoire.
Expand Down
8 changes: 3 additions & 5 deletions README.md
Expand Up @@ -40,7 +40,6 @@ still require a lot of work:
* C (or other language) compiler (no compiler at current time)
* Debugger improvement (step into, step over, ...)
* ".o" file format improvement (current format is prone to bugs)
* Assembler rewrite


Please note that any contribution has to follow GPLv2 licence. Also, any contribution
Expand All @@ -61,7 +60,7 @@ Any code contribution not respecting these requirements will be rejected.
* NOTE ABOUT THE TOOL CHAIN:
This tool chain was originally built for testing purpose not for programmer.
Therefore, bugs are present and code is NOT fully tested. We are improving this
but there is still a lot of work to be done. The assembler and the linker are
but there is still a lot of work to be done. The linker is
more than likely going to be re-written.
* All tool chain related code is here. For example, the code allowing to parse and link files
is in there. The debugger code is there too.
Expand Down Expand Up @@ -110,7 +109,6 @@ Voici une liste d'éléments qui demandent encore beaucoup de travail:
* Compilateur C (ou autre langage) (aucun support actuellement)
* Ajout au débugueur (step into, step over, ...)
* Amélioration du format".o" (current format is prone to bugs)
* Réécriture de l'assembleur


Please note that any contribution has to follow GPLv2 licence. Also, any contribution
Expand All @@ -133,8 +131,8 @@ Any code contribution not respecting these requirements will be rejected.
et non pas pour être utilisés par le programmeur. Ainsi, des problèmes sont
présents dans le code et ce dernier n'a pas été entièrement testé. Nous
travaillons à l'amélioration des outils mais plusieurs autres éléments demandent
aussi de l'attention. L'assembleur et l'éditeur de liens seront probablement
ré-écrits.
aussi de l'attention. L'éditeur de liens sera probablement
ré-écrit.
* L'ensemble du code relié aux outils de développement est ici. Par exemple, le code permettant
l'édition des liens et l'analyseur de code est dans ce répertoire. Le code du débogueur y est
aussi présent.
Expand Down
2 changes: 1 addition & 1 deletion ToolChain/Assembler/Assembler.py
Expand Up @@ -23,7 +23,7 @@
__copyright__ = "Copyright 2018, CSE"
__credits__ = ["CSE"]
__license__ = "GPL"
__version__ = "2.1"
__version__ = "3.0"
__maintainer__ = "CSE"
__status__ = "Dev"

Expand Down
2 changes: 1 addition & 1 deletion ToolChain/Assembler/Parser/Parser.py
Expand Up @@ -23,7 +23,7 @@
__copyright__ = "Copyright 2018, CSE"
__credits__ = ["CSE"]
__license__ = "GPL"
__version__ = "2.1"
__version__ = "3.0"
__maintainer__ = "CSE"
__status__ = "Dev"

Expand Down
10 changes: 9 additions & 1 deletion ToolChain/Assembler/Parser/test_Parser.py
Expand Up @@ -3,7 +3,7 @@

"""
This file is part of Spartacus project
Copyright (C) 2016 CSE
Copyright (C) 2018 CSE
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -20,6 +20,14 @@
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
"""

__author__ = "CSE"
__copyright__ = "Copyright 2018, CSE"
__credits__ = ["CSE"]
__license__ = "GPL"
__version__ = "3.0"
__maintainer__ = "CSE"
__status__ = "Dev"


from ToolChain.Assembler.Parser.Parser import Parser
from ToolChain.Assembler.Assembler import Assembler
Expand Down

0 comments on commit a258b98

Please sign in to comment.