Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --0xxxxx immediate positive
- --1xxxxx immediate negative
- --2xxxxx absolute
- --3xxxxx indirect
- --4xxxxx accumulator, X is ignored
- 00mxxxxx NOP nop
- 01mxxxxx LDA load
- 02mxxxxx STA store
- 03mxxxxx ADD add
- 04mxxxxx SUB subtract
- 05mxxxxx MUL multiply
- 06mxxxxx DIV divide
- 07mxxxxx MOD modulo
- 08mxxxxx ASK input number, store to X
- 09mxxxxx SAY print number X
- 10mxxxxx JMP absolute jump to X
- 11mxxxxx JMR relative jump (PC += X)
- 12mxxxxx INE skip equal
- 13mxxxxx IEQ skip not equal
- 14mxxxxx IGE skip less than
- 15mxxxxx IGT skip less or equal
- 16mxxxxx ILE skip greater than
- 17mxxxxx ILT skip greater or equal
- 18mxxxxx RND random
- 19mxxxxx INC increment mem
- 20mxxxxx DEC decrement mem
- 21mxxxxx JSR jump to subroutine
- 22mxxxxx RTS return from subroutine
- 23mxxxxx PHM push memory
- 24mxxxxx PLM pull memory (zero=pop to accumulator)
- 25mxxxxx
- 26mxxxxx
- 27mxxxxx
- 28mxxxxx
- 29mxxxxx
- 30mxxxxx
- 31mxxxxx
- 32mxxxxx
- ----sample programs----
- print 1 to X
- 00 01000000 load
- 01 08000030 get max count user wants
- 02 09400000 show accumulator
- 03 03000001 increment counter
- 04 16200030 is it at the stopping value yet?
- 05 10000002 skip back to the loop if it isn't
- 06 10000006 otherwise infinite loop
- sum of 3 numbers
- 00 08000020 get number 1
- 01 08000021 get number 2
- 02 08000022 get number 3
- 03 01200020 load number 1
- 04 03200021 add number 2
- 05 03200022 add number 3
- 06 09400000 display accumulator
- 07 10000000 loop
- 00 01000002 load two (first prime)
- 01 02000030 store current prime try
- 02 09200030 display prime (in accumulator) <-- jump here if successful
- 03 19000030 increment current try <-- jump here if not successful
- 04 01200030 get current prime try
- 05 02000031 store a temp copy that will count down
- 06 20000031 decrement counter <-- loop start
- 07 01200030 load current try
- 08 07200031 mod with counter
- 09 13000000 skip if nonzero (new try if zero)
- 10 10000003 new try
- 11 01200031 load counter
- 12 12000002 is it zero?
- 13 10000006 loop more
- 14 10000002
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement