41 lines
881 B
Markdown
41 lines
881 B
Markdown
### Dependencies
|
|
|
|
- Node.js
|
|
|
|
|
|
### Quick examples
|
|
|
|
Assemble and run:
|
|
```./assembler.js -i <source.asm> | ./cardiograph.js```
|
|
|
|
Assemble to a file:
|
|
```./assembler.js -i <source.asm> -o <machinecode.out>```
|
|
|
|
Run from a file:
|
|
```./cardiograph.js -i <machinecode.out>```
|
|
|
|
|
|
### Assembler: assembler.js
|
|
|
|
```
|
|
Usage: ./assembler.js [-a] -i <input-file> [-o <output-file>]
|
|
|
|
-a, --annotate Output code with debugging annotations
|
|
-i, --in <file> Assembly-language input
|
|
-o, --out <file> Machine-code output
|
|
```
|
|
|
|
- If an output file is not provided, the output is printed to stdout
|
|
|
|
- If the `annotate` flag is not set, the machine code is returned as a string of space-separated decimal numbers
|
|
|
|
|
|
### Simulator: cardiograph.js
|
|
|
|
```
|
|
Usage: ./cardiograph.js [-i <file>]
|
|
|
|
-i, --in <file> Machine-code input
|
|
```
|
|
|
|
- If an input file is not provided, the input is read from stdin |