ci | sm | zx | nx | zy | ny | f | no | a | d | *a | lt | eq | gt | ||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 |
0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 |
1 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 |
1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 |
# Assembler code
loop:
A = 0x7FFF
*A = *A+1
*A = *A+1
A = loop
JMP
_~ not ready yet ~_
pass
_~ not ready yet ~_
begin:
A = 0x7FFF
D = *A
A = 255
D = D - A
A = begin
D - 1; JGT
A = 0x7FFF
D = *A
A = 255
D = D - A
A = tl
D - 1; JEQ
fw:
A = 4
D = A
A = 0x7FFF
*A = D + *A
A = begin
JMP
tl:
A = 8
D = A
A = 0x7FFF
*A = D + *A
A = begin
JMP
A = 0x4000
D = A
*A = D
A = A + 1
*A = D
A = 0x4200
*A = D
pass
Name | Number |
---|---|
SP | 0 |
A = 0x0100
D = A
A = SP
*A = D
A = SP
A = *A
*A = D
A = SP
*A = *A+1
A = SP
*A = *A-1
A = *A
D = *A
A = SP
*A = *A-1
A = *A
A = *A
A = value
D = A
PUSH_D
POP_D
POP_A
D = D + A
PUSH_D
POP_D
POP_A
D = A - D
PUSH_D
POP_A
D = -A
PUSH_D
pass
pass
Type | Match | Grammar | Name |
---|---|---|---|
Pattern | [ ]+ | Ignore | |
Pattern | [0-9]+ | Name | Number |
Exact | + | Literal | |
Exact | - | Literal | |
Exact | ( | Literal | |
Exact | ) | Literal |
Symbol | Expression |
---|---|
PROGRAM | Expression |
Expression | Expression + Number |
Expression | Number |
Expression | Expression - Number |
Expression | ( Expression ) |
Expression | Number - Expression |
Expression | Number + Expression |
Expression | - Expression |
PROGRAM
Expression
Expression
Expression + Number
[Expression]
PUSH_VALUE [Number]
ADD
Expression
Number
PUSH_VALUE [Number]
Expression
Expression - Number
[Expression]
PUSH_VALUE [Number]
SUB
Expression
( Expression )
[Expression]
Expression
Number - Expression
PUSH_VALUE [Number]
[Expression]
SUB
Expression
Number + Expression
PUSH_VALUE [Number]
[Expression]
ADD
Expression
- Expression
[Expression]
NEG
_~ not ready yet ~_
_~ not ready yet ~_
_~ not ready yet ~_
_~ not ready yet ~_
_~ not ready yet ~_
_~ not ready yet ~_
_~ not ready yet ~_
_~ not ready yet ~_
_~ not ready yet ~_
_~ not ready yet ~_
_~ not ready yet ~_
_~ not ready yet ~_
_~ not ready yet ~_
_~ not ready yet ~_
_~ not ready yet ~_
_~ not ready yet ~_
_~ not ready yet ~_
_~ not ready yet ~_