Language…
12 users online:  AmperSam, DanMario24YT, drkrdnk, EvilAdmiralKivi, fsvgm777, Guido_Keller, JezJitzu, mmmdoggy, Scags, timothy726, Tomi P, Zavok - Guests: 265 - Bots: 313
Users: 64,795 (2,377 active)
Latest user: mathew

I renewed my ASM tutorial for the nth time and now it's 200% more pleasant to read through!

Misc. HackingResource ReleaseOther

  • Pages:
  • 1
  • 2


First, I'd like to say, Ersanio, that I've lost count of how many times I had read/re-read/passed through your ASM tutorial. Really, I learned pretty much everything that I know of the technical aspects and even based my workshop lessons and other texts on things you wrote. I have to say: your document is a clear example of how a document should be, even as a base for other texts. Concise, direct to the point explanations, simplicity of language, organized text... from a MS. researcher, I have to give to you: great work.

Now, I have two suggestions/additions you could make as is: first, Asar actualy comes with a .xml that, set in Notepad++, enables 65c816 syntax highlighting. Second, and this could be not necessarily a basic thing, but I feel it could be explained in the binary section: two's complement. Your tutorial already deals with complicated things in a programmer's point of view (let's be sincere here, assembly is a hard language already), and adding the two's complement would be a nice thing not only to know about it, but it has its applications in SMW, the most common one being sprite. That is, you would make it more clear for novices and even lower-intermediate coders why some speeds are in the range $80-$FF (the significance of the MSB when dealing with negative numbers). We could debate, too, the fixed point for more advanced lessons, albeit SMW uses them less (I can think about SMW's trigonometry routine and accumulated fraction bits for Mario and sprites' motions).

All in all, good work, Ersanio. You really contributed to help coders develop their abilities with this document.





Dream team (feed them, please):






This is incredible. What I like the most is that you explain ASM and its runtime behavior before you touch any of Asar's compile-time (assembly-time?) features. One of the most common mistakes I've seen beginners make is confusing ASM and Asar's directives (e.g. trying to use if or read1 with a RAM address), which is why I think it's so important to make the distinction clear not just with an explanation, but with the structure of the tutorial itself.

Is there a particular reason you use the term "bytecode" instead of "machine code"? In my experience, "bytecode" is more often an intermediate representation meant to be interpreted (e.g. Java bytecode or bytecode for Ignition in the V8 JS engine), while "machine code" is bytes that are directly run by the processor.

Something I'd add is a rule of thumb for cycle counting - each byte accessed costs a single cycle. An 8-bit LDA $7E0019 needs one cycle to read the opcode, three to read the address, and one to read the value at that address - or five total. AFAIK this isn't how the processor actually interprets the instructions, but it works well enough if you want a quick estimate.
Glad to see you still working on this, your tutorial is for sure one of the best resources both to start with asm and to delve into more advanced topics. I'm sure it has helped a lot of people (me included) so having an even better version is great.
Originally posted by Koopster
lol, I just read your entire tutorial like 2 weeks ago. I already knew some of the basics by reading up 65c816 manuals, but it definitely helped me situate myself on some stuff (notably the banks diagram, which I couldn't find anywhere else).

That banks diagram was something I drew up in paint real quick. I plan to replace it with a... better-looking image, soon. Of course, the exact memory mapping depends per cartridge but the one I use in the tutorial is the general consensus in SMW hacking.

Originally posted by Tahixham
Great to see you're still actively working on this sorta thing too #tb{:D}

To be honest, everytime I think I'm done with the tutorial, I just find something to improve about it. For me, it's a continuous process of learning new things. Not just in ASM, but everything around that context too. Writing tutorials, proofreading text, and so on.

Originally posted by WhiteYoshiEgg
Skimming over it, this looks like a really well-written tutorial, and coming from you, why wouldn't it be. You can be sure this is where I'll point newbies to from now on.

Also, I just *love* how professional this looks! I love thinking about writing tutorials, and Gitbook (hadn't heard of it before) is a service I definitely need to keep in mind for that.

Thanks, that's awesome to hear!

And well, I'd say don't think too much about it. Rather, just writing down a few words or topics and slowly work on it. The most important part is that you get started at all.

Originally posted by imamelia
Nice. Even though I already know all this stuff, I'm reading through it just for fun. Do you need a proofreader to catch typos and grammar errors?

Thanks for the offer. It's all good for now; maybe once I consider the tutorial to be complete/non-WIP.

Originally posted by Major Flare
from a MS. researcher, I have to give to you: great work.

Now, I have two suggestions/additions you could make as is: first, Asar actualy comes with a .xml that, set in Notepad++, enables 65c816 syntax highlighting. Second, and this could be not necessarily a basic thing, but I feel it could be explained in the binary section: two's complement. Your tutorial already deals with complicated things in a programmer's point of view (let's be sincere here, assembly is a hard language already), and adding the two's complement would be a nice thing not only to know about it, but it has its applications in SMW, the most common one being sprite. That is, you would make it more clear for novices and even lower-intermediate coders why some speeds are in the range $80-$FF (the significance of the MSB when dealing with negative numbers). We could debate, too, the fixed point for more advanced lessons, albeit SMW uses them less (I can think about SMW's trigonometry routine and accumulated fraction bits for Mario and sprites' motions).

MS. researcher, as in, Microsoft researcher? I sort of got the inspiration from Microsoft Docs, when I was looking around the documentation for one of my projects. It was just so easy to navigate to places, I thought my tutorial should have that as well.

I didn't notice asar has the XML file. I'll definitely mention it in my tutorial. As for the two's complement, I do mention "signed" and "unsigned" values in the hexadecimal chapter, although not super in-depth.

Originally posted by Telinc1
This is incredible. What I like the most is that you explain ASM and its runtime behavior before you touch any of Asar's compile-time (assembly-time?) features. One of the most common mistakes I've seen beginners make is confusing ASM and Asar's directives (e.g. trying to use if or read1 with a RAM address), which is why I think it's so important to make the distinction clear not just with an explanation, but with the structure of the tutorial itself.

Is there a particular reason you use the term "bytecode" instead of "machine code"? In my experience, "bytecode" is more often an intermediate representation meant to be interpreted (e.g. Java bytecode or bytecode for Ignition in the V8 JS engine), while "machine code" is bytes that are directly run by the processor.

Something I'd add is a rule of thumb for cycle counting - each byte accessed costs a single cycle. An 8-bit LDA $7E0019 needs one cycle to read the opcode, three to read the address, and one to read the value at that address - or five total. AFAIK this isn't how the processor actually interprets the instructions, but it works well enough if you want a quick estimate.

I can understand the confusion. This is why I have dedicated a (new) chapter just for the most commonly used asar directives, such as getting a table's size and using compile-time math.

To be honest, I do not know why I went for bytecode when in the glossary I also mention it's "machine code". I'll just change it to machine code instead. I'm not too much into low level programming languages actually, so it could be that some of my terminologies are a bit off. I'll fix this.

That rule of thumb is pretty interesting. I'll add it to the tutorial for sure.


Thanks everyone for the kind words and feedback so far! Once again, I got shown that this tutorial is super helpful and valuable in the community, so I'll do my best to keep it as good as possible.
My blog. I could post stuff now and then

My Assembly for the SNES tutorial (it's actually finished now!)
I learned asm using your really old word document and still use it occasionally to look stuff up.
This update looks pretty nice and in comparision to the word version the code is much easier to destinguish from the normal text.
I don't know if this change happend before, the version I have is 2.2 but thanks for the update #tb{XD}
My Youtube channel

Currently working on:
Project C

Finished project:
Originally posted by Ersanio
That rule of thumb is pretty interesting. I'll add it to the tutorial for sure.

I have actually a bit about cycle counting that today, albeit pretty in-depth.
Either way, cycle counting is pretty interesting. On paper, it looks pretty simple (fetch, execute, read, store) but as certain operations are processed in paralled and how much the CPU actually saves cycles, it does make counting cycles a bit more difficult. Example: Why single byte opcodes still take two cycles or how a single cycle can be saved with absolute indexed which would otherwise take 5 (8-bit A).
This is... pretty impressive! #ab{O.O}
An ASM tutorial with, like, pages and sections and stuff? Could have only dreamed of that back in our days!

This looks really nice and should be really helpful for newbies.

As for a feature suggestion: How about adding some kind of "API reference" to the guide? The term is a bit missleading, but what I mean by that is simply a page that lists all existing opcodes with a bit of information on them. I don't often read tutorials, but something I do very frequently when programming is to simply look up functions/API documentions, or in the case of ASM, opcodes. Would be really useful to have that in an easy-to-read and easy-to-search format. Extra points if you make all of them link back to the respective sections of the tutorial that explain them.
Feel free to visit my website/blog - it's updated rarely, but it looks pretty cool!
This is great! It's like the old days but with less frustration :D

allow shy guy emojis in post footers you cowards!
I could never be bothered with ASM but its great to see a revamped tutorial! This will certainly make it easier for newcomers to learn ASM.
Great tutorial! #smw{:TUP:}
I advantage and clarified some doubts about MVN and MVP.
pretty useful guide! love the way you wrote everything out


My Favorite Nu-Metal Albums For You!! (Spotify Links).

W3Schools W3Schools W3Schools W3Schools W3Schools W3Schools


As Of 1/28/2024.

Your original tutorial is how I learned to ASM back in the day, glad to see you are still around giving it an update. ^_^
Layout by LDA during C3.
Man, after having to keep tabs on a bunch of older ASM tutorials and documents, I'm glad there's finally a good starting point. I mean it's 2020 for heaven's sake, we needed this by now. I'm greatful for your efforts!
Want progress on 100 Rooms of Enemies: The Nightmare Edition? Go here to see.

(rip my other userbars momentarily)

Thanks for the tutorial! I was looking for something like this the other day!
Reconstructing the ASM tutorial, huh? Great job on working on this, Ersan! Keep up!
The Hacking of PuyoPuyo. Come join the fun, friends. 『いけいけ団長、頑張れ頑張れ団長!』
Help us raise funds for the Armed Forces of Ukraine. #ДопомагаємоРазом / #HelpTogether
“Even if you personally are so dissatisfied with life that you want the world to end, surely the cruel reality is that it will continue on, unchanging. All the better for someone perfectly content, like me.”
Aya Shameimaru, Touhou Suzunaan ~ Forbidden Scrollery
Oh this is excellent. Something that always made it hard for me to use tutorials back in the day was that they were just basically a .doc file you had to scroll through. I'm going to have to go through this sometime to push my ASM beyond "looking at a list of opcodes and hoping that what I write works"
Some suggestions: looking at the hex2asm opcode info, some of the stack-related opcodes besides PLP unexpectedly (as in, the user may not know that PLB affects the negative and zero flag flag) affect the processor flags:
Code
OP LEN CYCLES      MODE      nvmxdizc e SYNTAX
-- --- ----------- --------- ---------- ------
8B 1   3           imp       ........ . PHB
0B 1   4           imp       ........ . PHD
4B 1   3           imp       ........ . PHK
08 1   3           imp       ........ . PHP
AB 1   4           imp       *.....*. . PLB
2B 1   5           imp       *.....*. . PLD
28 1   4           imp       ******** . PLP

Give thanks to RPG hacker for working on Asar.
  • Pages:
  • 1
  • 2

Misc. HackingResource ReleaseOther