Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Author: Aiden Blishen Cuneo
- // This code is intended for interpretation using Aiden Blishen Cuneo's Minelang Interpreter for Minecraft.
- // Contact aidencuneo@gmail.com for more information.
- // Program to interpret
- '''0123456789
- str 0 652
- // Index in program
- mov 1 0
- // Interpreter variables
- // ptr1
- mov 10 0
- // ptr2
- mov 11 0
- // ptr3
- mov 12 0
- // Begin interpretation
- label 0
- // Character to interpret can be retrieved with register 68
- mov 68 1 4
- // cmp '0'
- cmp 68 48
- je 1
- // cmp '1'
- cmp 68 49
- je 2
- // cmp '2'
- cmp 68 50
- je 3
- // cmp '3'
- cmp 68 51
- je 4
- // cmp '4'
- cmp 68 52
- je 5
- // cmp '5'
- cmp 68 53
- je 6
- // cmp '6'
- cmp 68 54
- je 7
- // cmp '7'
- cmp 68 55
- je 8
- // cmp '8'
- cmp 68 56
- je 9
- // cmp '9'
- cmp 68 57
- je 10
- // If character doesn't match anything above, skip it
- jmp 999
- // '0'
- label 1
- // Set ptr1 to 0
- mov 10 0
- jmp 999
- // '1'
- label 2
- // Add 1 to ptr1
- add 10 1
- jmp 999
- // '2'
- label 3
- // Add 2 to ptr1
- add 10 2
- jmp 999
- // '3'
- label 4
- // Add 3 to ptr1
- add 10 3
- jmp 999
- // '4'
- label 5
- // Add 4 to ptr1
- add 10 4
- jmp 999
- // '5'
- label 6
- // Add 5 to ptr1
- add 10 5
- jmp 999
- // '6'
- label 7
- // Add 6 to ptr1
- add 10 6
- jmp 999
- // '7'
- label 8
- // Add 7 to ptr1
- add 10 7
- jmp 999
- // '8'
- label 9
- // Add 8 to ptr1
- add 10 8
- jmp 999
- // '9'
- label 10
- // Add 9 to ptr1
- add 10 9
- jmp 999
- // End of character, move to the next character
- label 999
- add 1 1
- // Is this character a null byte?
- cmp 0 1 4
- // If so, jump to the exit label
- je 998
- // Interpret the next character
- jmp 0
- // Post-interpretation stuff
- label 998
- syscall 1 10 1
- syscall 2 10
- syscall 1 11 1
- syscall 2 10
- syscall 1 12 1
- syscall 2 10
- // (Currently nothing needs to happen here)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement