Advertisement
NovaYoshi

RPG Maker 2 computer instruction set

Apr 3rd, 2013
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.01 KB | None | 0 0
  1. --0xxxxx immediate positive
  2. --1xxxxx immediate negative
  3. --2xxxxx absolute
  4. --3xxxxx indirect
  5. --4xxxxx accumulator, X is ignored
  6.  
  7. 00mxxxxx NOP nop
  8. 01mxxxxx LDA load
  9. 02mxxxxx STA store
  10. 03mxxxxx ADD add
  11. 04mxxxxx SUB subtract
  12. 05mxxxxx MUL multiply
  13. 06mxxxxx DIV divide
  14. 07mxxxxx MOD modulo
  15. 08mxxxxx ASK input number, store to X
  16. 09mxxxxx SAY print number X
  17. 10mxxxxx JMP absolute jump to X
  18. 11mxxxxx JMR relative jump (PC += X)
  19. 12mxxxxx INE skip equal
  20. 13mxxxxx IEQ skip not equal
  21. 14mxxxxx IGE skip less than
  22. 15mxxxxx IGT skip less or equal
  23. 16mxxxxx ILE skip greater than
  24. 17mxxxxx ILT skip greater or equal
  25. 18mxxxxx RND random
  26. 19mxxxxx INC increment mem
  27. 20mxxxxx DEC decrement mem
  28.  
  29. 21mxxxxx JSR jump to subroutine
  30. 22mxxxxx RTS return from subroutine
  31. 23mxxxxx PHM push memory
  32. 24mxxxxx PLM pull memory (zero=pop to accumulator)
  33. 25mxxxxx
  34. 26mxxxxx
  35. 27mxxxxx
  36. 28mxxxxx
  37. 29mxxxxx
  38. 30mxxxxx
  39. 31mxxxxx
  40. 32mxxxxx
  41.  
  42. ----sample programs----
  43. print 1 to X
  44. 00 01000000 load
  45. 01 08000030 get max count user wants
  46. 02 09400000 show accumulator
  47. 03 03000001 increment counter
  48. 04 16200030 is it at the stopping value yet?
  49. 05 10000002 skip back to the loop if it isn't
  50. 06 10000006 otherwise infinite loop
  51.  
  52. sum of 3 numbers
  53. 00 08000020 get number 1
  54. 01 08000021 get number 2
  55. 02 08000022 get number 3
  56. 03 01200020 load number 1
  57. 04 03200021 add number 2
  58. 05 03200022 add number 3
  59. 06 09400000 display accumulator
  60. 07 10000000 loop
  61.  
  62.  
  63. 00 01000002 load two (first prime)
  64. 01 02000030 store current prime try
  65. 02 09200030 display prime (in accumulator) <-- jump here if successful
  66. 03 19000030 increment current try <-- jump here if not successful
  67. 04 01200030 get current prime try
  68. 05 02000031 store a temp copy that will count down
  69. 06 20000031 decrement counter <-- loop start
  70. 07 01200030 load current try
  71. 08 07200031 mod with counter
  72. 09 13000000 skip if nonzero (new try if zero)
  73. 10 10000003 new try
  74. 11 01200031 load counter
  75. 12 12000002 is it zero?
  76. 13 10000006 loop more
  77. 14 10000002
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement