MAIN START 0 
    .nastavi X register za prehod cez tabelo
    LDX counter
    .izracun vrednosti za vsak x v tabeli in
LOOP STA ctx_a
     JSUB HORNER_X
     LDA counter
     ADD #3
     STA counter
     LDX counter 
     COMP #bytes_len
     JLT LOOP

HALT J HALT
    END MAIN

HORNER_X LDA #1
         
         MUL in, X
         ADD #2

         MUL in, X
         ADD #3

         MUL in, X
         ADD #4

         MUL in, X
         ADD #5
           
         STA in, X
         
         .povrni kontekst pred skokom v subrutino
         LDA ctx_a   
         
         RSUB

.tabela x-ov polinoma
in WORD 0
   WORD 2
   WORD 3 
.parametri
lastin EQU *
bytes_len EQU lastin - in
counter WORD 0
.kontest
ctx_a RESW 1
