Advertisement
ahmad_zizo

PRIME SIC

Nov 9th, 2014
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. test start 1000
  2. lda two
  3. counter sta beta
  4. loop lda alpha
  5. div beta
  6. mul beta
  7. sta remain
  8. lda alpha
  9. sub remain
  10. comp zero
  11. jeq np
  12. lda beta
  13. add one
  14. comp alpha
  15. jlt counter
  16. jeq p
  17. p ldx zero
  18. wploop td outdev
  19. jeq wploop
  20. ldch prime,x
  21. wd outdev
  22. tix five
  23. jlt wploop
  24. j END
  25. np ldx zero
  26. wnploop td outdev
  27. jeq wnploop
  28. ldch notprime,x
  29. wd outdev
  30. tix nine
  31. jlt wnploop
  32. j END
  33. zero word 0
  34. one word 1
  35. two word 2
  36. three word 3
  37. five word 5
  38. nine word 9
  39. alpha word 5
  40. beta resw 1
  41. remain resw 1
  42. outdev byte x'05'
  43. prime byte c'prime'
  44. notprime byte c'not prime'
  45. END end test
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement