drout

Neander Processor - multip. test

Nov 5th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; Neander Processor
  2. ;
  3. ; ira imprimir (out 0) o conteudo de "produto" sendo calculado
  4. ; como o acumulo de "fator_x" somado "fator_y" vezes.
  5.  
  6. ; inicio ---------------------------------------------
  7.  
  8.    ORG 0
  9.    LDI 0
  10.    STA produto
  11.    LDA fator_y
  12.    STA contad
  13.  
  14.    ;--------------
  15. loop_1:
  16.  
  17.    LDA fator_x
  18.    ADD produto
  19.    STA produto
  20.  
  21.    LDA contad
  22.    SUB const_1
  23.    STA contad
  24.  
  25.    JNZ loop_1
  26.    ;--------------
  27.  
  28.    LDA produto
  29.    OUT 0
  30.  
  31.    HLT
  32.  
  33. ; dados --------------------------------------------
  34.  
  35. fator_x: DB 8
  36. fator_y: DB 5
  37. contad:  DB 0
  38. produto: DB 0
  39. const_1: DB 1
  40.  
  41. ; fim ----------------------------------------------
Add Comment
Please, Sign In to add comment