https://github.com/paiv/synasm
Synacor VM Assembler
https://github.com/paiv/synasm
Last synced: about 2 months ago
JSON representation
Synacor VM Assembler
- Host: GitHub
- URL: https://github.com/paiv/synasm
- Owner: paiv
- License: mit
- Created: 2017-12-09T19:13:06.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-10-18T20:31:08.000Z (6 months ago)
- Last Synced: 2025-01-18T03:26:56.457Z (3 months ago)
- Language: Python
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
paiv – Assembler for Synacor VM (https://challenge.synacor.com/)
[](https://travis-ci.org/paiv/synasm)
Installing
----------```sh
pip install git+https://github.com/paiv/synasm.git
```Using
-----```
usage: synasm [-h] [-o [OUTFILE]] [-b] [-v] [infile [infile ...]]Synacor VM Assembler
positional arguments:
infile assembly fileoptional arguments:
-h, --help show this help message and exit
-o [OUTFILE], --outfile [OUTFILE]
assembly file
-b, --base64 encode output in Base64
-v, --verbose print details
```Assembly syntax
---------------Registers: `a b c d e f g h` (32768..32775)
Basic example:
```asm
out 'Hello, World!\n'
```Another example:
```asm
jmp :loop
loop:
eq c a b
jf c :loop
set a 10
call :some
out 10
ret
some:
jf a :somend
somext:
out '.'
add a a -1
jt a :somext
somend:
ret
```