README assembly
This commit is contained in:
parent
b474e6596f
commit
5169952816
41
README.md
41
README.md
@ -1,6 +1,45 @@
|
|||||||
# IN620
|
# IN620
|
||||||
|
Build and run all examples (pushdown automaton, a<sup>b</sup>, bubble sort, test)
|
||||||
|
```
|
||||||
|
make
|
||||||
|
```
|
||||||
|
build and run specific example
|
||||||
|
```
|
||||||
|
make automaton
|
||||||
|
make bubble_sort
|
||||||
|
make a_pow_b
|
||||||
|
make test
|
||||||
|
```
|
||||||
|
## Assembly
|
||||||
|
### registries
|
||||||
|
+ in : input registry n, n integer (read only)
|
||||||
|
* i@in, i@rn, i@on for indirections
|
||||||
|
i@rn input registry, address is the integer in rn work registry
|
||||||
|
+ rn : work registry n, n integer
|
||||||
|
* r@in, r@rn, r@on for indirections
|
||||||
|
+ on : output registry n, n integer (write only)
|
||||||
|
* o@in, o@rn, o@on for indirections
|
||||||
|
|
||||||
|
### arithmetic instructions
|
||||||
|
+ ADD(r1, r2, r3)
|
||||||
|
+ SUB(r1, r2, r3)
|
||||||
|
+ MULT(r1, r2, r3)
|
||||||
|
+ DIV(r1, r2, r3)
|
||||||
|
|
||||||
## pushdown automaton
|
r3 = r1 OP r2
|
||||||
|
r1, r2 can be integers instead of registries.
|
||||||
|
### control instructions
|
||||||
|
+ JUMP(z)
|
||||||
|
current instruction += z
|
||||||
|
+ JE(r1, r2, z)
|
||||||
|
if r1=r2 then JUMP(z)
|
||||||
|
+ JL(r1, r2, z)
|
||||||
|
if r1>r2 then JUMP(z)
|
||||||
|
|
||||||
|
r3 = r1 OP r2
|
||||||
|
r1, r2 can be integers instead of registries.
|
||||||
|
|
||||||
|
## Pushdown automaton
|
||||||
Input word = i0, I, K
|
Input word = i0, I, K
|
||||||
+ i0 total length of input word
|
+ i0 total length of input word
|
||||||
+ I = i1, J
|
+ I = i1, J
|
||||||
|
Loading…
x
Reference in New Issue
Block a user