11. Exercise

As an exercise, why not add a new procedure called PSI to the code for PSI_CLS. This new procedure will carry out all the same work as PSI_CLS but it will not do the CLS part of it. This will be useful when you want to set the colours for a window but not clear it. I will NOT be giving the answers out next time, but here are a few hints :

All in all, I think this can be done in about 10 extra lines of code, maybe less, not counting the extra lines in the definition block.

Warning

Adding even a few lines of code can sometimes cause any 'short' branches to go out of limit and this will cause errors in the assembly. If this happens, simply find the ones in error and remove the '.s' from the 'bsr' or 'bra' instructions.