Skip to content

Adoria298/py2aqa32

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

py2aqa32

Python Compiler to AQA Assembly as implemented by Peter Higginson at https://www.peterhigginson.co.uk/AQA/.

main branch should compile accurately but not optimally the code in test_code.py.

The official instruction set is found here. This compiler aims to run on the Peter Higginson simulator as documented here. Note that he has expanded upon it to make a working simulation - if they ever differ the Higginson version is preferred.

Supported Syntax

test_code.py contains an example of every supported Python construction, but not every permutation.

Unsupported syntax is ignored and no error is raised.

  • Integer variables only (PH treats them as signed).
  • Assignment (of the forms a = b and a += b).
  • Integer Addition and Subtraction - but the result must be assigned to a variable.
  • Comparisions - but the result must be used in a condition.
  • While loops - those of the form "while False" are optimised out.
  • if/elif/else - as above.
  • Comments - this is a consequence of using the ast Python parser in the stdlib.

TODO.md contains plans and discussions for remaining syntax and constructions.