Views: 827,237,955
13 users online: Amine Retro, Darkwoon,  Deeke, ExONightZ, Golden Yoshi, Kortizas, Medic, Nowieso, Ramenoodles, Robju, Sping bot, ToxicRave, Wilson12 - Guests: 58 - Bots: 76 Users: 44,235 (2,532 active)
Latest: YourBoi
Tip: Press F2 on the level editor to see sub-screen boundaries. This will help you avoid glitching Dragon Coins by putting them on the sub-screen boundaries.Not logged in.
65c816 compiler resources?
Forum Index - SMW Hacking - SMW Hacking Help - ASM & Related Topics - 65c816 compiler resources?
Pages: « 1 »
I've been meaning to exercise myself to be sure to master the concepts depicted in Ersanio's SNES general asm book.

In order to do so, I would like to know whether I can test small lines of code without having to insert them into SMW?

If such an "assembler" or "executioner" exists, I would be able to access addresses, try some LDA/STA; debug some branching, etc.

Actually I have found this page
and this other one full of ASM assemblers (direct access ctrl+F 65816), but I'm not too sure which one does that. Or maybe I could just try and execute code in asar?

Thanks in advance.

It's a bit different, but this page contains an online 6502 assembler. 6502 was the assembly language used for the NES and is largely similar, with the main difference just being the lack of 16-bit modes. To use, you can write to the screen using addresses $0200-$05FF; each byte in that range represents one pixel of the display.

There's not really any other option, though, as 65c816 on its own doesn't actually do anything visually. You need to feed data from the code to various regions on the actual SNES (VRAM, OAM, CGRAM, etc.) to actually get it to display things. This is why it's generally much easier to learn 65c816 by using an existing game as a base, because otherwise you need to learn how all the internals of the SNES work before you can actually test anything.

If you want to debug and test things using an existing game, I would recommend learning how to use bsnes plus, which is an emulator that contains a variety of debugging tools, including the ability to step through code instruction by instruction and manipulate the state of the registers and memory as that runs.

Professional frame-by-frame time wizard. YouTube - Twitter - SMW Glitch List - SMW Randomizer
Ah, yes, bsnes plus is mentioned in Ersanio's book.
I'll try the 6502 one then. It may be enough to get started with branches, jumps and conditionals I guess.
Oh! The examples are sick!
Thanks a lot!

Edit: note to myself that 5 ROL made in a row allow to swap nibbles and display the complete output with 2 pixels.
lda #$cd
sta $04cc
rol $04cc
rol $04cc
rol $04cc
rol $04cc
rol $04cc
sta $04cd
I see you're in the discord too. there, AlcaRobot (which is now interfaced by randombot999. it's complicated) has a command that lets you evaluate simple asm, called "!ar eval". You can use it like "!ar eval lda #$ff sta $12 ldx #$12 lda $00,x" (just a random example, not related to your thing). It doesn't emulate any of the SNES-specific parts of the CPU (i.e. the 43xx registers), but it's good for debugging general asm. it shows you the processor state before executing each instruction, so you can see what is going on pretty well. but for debugging smw/snes-specific things, you generally want an emulator with a debugger, like bsnes-plus which was suggested by thomas
Pages: « 1 »
Forum Index - SMW Hacking - SMW Hacking Help - ASM & Related Topics - 65c816 compiler resources?

The purpose of this site is not to distribute copyrighted material, but to honor one of our favourite games.

Copyright © 2005 - 2020 - SMW Central
Legal Information - Privacy Policy - Link To Us

Total queries: 16


Follow Us On

  • YouTube
  • Twitch
  • Twitter


  • Super Mario Bros. X Community
  • Mario Fan Games Galaxy