Jump to content

  •  

Photo

[General] Beginner ASM guide


  • This topic is locked This topic is locked
63 replies to this topic

#37 insulfrog

insulfrog

    1 Chaos Emerald

  • Member
  • 40 posts
  • Gender:Male
  • Location:Boston, Lincolnshire, England

Posted 03 October 2007 - 04:48 PM

The giude is excellent, I could do with learning ASM, however still 1 question remains, how do you re-assemble the rom? :P

Surely there is a way to put the rom back together after you have taken it apart and edited it. :P
  • 0

#38 shobiz

shobiz

    3 Chaos Emeralds

  • Member
  • 193 posts
  • Gender:Male
  • Location:Karachi, Pakistan
  • Interests:Reading, programming, mathematics, physics, chemistry, football, tennis

Posted 03 October 2007 - 04:56 PM

The giude is excellent, I could do with learning ASM, however still 1 question remains, how do you re-assemble the rom? :P

Surely there is a way to put the rom back together after you have taken it apart and edited it. :P

Well, there's a file called build.bat that comes with every disassembly - click it and it re-assembles the ROM.

To be more specific, build.bat calls the assembler (usually SNASM68K, AS or ASM68K) with specific parameters to actually re-assemble the ROM, and may perform other steps as well (for example header fixing in Xenowhirl's, or binary file inclusion in Nemesis's)
  • 0

#39 redhotsonic

redhotsonic

    Also known as RHS

  • Staff
  • 1586 posts
  • Gender:Male
  • Location:United Kingdom

Posted 03 October 2007 - 05:49 PM

If you copy the CMD from SYSTEM32 and double click on it then type build, if you have errors, you can read it, rather it displaying the errors then quickly going again.
  • 0

#40 shobiz

shobiz

    3 Chaos Emeralds

  • Member
  • 193 posts
  • Gender:Male
  • Location:Karachi, Pakistan
  • Interests:Reading, programming, mathematics, physics, chemistry, football, tennis

Posted 03 October 2007 - 06:27 PM

If you copy the CMD from SYSTEM32 and double click on it then type build, if you have errors, you can read it, rather it displaying the errors then quickly going again.

You could also add a "pause" command to the end of build.bat - in fact, Xenowhirl's does this in case of an error.
  • 0

#41 shobiz

shobiz

    3 Chaos Emeralds

  • Member
  • 193 posts
  • Gender:Male
  • Location:Karachi, Pakistan
  • Interests:Reading, programming, mathematics, physics, chemistry, football, tennis

Posted 20 April 2008 - 01:31 PM

I posted this on the guide's talk page on the Retro wiki, but since I doubt it's gonna get seen there,

Codetwo:
clr.l #4,($FFFFFF10).w

Is that supposed to be a clr.l ($FFFFFF10).w or a move.l #4,($FFFFFF10).w? Either way, the answer you've given for the exercise comes out wrong.
  • 0

#42 redhotsonic

redhotsonic

    Also known as RHS

  • Staff
  • 1586 posts
  • Gender:Male
  • Location:United Kingdom

Posted 20 April 2008 - 03:27 PM

I don't think it matters either way. As long as it's not part of the Special Key, I'm not too bothered. Good pointing out though.
  • 0

#43 Thundertimi

Thundertimi

    4 Chaos Emeralds

  • Member
  • 237 posts
  • Gender:Male
  • Location:Too far...

Posted 21 April 2008 - 07:42 AM

I have seen lot of asm guides, but this was easiest understand.
I dont understand all, but thats just because my english sucks.
  • 0

#44 Selbi

Selbi

    Obligatory new year's avatar remake.

  • Pro User
  • 1674 posts
  • Gender:Male
  • Location:Lüneburg, Germany

Posted 01 February 2009 - 12:03 AM

This Guide is nearly 2 Years old, but you should place the ASM coding in a ASM-Box.
  • 0

#45 Qjimbo

Qjimbo

    7 Chaos Emeralds

  • Pro User
  • 808 posts
  • Gender:Male
  • Location:Vancouver, BC
  • Interests:Webdesign, HTML, PHP,
    Programming, Delphi, C++

Posted 01 February 2009 - 01:26 PM

Done the ASM boxes, still some more formatting stuff left to do.
  • 0

#46 Malevolence

Malevolence

    2 Chaos Emeralds

  • Pro User
  • 94 posts
  • Gender:Male

Posted 05 February 2009 - 11:14 PM

The ADD command

add.b #2,($FFFFFEB8).w


This is pretty much the same as the command MOVE, but it adds instead. Example, let's say $FFFFFEB8 is 01 01 01 01 and then we did this command above, it'll become 03 01 01 01. Do you see how it works? One more example.

