The program structure is just brute force, linear searches for primes, square roots and cubic roots. The max prime here is 311, and that has 9 bits.
I assumed one instruction to compute the square of a 32+9 bit number, and 2 instructions for its cube. That was probably too optimistic in both cases.