mgard / epater Goto Github PK
View Code? Open in Web Editor NEWAn ARM emulator in Python for educational purposes
License: GNU General Public License v3.0
An ARM emulator in Python for educational purposes
License: GNU General Public License v3.0
Hey,
i need to code in ARM for my studies and i am trying to install Epater.
When i run the command python mainweb.py DEBUG "
i got an error in the mainweb.py line 39 saying that the file emaipass.txt deon't exist, and i don't have that file. what should i do ?
Thank you ^^
Assuming the following code:
BL function1
MOV R0, #42
function1
MOV R8, LR
MOV R1, R2
BL label2
label2
MOV LR, R8
BX LR
Then doing a step forward on the first line (which should execute function1
and stop at the next instruction, namely MOV R0, #42
) will not stop until the max number of iterations is reached. The reason is that step forward counts the number of BL, assuming they are function calls, and decrease them by the number of BX LR, assuming they are function returning. The underlying assumption is that each BL has a matched BX LR. When it is not the case, as in the code above, then the execution will not stop as expected.
Note that this is not a bug in the emulator itself (e.g. the emulation result is the correct one), but in the interface provided to the user (the emulator does not stop when expected).
Currently, the assertion system supports register comparison, but only with R* syntax. That is:
ASSERT R13=8
is valid, but
ASSERT SP=8
will crash
The tokenizer already supports both modes, but the execAssert
function in simulator.py should be changed accordingly (it currently only checks for "R" as the first character).
As of right now, a simple workaround is to use R13, R14 and R15 instead of SP, LR, and PC. Again, this is only for assertions, the alternative names may safely be used in any instruction.
The tokenizer currently parses them as a branch instruction, and thus raises a syntax error when the following letters are not a valid condition code. Since labels like MOVlabel
are deemed as valid, this should be possible to modify the parser such that it accepts labels like "Boucle", but we have to be careful not to break anything. Remember to use test_assembler
to run unit tests on the parser and assembler prior to any deployment.
In the meantime, using a lowercase first letter for labels is a simple workaround.
"Emprunt (C)" (Borrow) should be replaced by "Retenue (C)" (Carry) in /interface/simulateur.html
I discovered this project when looking to some ARM simulator with good introspection capability from Python code.
For the project I have in mind (also educational, at Toulouse University), I only require for now the simulator part (not the web front end nor the assembler).
At a first glance, I think I can quite easily do some modification in your code to make the integration with my project easy.
However, it would be far easier for me to make a Python package with only the simulator-related modules, and install it as a dependency of my project (using a setup.py
file for instance).
It seems you have something like 3 main packages that can be extracted from your current code base:
I believe such a modular infrastructure could also increase the interest in this -pretty cool- project, but I don't know if you have the time and/or desire to go in this direction?
Such work may also helps to make the different packages or the whole project accessible on PyPi for an easy installation with pip
and similar tools! :)
If you are interested, I may find some time to propose a pull request in the upcoming month or so.
Hello,
As said in the title, the assembler produce errors when trying to any data processing instruction that has a shift with the amount being specified as a register.
I can't find anything about this in the unimplemented instructions part of the readme or in the manual v2. So I assume it's a bug.
Minimal reproduction:
SECTION INTVEC
B main
SECTION CODE
main
MOV R12, R4, ROR #12
MOV R1, R0, LSR R4
SECTION DATA
The assembler complains about the second instruction "Impossible d'interpréter l'instruction" but is fine with the first one.
Thanks a lot
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.