7. Exercise

For this exercise, I want you to write a mode 8 plot routine in a manner similar to the plot_4 routine shown above. Here are some hints :

The algorithm is as follows :

The results of (x and 6) are as follows :

XX AND 6
00
10
22
32
44
54
66
76
80
90
102

And so on. Because we are using two bits of the green and red bytes to represent our colour, we need to always rotate by an even number.

To test it all out, add the code to the end of the original file which has plot_4 in it and change the first two lines from this :

start       bra     plot_init
plot_4      bsr.s   calc

to the following :

start       bra     plot_init
plot_4      bra     plot_4
plot_8      bra     plot_8

This means that plot_init is the start address, plot_4 is at address + 4 and plot_8 has been inserted at start address + 8, as follows :

1000  PLOT_INIT = RESPR(256): REMark Enough space for plot_8 as well !
1005  PLOT_4 = PLOT_INIT + 4
1010  PLOT_8 = PLOT_INIT + 8
1010  LBYTES flp1_plot_bin, PLOT_INIT
1015  CALL PLOT_INIT

Have fun.