final hw push
This commit is contained in:
parent
371cfddbde
commit
27b8de1bc2
36 changed files with 1018 additions and 6 deletions
29
ass1/vaje/osnove/horner.asm
Normal file
29
ass1/vaje/osnove/horner.asm
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
HORNER START 0
|
||||
. Pretvorimo polinom x^4 + 2x^3 + 3x^2 + 4x+5 v Hornerjevo obliko
|
||||
. b_n = a_n = 1
|
||||
. b_n-1 = 2 + b_n * x = 2 + 1 * x = 4
|
||||
. b_n-2 = 3 + b_n-1 * x = 3 + 4 * x = 11
|
||||
. b_n-3 = 4 + b_n-2 * x = 4 + 11 * x = 26
|
||||
. b_n-4 = 5 + b_n-3 * x = 5 + 26 * x = 57
|
||||
. kjer x = 2
|
||||
|
||||
LDA #1
|
||||
|
||||
MUL x
|
||||
ADD #2
|
||||
|
||||
MUL x
|
||||
ADD #3
|
||||
|
||||
MUL x
|
||||
ADD #4
|
||||
|
||||
MUL x
|
||||
ADD #5
|
||||
|
||||
STA res
|
||||
HALT J HALT
|
||||
END HORNER
|
||||
|
||||
x WORD 2
|
||||
res RESW 1
|
||||
Loading…
Add table
Add a link
Reference in a new issue