-
Notifications
You must be signed in to change notification settings - Fork 3
/
project.json
138 lines (138 loc) · 5.73 KB
/
project.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
{
"id": "c/kspalaiologos-asm2ws",
"name": "asm2ws",
"authors": ["Kamila Szewczyk (Palaiologos)"],
"license": "GPL-3.0-or-later",
"languages": ["C", "Yacc", "Lex"],
"tags": ["interpreter", "JIT", "assembler", "disassembler", "optimizer", "programs"],
"date": "2020-12-31 22:37:25 +0100",
"spec_version": "0.3",
"source": ["https://github.com/kspalaiologos/asm2ws"],
"submodules": [{ "path": "asm2ws", "url": "https://github.com/kspalaiologos/asm2ws" }],
"whitespace": { "extension": "ws" },
"assembly": {
"mnemonics": {
"push": ["PSH", "PUSH", "PSH <number>", "PUSH <number>"],
"dup": "DUP",
"copy": ["COPY <number>", "TAKE <number>", "PULL <number>"],
"swap": ["XCHG", "SWP", "SWAP"],
"drop": ["DROP", "DSC"],
"slide": "SLIDE <number>",
"add": ["ADD", "ADD <number>"],
"sub": ["SUB", "SUB <number>"],
"mul": ["MUL", "MUL <number>"],
"div": ["DIV", "DIV <number>"],
"mod": ["MOD", "MOD <number>"],
"store": ["STO", "STO <number>", "STO <number>, <number>"],
"retrieve": ["RCL", "RCL <number>"],
"label": "@<label>",
"call": ["CALL %<label>", "GOSUB %<label>", "JSR %<label>"],
"jmp": ["J %<label>", "B %<label>", "JMP %<label>"],
"jz": ["JZ %<label>", "BZ %<label>"],
"jn": ["JLTZ %<label>", "BLTZ %<label>"],
"ret": "RET",
"end": "END",
"printc": ["PUTC", "PUTC <number>"],
"printi": ["PUTN", "PUTN <number>"],
"readc": ["GETC", "GETC <number>"],
"readi": ["GETN", "GETN <number>"]
},
"macros": [
{ "name": "REP DUP <number>" },
{ "name": "REP DROP <number>" },
{ "name": "REP ADD <number>" },
{ "name": "REP PUTN <number>" },
{ "name": "REP SUB <number>" },
{ "name": "REP MUL <number>" },
{ "name": "REP DIV <number>" },
{ "name": "REP MOD <number>" }
],
"patterns": {
"char": "'\\?.'",
"label": "[A-Za-z_][A-Za-z0-9_]*",
"number": "-?[01]+[bB]|-?[0-9][0-9A-Fa-f]*[hH]|-?[0-9]+",
"string": "\"(\\.|[^\"])*\"",
"whitespace": "[\t\r\f ]"
},
"case_sensitive_mnemonics": false,
"line_comments": [";"],
"indentation": "\t",
"usage": ["assembler", "disassembler", "programs"],
"extension": "asm",
"notes": "PSH without an arg is `push 0`. Labels of the form `L<number>` are generated by the disassembler."
},
"programs": [
{ "path": "tests/ws-run/cellsize.ws", "outputs": ["tests/ws-run/cellsize.ws.out"] },
{ "path": "tests/ws-run/count.ws", "outputs": ["tests/ws-run/count.ws.out"] },
{ "path": "tests/ws-run/duplabel.ws", "outputs": ["tests/ws-run/duplabel.ws.out"] },
{
"path": "tests/ws-run/fact.ws",
"inputs": ["tests/ws-run/fact.ws.in"],
"outputs": ["tests/ws-run/fact.ws.out"]
},
{ "path": "tests/ws-run/nerd.ws", "outputs": ["tests/ws-run/nerd.ws.out"] },
{ "path": "tests/ws-run/spec_zero.ws", "outputs": ["tests/ws-run/spec_zero.ws.out"] },
{
"path": "tests/ws-rebuild/binary.bak",
"generated": "tests/ws-rebuild/binary.ws",
"inputs": ["tests/ws-rebuild/binary.ws.asm.ws.in", "tests/ws-rebuild/binary.ws.in"],
"outputs": ["tests/ws-rebuild/binary.ws.asm.ws.out", "tests/ws-rebuild/binary.ws.out"]
},
{
"path": "tests/ws-rebuild/copy.bak",
"generated": "tests/ws-rebuild/copy.ws",
"outputs": ["tests/ws-rebuild/copy.ws.asm.ws.out", "tests/ws-rebuild/copy.ws.out"]
},
{
"path": "tests/ws-rebuild/doubler.ws",
"inputs": ["tests/ws-rebuild/doubler.ws.asm.ws.in", "tests/ws-rebuild/doubler.ws.in"],
"outputs": ["tests/ws-rebuild/doubler.ws.asm.ws.out", "tests/ws-rebuild/doubler.ws.out"]
},
{
"path": "tests/ws-rebuild/halve.bak",
"generated": "tests/ws-rebuild/halve.ws",
"inputs": ["tests/ws-rebuild/halve.ws.asm.ws.in", "tests/ws-rebuild/halve.ws.in"],
"outputs": ["tests/ws-rebuild/halve.ws.asm.ws.out", "tests/ws-rebuild/halve.ws.out"]
},
{
"path": "tests/ws-rebuild/hanoi.ws",
"inputs": ["tests/ws-rebuild/hanoi.ws.asm.ws.in", "tests/ws-rebuild/hanoi.ws.in"],
"outputs": ["tests/ws-rebuild/hanoi.ws.asm.ws.out", "tests/ws-rebuild/hanoi.ws.out"]
},
{
"path": "tests/ws-rebuild/slide.bak",
"generated": "tests/ws-rebuild/slide.ws",
"outputs": ["tests/ws-rebuild/slide.ws.asm.ws.out", "tests/ws-rebuild/slide.ws.out"]
},
{
"path": "tests/ws-build-run/divc.asm",
"inputs": ["tests/ws-build-run/divc.asm.ws.in"],
"outputs": ["tests/ws-build-run/divc.asm.ws.out"]
},
{
"path": "tests/ws-build-run/mmltz.asm",
"inputs": ["tests/ws-build-run/mmltz.asm.ws.in"],
"outputs": ["tests/ws-build-run/mmltz.asm.ws.out"]
},
{ "path": "tests/ws-build-run/rep_putn.asm", "outputs": ["tests/ws-build-run/rep_putn.asm.ws.out"] }
],
"commands": [
{
"bin": "wsi",
"usage": "[-h | --help] [-d | --disassemble] [-c | --cycles] [-a | --aot] [-j | --jit] [-m | --masm] [-Os] [-Of] <file>",
"options": [
{ "short": "h", "long": "help", "desc": "display this screen." },
{ "short": "d", "long": "disassemble", "desc": "disassemble the whitespace program." },
{ "short": "c", "long": "cycles", "desc": "count operations made by the program." },
{ "short": "a", "long": "aot", "desc": "build a C source file." },
{ "short": "j", "long": "jit", "desc": "enable the JIT compiler." },
{ "short": "m", "long": "masm", "desc": "run the macro assembler." },
{ "short": "Os", "desc": "optimize for size." },
{ "short": "Of", "desc": "optimize to produce fast code." }
],
"option_parse": "manual",
"notes": "default operation: run whitespace code."
}
],
"notes": "Has various number formats and REP instruction"
}