From 246f8c5d0a6361d2de2cffdd7ffd164a5fd1c3a9 Mon Sep 17 00:00:00 2001 From: Giulio De Pasquale Date: Sat, 5 Aug 2017 19:42:37 +0200 Subject: [PATCH] Plugin registrato + calling conv --- .gitignore | 105 ++++++++++++++++++++++++++++++++++++++++++++++++++++ __init__.py | 14 ++++++- 2 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..30cf063 --- /dev/null +++ b/.gitignore @@ -0,0 +1,105 @@ +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +.hypothesis/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# pyenv +.python-version + +# celery beat schedule file +celerybeat-schedule + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ \ No newline at end of file diff --git a/__init__.py b/__init__.py index 9aa6904..e6be065 100644 --- a/__init__.py +++ b/__init__.py @@ -37,4 +37,16 @@ class Pasticciotto(Architecture): tokens = "" length = 0 - return tokens, length \ No newline at end of file + return tokens, length + +class DefaultCallingConvention(CallingConvention): + name = 'default' + int_arg_regs = ['r0', 'r1', 'r2', 'r3'] + int_return_reg = 'r0' + high_int_return_reg = 'r1' + +Pasticciotto.register() +arch = Architecture['pasticciotto'] +arch.register_calling_convention(DefaultCallingConvention(arch)) +standalone = arch.standalone_platform +standalone.default_calling_convention = arch.calling_conventions['default'] \ No newline at end of file