pushdowm automaton assembly working
This commit is contained in:
parent
a771db2ef8
commit
0e8d507e36
@ -1,4 +1,4 @@
|
|||||||
(37, 6, 0, 0, 1, 1, 1, 1, 0, 0, 3, 2, 1, 3, 0, 0, 0, 1, 2, 1, 1, 0, 0, 1, 1, 0, 2, 2, 1, 1, 0, 2, 2, 2, 3, 1, 3, 1)
|
(37, 6, 0, 0, 0, 1, 1, 1, 0, 0, 3, 2, 1, 3, 0, 0, 0, 1, 2, 1, 1, 0, 0, 1, 1, 0, 2, 2, 1, 1, 0, 2, 2, 2, 3, 1, 3, 1)
|
||||||
ADD(0, 0, r0) // r0 current state in pushdown automaton
|
ADD(0, 0, r0) // r0 current state in pushdown automaton
|
||||||
ADD(2, 0, r1) // r1 cursor position in input word, (i2 first symbol of input word, i1 length of input word)
|
ADD(2, 0, r1) // r1 cursor position in input word, (i2 first symbol of input word, i1 length of input word)
|
||||||
ADD(12, 0, r11) // r11 address of stack top
|
ADD(12, 0, r11) // r11 address of stack top
|
||||||
@ -64,6 +64,7 @@ SUB(r9, 1, r9)
|
|||||||
JUMP(-4)
|
JUMP(-4)
|
||||||
|
|
||||||
|
|
||||||
|
JL(r10, r1, 2) // check if input word hasn't been read entirely
|
||||||
JE(r0, 1, 3) // check if final state
|
JE(r0, 1, 3) // check if final state
|
||||||
ADD(0, 1, o1) // reject = 1
|
ADD(0, 1, o1) // reject = 1
|
||||||
JUMP(2)
|
JUMP(2)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user