Advertisement
Guest User

ByteBite Multiplication Explanation

a guest
Jan 22nd, 2013
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. Program:
  2.  
  3. [?>]>>>>=<=[<j]<<j>>[->+>+<<]>[-<+>]<<-[<j]<<j>>>>>#>[?>]
  4.  
  5. Memory:
  6.  
  7. "Enter Multiplicand. Hit Enter. Enter Multiplicator. Hit Enter", 0, 46, 18, 0, 0, 0, 0 "Is the result."
  8.  
  9. Memory Aliases:
  10.  
  11. S1 F J1 J2 X Y Z T S2
  12.  
  13. Step by Step:
  14.  
  15. [?>] Print S1
  16.  
  17. >>>>= DecIn Multiplicand into Mem(Y)
  18.  
  19. <= DecIn Multiplicator into Mem(X)
  20.  
  21. [<j]<<j If Mem(X) == 0 then Jump J1 else Jump J2
  22.  
  23. *J2*-----------------------------------------------------18
  24.  
  25. >> Point at Mem(Y)
  26.  
  27. [->+>+<<] Move Mem(Y) into Mem(Z) while Adding Mem(Y) to Mem(T)
  28.  
  29. > Point at Mem(Z)
  30.  
  31. [-<+>] Move Mem(Z) to Mem(Y)
  32.  
  33. <<- Decrement Mem(X)
  34.  
  35. [<j]<<j If Mem(X) == 0 then Jump to J1 else Jump J2
  36.  
  37. *J1*------------------------------------------------------46
  38.  
  39. >>>>># DecOut Mem(T)
  40.  
  41. >[?>] Print S2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement