diff --git a/ass1/arith.asm b/ass1/arith.asm deleted file mode 100644 index 24354b0..0000000 --- a/ass1/arith.asm +++ /dev/null @@ -1,49 +0,0 @@ -arith START 0 - - . seštevek: sum = x + y - LDA x - ADD y - STA sum - - . razlika: diff = x - y - LDA x - SUB y - STA diff - - . produkt: prod = x * y - LDA x - MUL y - STA prod - - . količnik: quot = x / y - LDA x - DIV y . - STA quot - - . ostanek: mod = x - y * (x / y) - STA qtemp - - LDA y - MUL qtemp - STA prodtmp - - LDA x - SUB prodtmp - STA mod - -HALT J HALT - -.data -x WORD 5 -y WORD 2 - -sum RESW 1 -diff RESW 1 -prod RESW 1 -quot RESW 1 -mod RESW 1 - -qtemp RESW 1 -prodtmp RESW 1 - - END arith diff --git a/ass1/arithr.asm b/ass1/arithr.asm deleted file mode 100644 index 69453f4..0000000 --- a/ass1/arithr.asm +++ /dev/null @@ -1,59 +0,0 @@ -.code -arithr START 0 - - LDA x ; A = x - LDB y ; B = y - - RMO A,S ; S = x - RMO B,T ; T = y - -. sum = x + y - RMO S,A ; A = x - ADDR T,A ; A = x + y - STA sum - -. diff = x - y - RMO S,A ; A = x - SUBR T,A ; A = x - y - STA diff - -. prod = x * y - RMO S,A ; A = x - RMO T,B ; B = y - MULR B,A ; A = x * y - STA prod - -. quot = x / y - RMO S,A ; A = x - RMO T,B ; B = y - DIVR B,A ; A = x / y - STA quot - - -. mod = x % y = x - (x / y)*y - RMO S,A - RMO T,B - DIVR B,A ; A = q = x/y - RMO A,L ; L = q (shrani) - - RMO T,A ; A = y - RMO L,B ; B = q - MULR B,A ; A = y*q = produkt - - RMO S,B ; B = x - SUBR A,B ; B = x - (y*q) - STB mod - -HALT J HALT - -.data -x WORD 5 -y WORD 2 - -sum RESW 1 -diff RESW 1 -prod RESW 1 -quot RESW 1 -mod RESW 1 - - END arithr diff --git a/ass1/poly.asm b/ass1/poly.asm deleted file mode 100644 index 6fcddae..0000000 --- a/ass1/poly.asm +++ /dev/null @@ -1,57 +0,0 @@ -poly START 0 - - . potence x^1 .. x^4 - LDA x - STA x1 - - MUL x - STA x2 - - MUL x - STA x3 - - MUL x - STA x4 - - - . x3 = 2 * x^3 - LDA x3 - LDB #2 - MULR A,B - STB x3 - - . x2 = 3 * x^2 - LDA x2 - LDB #3 - MULR A,B - STB x2 - - . x1 = 4 * x - LDA x1 - LDB #4 - MULR A,B - STB x1 - - . vsota vseh - LDA x0 - ADD x1 - ADD x2 - ADD x3 - ADD x4 - STA result - - -HALT J HALT - END poly -.data -x WORD 2 ; vrednost x - -x4 RESW 1 -x3 RESW 1 -x2 RESW 1 -x1 RESW 1 -x0 WORD 5 ; konstanta - -result RESW 1 - - END poly diff --git a/ass1/stack.asm b/ass1/stack.asm deleted file mode 100644 index a61cbea..0000000 --- a/ass1/stack.asm +++ /dev/null @@ -1,56 +0,0 @@ -.code - -stack START 0 - - LDA #9 - STA @stackptr - JSUB stackpush - - JSUB stackpop - LDA @stackptr - -halt J halt - - -stackinit - STA stacktmp - - LDA #STACK - STA stackptr - - LDA stacktmp - RSUB - - -stackpush - STA stacktmp - - LDA stackptr - ADD #3 - STA stackptr - - LDA stacktmp - RSUB - - -stackpop - STA stacktmp - - LDA stackptr - SUB #3 - STA stackptr - - LDA stacktmp - RSUB - - -.data - -stackptr WORD 0 - -stacktmp WORD 0 - -STACKSIZE EQU 50 -STACK RESW STACKSIZE - - END stack diff --git a/ass1/cat.asm b/vhod_izhod/cat.asm similarity index 99% rename from ass1/cat.asm rename to vhod_izhod/cat.asm index 6bb74d4..32b9908 100644 --- a/ass1/cat.asm +++ b/vhod_izhod/cat.asm @@ -3,7 +3,6 @@ cat START 0 CLEAR X - read RD #0 STCH BUFF, X