Non-loop programming problem

First time I did this was with a 6502 processor. Machine code. Not assembly!