Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added (possibly non-optimal, but working) support for the CDECL calling convention #105

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ForceBru
Copy link

@ForceBru ForceBru commented Jul 4, 2018

This code may be a bit messy (because I modified it to emit 32-bit assembly instead of 64-bit), but the main features are the following:

  • CDECL calling convention instead of passing functions' arguments in registers
  • if there are no free registers available in asm_gen.py, this uses the stack for local variables instead

Again, the code was modified to emit 32-bit assembly only, so some changes need not be merged into the master branch.

@ForceBru
Copy link
Author

ForceBru commented Jul 4, 2018

BTW, ShivyC to compile C into assembly plus pycca to assemble it plus PyVM to run the generated binary do work, so right now, with your awesome C compiler, one can run C code through pure Python!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant