commit 4219ee484fd5be380ddab6ae8849945cfcdecbc5 Author: Jaka Furlan Date: Tue Oct 21 22:28:30 2025 +0200 initial commit diff --git a/ass1/arith.asm b/ass1/arith.asm new file mode 100644 index 0000000..3474a8e --- /dev/null +++ b/ass1/arith.asm @@ -0,0 +1,44 @@ + + +arith START 0 + +start LDA x + ADD y + STA sum .shrani vsoto + + LDA x + SUB y + STA diff .shrani razliko + + LDA x + MUL y + STA prod .sharni produkt + + LDA x + DIV y + STA quot .shrani kvocient + + LDA y + MUL quot + STA z + LDA x + SUB z + STA mod .shrani modulo + +halt J halt + END start + +.podatki +x WORD 20 +y WORD 3 + +.rezultati +sum RESW 1 +diff RESW 1 +prod RESW 1 +quot RESW 1 +mod RESW 1 + +.za modulo +z RESW 1 + diff --git a/ass1/arithr.asm b/ass1/arithr.asm new file mode 100644 index 0000000..e014c74 --- /dev/null +++ b/ass1/arithr.asm @@ -0,0 +1,46 @@ + + +arith START 0 + +start LDT x + LDS y + ADDR T, S .shrani vsoto + STS sum + SUBR T, S .resetiraj S nazaj na y + + SUBR S, T + STT diff .shrani razliko + ADDR S, T .popravi T + + MULR T, S + STS prod .sharni produkt + + LDT x + LDS y + DIVR S, T + STT quot .shrani kvocient + + LDT x + LDS y + LDB quot + MULR S, B + SUBR B, T + STT mod .shrani modulo + +halt J halt + END start + +.podatki +x WORD 20 +y WORD 3 + +.rezultati +sum RESW 1 +diff RESW 1 +prod RESW 1 +quot RESW 1 +mod RESW 1 + +.za modulo +z RESW 1 + diff --git a/ass1/horner.asm b/ass1/horner.asm new file mode 100644 index 0000000..75a1a87 --- /dev/null +++ b/ass1/horner.asm @@ -0,0 +1,38 @@ +poly START 0 +start LDT x4 + LDS x + MULR S, T + LDA x3 + ADDR T, A . do sedaj izračunano (1x + 2) + + LDT x2 + MULR S, A + ADDR T, A .do sedaj izračunano ((1x+2)x + 3) + + LDT x1 + MULR S, A + ADDR T, A .do sedaj izračunano (((1x+2)x + 3)x + 4) + + LDT x0 + MULR S, A + ADDR T, A .do sedaj izračunano (((1x+2)x + 3)x + 4)x + 5 + + + STA rez + +halt J halt + END start + + +.polinom +x4 WORD 1 +x3 WORD 2 +x2 WORD 3 +x1 WORD 4 +x0 WORD 5 + +.tocka +x WORD 2 + +.rezultat +rez RESW 1 \ No newline at end of file diff --git a/ass1/poly.asm b/ass1/poly.asm new file mode 100644 index 0000000..24e92a1 --- /dev/null +++ b/ass1/poly.asm @@ -0,0 +1,42 @@ +poly START 0 +start LDA x0 .pristejemo x0 v A + + LDB x + LDS x + LDT x1 + MULR S, T + ADDR T, A .pristejemo x0 * x + + LDT x2 + MULR B, S .izracunamo x^2 + MULR S, T + ADDR T, A + + LDT x3 + MULR B, S .izracunamo x^3 + MULR S, T + ADDR T, A + + LDT x4 + MULR B, S .izracunamo x^4 + MULR S, T + ADDR T, A + + STA rez + +halt J halt + END start + + +.polinom +x4 WORD 1 +x3 WORD 2 +x2 WORD 3 +x1 WORD 4 +x0 WORD 5 + +.tocka +x WORD 2 + +.rezultat +rez RESW 1 \ No newline at end of file diff --git a/ass1/polySubrutine.asm b/ass1/polySubrutine.asm new file mode 100644 index 0000000..0363c11 --- /dev/null +++ b/ass1/polySubrutine.asm @@ -0,0 +1,48 @@ +poly START 0 +startSubrutine LDA x0 .pristejemo x0 v A + + LDB x + LDS x + LDT x1 + MULR S, T + ADDR T, A .pristejemo x0 * x + + LDT x2 + MULR B, S .izracunamo x^2 + MULR S, T + ADDR T, A + + LDT x3 + MULR B, S .izracunamo x^3 + MULR S, T + ADDR T, A + + LDT x4 + MULR B, S .izracunamo x^4 + MULR S, T + ADDR T, A + + STA rez + +halt J halt + END start + + +.polinom +x4 WORD 1 +x3 WORD 2 +x2 WORD 3 +x1 WORD 4 +x0 WORD 5 + +.tocka +x WORD 2 + +.rezultat +rez RESW 1 + +.parameter subrutine +arg1 RESW 1 + +.rezultat subrutine +subRez RESW 1 \ No newline at end of file diff --git a/hello.asm b/hello.asm new file mode 100644 index 0000000..362a8cd --- /dev/null +++ b/hello.asm @@ -0,0 +1,13 @@ +.koda +hello START 0 + LDA n + LDB #9 + MULR A, B + STA out + WD out +halt J halt + +.podatki +n WORD 0x000002 +out RESW 1 + END hello diff --git a/sictools.jar b/sictools.jar new file mode 100644 index 0000000..ce5a9a5 Binary files /dev/null and b/sictools.jar differ