For the past couple of weeks I’ve taken a break from my RPG to develop this tool. It’s not finished but I think it’s good enough to share. Its main purpose is for asm debugging and finding performance bottlenecks, but it also makes grayscale development a bit easier.
Darn, sounds like a high DPI issue. I tried for a while but wasn’t able to figure out how to properly make SDL and emscripten work nicely with high DPI. So I’ve just disabled it for the web build. The sizing should be correct now but things will be a bit blurry – I’ll try to revisit it later.
Oh, I did a lot of assembly on the 6502 in the mid-80s. I have an electronic book on AVR assembly which I was slowly working through … unfortunately, have forgotten everything I knew and I just do not have the time to invest in it.
LDA, lDX, LDY, BMI, BNE, BPL … I still remember a lot of the 6502 instruction set. But then again, it only had about 50 instructions. It was the first, unintentional RISC chip. The Z80 had 600 or so codes - total 8bit CISC.
I’ve never so much as touched a real 6502, but I started writing a NES emulator once, so I have some experience with it.
(Technically the NES used a Ricoh 2A03/Ricoh 2A07, not a MOS 6502, but the only difference was the lack of a BCD mode.)
But a dozen different addressing modes!
(Half the reason I gave up on the emulator. The other half being the NES’s PPU.)
I’ve always found the choice of ‘branch on minus’ and ‘branch on plus’ to be odd naming choices (compared to e.g. ‘branch on negative set’ and ‘branch on negative clear’, or ‘branch on negative’ and ‘branch on positive’), but AVR followed suit with BRPL and BRMI.
Again, I have a bit of experience due to forays in emulator writing, and some general CPU research.
The Game Boy’s CPU, the Sharp LR35902, was a sort of hybrid of Z80 and 8080.
The tool is looking great I like the different colored symbols from elf and that you can click on calls/addresses. It would be great to have a symbol list and / or being able to search for a symbol in the disassembly.
I noticed that inthe simulator the buttons are ‘A’ and ‘B’ keys. Could ‘S’ be added as a redundant button for ‘B’
The desktop version can also intermix source code and assembly, objdump style. But since ELF only contains source file names, not the source data itself, the web version can’t do that. In the future I hope to load local var info for each stack frame as well as type info so global/local vars can be pretty printed…
Wow, nice catch!
New symbols window (click to jump to that symbol in disassembly)
Jump to function dropdown:
EDIT: Also ‘S’ is now an alternate input for the B button.
Thanks for adding the symbols and S key as alternate B button.
Also nice to see the symbols are sorted alfabetical and all labels can be listed. I often use a line asm volatile(“dbg:\n”); in my code to optimize / debug code so it will be easy to find in the sorted list.
Cool! there’s a desktop version too? and with even more features?
Something odd I noticed while I ran the helloworld FX example. When simulating it I noticed the text didn’t scroll. Looking into it, it looks like __do_copy_data doesn’t copy the data section to ram correctly. like the lpm r0,Z+ instruction only reads zeros?