|
|
Atari demoscene BBS
| Re: and the rest of it.... |
|
Posted by: Ragstaff
|
Oct,06.2003-16:28
|
*****It seems it was too big for one post :) Looks like the tabs get taken out too, which ruins the formatting!****
~*~*~ LOOPS ~*~*~
----------------------
OK, I had to explain registers before explaining the CCR, and I had to explain the CCR before explaining comparisons and branches. We've done all that, so let's (finally) get on with the loop constructs.
Here we go then, Pete.
This code has not been run through an assembler, I'm rather tired, and I've never coded assembly on the ST (or 68000!) before, so please understand that this is just conceptual! I hope you can look at this and say "ahh, that's how you'd go about it", and then go off and find out about all the addressing modes and other stuff yourself. Don't wait for me to finish the tutorial properly and clarify this stuff myself, because I may never get around to it :-)
~*~*~*~*~*~*~Figure 2~*~*~*~*~*~*~
*****************
*UPROTECTED LOOP
*****************
MOVE.L #10,D0 * Load decimal 10 into D0
LOOP1 SUBQ #1,D0 * Subtract 1 from D0
TST D0 * Compare D0 with 0
BNE LOOP1 * If D0 != 0, branch back to top
****************
*PROTECTED LOOP
****************
MOVE.L #10,D0 * Load decimal 10 into D0
LOOP2 TST D0 * Compare D0 with 0
BEQ LOOPEND * If D0 = 0, branch to end of loop
SUBQ #1,D0 * Decrement D0
BRA LOOP2 * Go back to top of loop
LOOPEND NOP * no operation
~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
|
[All messages in this thread] [Start new thread]
|
Topic
|
Posted by
|
Date
|
|
What I'd love to see is...
|
Pete
|
Oct,04.2003-23:44
|
|
Re: What I'd love to see is...
|
Grz
|
Oct,05.2003-12:27
|
|
Re: What I'd love to see is...
|
Simon Sunnyboy
|
Oct,05.2003-15:16
|
|
Re: What I'd love to see is...
|
Pete
|
Oct,05.2003-15:48
|
|
Re: Ok, a basic tutorial...
|
Ragstaff
|
Oct,06.2003-10:20
|
|
Re: Ok, a basic tutorial...
|
Pete
|
Oct,06.2003-12:15
|
|
Here it is then...
|
Ragstaff
|
Oct,06.2003-16:22
|
|
Re: and the rest of it....
|
Ragstaff
|
Oct,06.2003-16:28
|
|
Re: and the rest of it....
|
Pete
|
Oct,06.2003-16:36
|
|
np =)
|
Ragstaff
|
Oct,06.2003-16:49
|
|
np =)
|
Ragstaff
|
Oct,07.2003-00:16
|
|
lets try the code again
|
Ragstaff
|
Oct,06.2003-16:43
|
|
Re: Ok, a basic tutorial...
|
creature XL
|
Oct,06.2003-15:32
|
|
Re: Ok, a basic tutorial...
|
Ragstaff
|
Oct,06.2003-16:25
|
What's the anti-troll code? That's your personal code to be able to add comments and messages on the dhs.nu site.
Don't have a code or forgot it? Fix it here.
|