I'm attempting to write a program which requires the use of a for-loop, among other things. I am having a terrible time trying to find examples of basic code such as this on other websites.
If someone could please provide me with a simple for loop, or even the instructions I should be looking at I would be greatful. And please, if you know of a good resource for 68k beginner tutorials, comment below!
Thanks!
See here for an answer to your query (3rd result in google search '68000 assembly')
[edit]
add answer from link
The 68000 has the rare (unique?) characteristic of having separate address and data registers. There are eight data registers, D0-D7, and eight address registers, A0-A7. A7 is also the stack pointer, SP. This means that 68000 assembly language tends to be easier to follow because you can easily tell which registers hold data and which hold addresses. For example, this is 68000 assembly to compute the sum of an array of words:
moveq #0, d0
moveq #0, d1
moveq #5, d2
loop:
move.w (a0)+, d0
add.l d0, d1
dbra d2, loop
[/edit]