As you know CPU has some basic instructions, like START, STORE, LOAD, ADD, SUB and etc. You can execute some operations with these basic instructions. I wrote these instructions like methods for CPU Emulator. And there are two example instruction sets in .txt files (sum.txt, matrix.txt).
sum.txt compute sum of number from 0 to 20.
matrix.txt print matrix indices to screen.
javac Main.java
For sum of numbers
java Main sum.txt
For indices of matrix
java Main matrix.txt