What do those Labels (move.w, sub.w, bcs.s , etc. Most of the others)
#1
Posted 06 January 2012 - 02:58 AM
#2
Posted 06 January 2012 - 03:47 AM
01 02 and this is what a byte looks like: 03. Now move.w means you're moving a word value to another address or register. Sub.w means you're subtracting a word from another value whether it be a register, or an address. Of course, this is all from memory as I haven't touched any of the 16-bit Sonic games in a long time. So I suggest you also check out these two guides on Sonic Retro:
http://info.sonicret...Instruction_Set
http://info.sonicret...ssembly_Hacking
I hope that helps.
#3
Posted 06 January 2012 - 04:28 AM
#4
Posted 06 January 2012 - 07:40 AM
#5
Posted 06 January 2012 - 04:52 PM
#6
Posted 08 January 2012 - 12:54 AM
This is the site I use. Still can't make heads or tails of most of it but in general it is a big help.
#7
Posted 08 January 2012 - 06:22 AM
BCC = Branch if Carry Clear
The processor has its own set of flags to determin the conditions (or "results") of your instructions, there are 5 as I understand it C (Carry), V (oVerflow), Z (Zero), N (Negative), X (eXtended):
The instructions above reads the carry flag to see if it is set or cleared, an example of the instrution in use:
Recheck:
add.b d0,d0
bcc Recheck
If we were to imagine that d0 was 00 00 00 08, as we're only adding a byte, we only need to pay attention to the 08, now 08 in binary is 0000 1000.
So, adding d0 to d0 means adding 08 to 08, this results in 10. With 08 in binary meaning 0000 1000, and 10 in binary meaning 0001 0000, all that's happened here is the bits have shifted left:
C d0 v v - 0000 1000< Shift left once <
C d0 v v 0 0001 0000
Now you can see the very far left bit (a.k.a. the most significant bit) has shifted so far, it has gone outside the byte space, this bit is sent to the carry flag as the carry bit, now the carry flag = 0 (it is now clear).
The next instruction is branch if carry is clear, now it was cleared by the add instruction, so it branches back to "Recheck".
Once again, it adds d0 to d0, 10 + 10 = 20:
C d0 v v 0 0001 0000< Shift left once <
C d0 v v 0 0010 0000
Once again, 0 has shifted into the carry flag, so bcc branches back to "Recheck", adding again d0 to d0, 20 + 20 = 40:
C d0 v v 0 0010 0000< Shift left once <
C d0 v v 0 0100 0000
Again, 0 has shifted into the carry flag, so bcc branches back to "Recheck", adding again d0 to d0, 40 + 40 = 80:
C d0 v v 0 0100 0000< Shift left once <
C d0 v v 0 1000 0000
And again, 0 has shifted into the carry flag, so bcc branches back to "Recheck", adding again d0 to d0, 80 + 80 = 100:
C d0 v v 0 1000 0000< Shift left once <
C d0 v v 1 0000 0000
This time, 1 has shifted into the carry flag, so now bcc will not branch as carry is set, it will now resume.
#8
Posted 10 January 2012 - 05:06 AM
I'd suggest reading up the basic commands of ASM here: http://info.sonicret...68000_assembly The guide assumes you know what hex is and how it basically works, and the guide will teach you the basics. It's all (usually) logical, and the more complex things aren't really related to ASM, but how the game itself is set up. At times this can be mind melting even for the best of us.
Edit: Ninja'd, but seriously, go read it again.
Edited by Irixion, 10 January 2012 - 06:26 PM.
#9
Posted 10 January 2012 - 05:37 AM
Oh Jester, you can't expect him to completely understand that!
I'd suggest reading up the basic commands of ASM here: http://info.sonicret...68000_assembly The guide assumes you know what hex is and how it basically works, and the guide will teach you the basics. It's all (usually) logical, and the more complex things aren't really related to ASM, but how the game itself is set up. At times this can be mind melting even for the best of us.
Edit: Ninja'd, but seriously, go read it again.
I'd read this but there is no text on the page.
#10
Posted 10 January 2012 - 06:25 PM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users



This topic is locked








