AMN
The AMN package implements a simple virtual machine for the AM0 and AM1 instructions sets.
To use it, simply execute it with python3 -m AMN -i <instruction set> exec path/to/file.txt to execute the instructions written in a file.
If you want an interactive console just use python3 -m AMN -i <instruction set> repl.
Requirements
Python >= 3.10 is required to use the utility.
Installation
python3 -m pip install AMN
Examples
The REPL (read eval print loop) in action:
python3 -m AMN -i am0 repl
Welcome the the AM0 REPL, type 'help' for help
AM0 >> exec READ 0
Input: 8
AM0 >> exec READ 1
Input: 42
AM0 >> exec LOAD 0
AM0 >> exec LOAD 1
AM0 >> exec GT
AM0 >> exec JMC 24
AM0 >> status
Counter: 24
Stack: []
Memory:
0 := 8
1 := 42
AM0 >> exit
Exiting REPL...
Example program which outputs the biggest of two numbers:
READ 0;
READ 1;
LOAD 0;
LOAD 1;
GT;
JMC 10;
LOAD 0;
STORE 2;
JMP 12;
LOAD 1;
STORE 2;
WRITE 2;
Metadata
Release files for AMN 0.6.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| amn-0.6.1.tar.gz | 23.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| amn-0.6.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 45.3 kB
Release files / amn-0.6.1.tar.gz
| Download URL | amn-0.6.1.tar.gz |
|---|---|
| Size | 23.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ce1f46c4eb4727bbaab7da0681818b2300c1684fbf4285d1b2535db9ff18f951
|
|
BLAKE2b-256 checksum How to use checksums |
73f02d64409ca81075b55de342538054374584fe7e21a2fdce87078102973406
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / amn-0.6.1-py3-none-any.whl
| Download URL | amn-0.6.1-py3-none-any.whl |
|---|---|
| Size | 22.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
91870b316bdb1408fde19a9b5c0187e0735e417cd1f889459dd5d3a326ef0a89
|
|
BLAKE2b-256 checksum How to use checksums |
609a53197def9c7af0f223ec66eb6c2b3621e89aa7a1fee521dffdeb70924532
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|