you can't just push and pop c. You have to push and pop in register pairs: af,bc,de, and hl....so you would have to push bc and pop bc instead of just c...and instead of using sub to check stuff, use cp (compare)