From 5169952816f47b007f187499165d397ca3b4d55a Mon Sep 17 00:00:00 2001 From: Sam Hadow Date: Thu, 11 Apr 2024 22:22:15 +0200 Subject: [PATCH] README assembly --- README.md | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 976f2fb..4b086da 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,45 @@ # IN620 +Build and run all examples (pushdown automaton, ab, 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 + i0 total length of input word + I = i1, J