add.w #4,($FFFFFEB8).w ; going to add the word 04 to $FFFFFEB8


$FFFFFEB8 is now 00 05 01 01.


Just a small note, when I started learning assembly and looking at this guide this section always confused me. $FFFFFEB8 should actually be 01 05 01 01 after that second add (assuming the RAM was equal to 01 01 01 01 in the second addition, if it's 03 01 01 01 from the first command then it will be 03 05 01 01).

Edited by Malevolence, 05 February 2009 - 11:16 PM.

  • 0

#47 Qjimbo

Qjimbo

    7 Chaos Emeralds

  • Pro User
  • 808 posts
  • Gender:Male
  • Location:Vancouver, BC
  • Interests:Webdesign, HTML, PHP,
    Programming, Delphi, C++

Posted 05 February 2009 - 11:17 PM

Good point, fixed.
  • 0

#48 redhotsonic

redhotsonic

    Also known as RHS

  • Staff
  • 1586 posts
  • Gender:Male
  • Location:United Kingdom

Posted 29 April 2011 - 12:23 AM

Can I request this to be pinned? If not, dis-regard and just delete my post.
  • 0

#49 Oerg866

Oerg866

    The dense kraut(tm)

  • Member
  • 231 posts
  • Gender:Male
  • Location:Frankfurt

Posted 29 April 2011 - 02:37 PM

. Trash .

Edited by Oerg866, 01 May 2011 - 01:37 PM.

  • 0

#50 Spanner

Spanner

    Capable when people thought I wasn't...

  • Staff
  • 1477 posts
  • Gender:Male
  • Location:United Kingdom

Posted 29 April 2011 - 02:41 PM

You do realise that this guide was made a few years ago?
  • 0

#51 Oerg866

Oerg866

    The dense kraut(tm)

  • Member
  • 231 posts
  • Gender:Male
  • Location:Frankfurt

Posted 29 April 2011 - 02:44 PM

. Trash .

Edited by Oerg866, 01 May 2011 - 01:38 PM.

  • 0

#52 redhotsonic

redhotsonic

    Also known as RHS

  • Staff
  • 1586 posts
  • Gender:Male
  • Location:United Kingdom

Posted 29 April 2011 - 05:09 PM

I've been away for 3 years or more. To be totally honest, I don't even know any ASM anymore =P

Although, all corrections are appreciated.

Plus, I asked for it to be pinned because I thought it was a big thing.

Edited by redhotsonic, 29 April 2011 - 05:10 PM.

  • 0

#53 MarkeyJester

MarkeyJester

    A word in your shell-like, pal

  • Pro User
  • 1329 posts
  • Gender:Male

Posted 29 April 2011 - 08:20 PM

SUBQ and ADDQ are also very nice. They can only add 0 (lol) to data and adress registers, which is nice, and saves CPU cycles if you do so.

Actually they can add/subtract values from 1 to 7, infact, they cannot add/subtract 0.

Meh. An address register holds an adress (not a pointer really, just an adress).

Actually, that depends on the way you "perceive" it, an address or pointer have moderately same meanings, so to say that one is wrong and cannot be used to explain how something works, seems a little unjust.

I might want to remind you that they're instructions, not commands. Also,

Again, that depends on the way you "perceive" it, Definition: directive, instruction.

That will most probably crash the machine because a BRA does not imply that you are branching to a subroutine you wish to return from later.

Well, it will crash the machine yes, only if the stack is at it's root though, which I think is irrelevant to this "beginner's" guide.

Also you might want to explain program counter relative operations of branches (since bra.s is fastest, if the destination is within range of I think a difference of 127 bytes from the current program counter). <-- I'm pretty tired so I might have just stated something completely wrong but yeah it should work like that.

It's a beginner's guide, it's designed to give people a starting boost, if we included more extensive explainations at an early part of the guide, then people will struggle to understand how to work with the processor. These things take time, and are irrelevant at this stage if you plan to teach someone without confusing them.

Teaching people how to waste CPU cycles, nice going :)

It's a beginners guide.

(Pleas don't take this offensively please ;))

Well, please be sure to be subtle about the way you express correction, you sound arsey quite frankly, almost as if you were rubbing in that you knew so much more, considering that some of the information you gave was somewhat irrelevant. I'm sure some respect the fact that you're doing your best to help, but the way you did it was a bit patronising.

That you for your input.
  • 0

#54 Oerg866

Oerg866

    The dense kraut(tm)

  • Member
  • 231 posts
  • Gender:Male
  • Location:Frankfurt

Posted 29 April 2011 - 09:01 PM

. Trash .

Edited by Oerg866, 01 May 2011 - 01:38 PM.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users