Loops in 68k are very limited... Forget about <b>while</b>- or <b>for</b>-like loops ;) For loops, you use <b>DBcc</b>. Usually, programmers just use <b>DBF</b> or <b>DBRA</b>
(which mean the same). First operand is a data register that will be
decremented and the second one is a label where to loop if this data
register isn't -1. Example:<br><br>

<pre class="68k">	lea	($1234).l,a0
	lea	($FFFF1234).w,a1
	moveq	#7,d0
Loop:
	move.w	(a0)+,(a1)+
	dbf	d0,Loop</pre>

This example will go back to the Loop label 8 times (<b>d0 + 1</b>). It's not that hard... I won't show the other <b>DBcc</b> instructions because they are practically useless. Maybe later, when I'll write an instruction list...<br><br>
Second part of this chapter will be arrays. Well, I call them arrays,
but they really aren't. Those are just sets of bytes, words, longwords
that are readed depending on some variable. For instance, we want to
load a different music depending on the current level:<br><br>
<pre class="68k">	moveq	#0,d0			;clear d0
	move.b	($FFFFFE10).w,d0	;move level to d0 (00 - GHZ, 01 - LZ etc)
	lea	(MusicArray).l,a0	;load the music values array into a0
	move.b	(a0,d0.w),d0		;see the explanation
	rts

MusicArray:
	dc.b	$81,$82,$83,$84,$85,$86</pre>

I thought 5 damn minutes about how should I explain this XD. The <b>move.b (a0,d0.w),d0</b> instruction moves a byte at <b>a0 + d0</b> to <b>d0</b>. Let's examine 3 possibilities (GHZ - 00, LZ - 01, MZ - 02)

<pre class="68k">GHZ:

	d0 = 00
	a0 = $1234

move.b	(a0,d0.w),d0

	d0 = (a0 + d0)
	d0 = ($1234 + 0)
	d0 = ($1234)
	d0 = $81

LZ:

	d0 = 01
	a0 = $1234

move.b	(a0,d0.w),d0

	d0 = (a0 + d0)
	d0 = ($1234 + 01)
	d0 = ($1235)
	d0 = $82

MZ:

	d0 = 02
	a0 = $1234

move.b	(a0,d0.w),d0

	d0 = (a0 + d0)
	d0 = ($1234 + 02)
	d0 = ($1236)
	d0 = $83</pre>
I hope you get it... This chapter was short but very important, so if
you don't understand something, read it 10 times =P And you can always
ask on the forums.
