Compare commits
No commits in common. "fc0c6809303bc94b103c1b9db7368545ec158a1b" and "06aa39473a7ec48b003e2c3e2bd4b73ec5b40ab6" have entirely different histories.
fc0c680930
...
06aa39473a
5 changed files with 0 additions and 222 deletions
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -3,7 +3,6 @@
|
|||
cat START 0
|
||||
|
||||
CLEAR X
|
||||
|
||||
|
||||
read RD #0
|
||||
STCH BUFF, X
|
||||
Loading…
Add table
Add a link
Reference in a new issue