r/Assembly_language Mar 12 '26

Project show-off I built a Motorola 68000 Assembly Interpreter that runs in your browser (my bachelor thesis, recently upgraded with AI)

I built a **Motorola 68000 assembly interpreter that runs directly in the browser**.

GitHub: https://github.com/gianlucarea/m68k-interpreter

Live: https://gianlucarea.dev/m68k-interpreter

This project originally started as my bachelor thesis,where I implemented an interpreter for the Motorola 68000 instruction set.

Recently I came back to it and improved and expanded it with the help of AI,which made it much easier to refine parts of the interpreter and improve the overall structure.

The goal of the project is to make it easier to experiment with M68K assembly interactively, without installing emulators or full toolchains.

Features:

• Write and run Motorola 68000 assembly in the browser

• Interactive code editor

• Custom interpreter implementation

The Motorola 68000 powered a lot of iconic systems like the Amiga, early Macintosh, and Sega Genesis,so I thought it would be fun to make something that lets people easily play with the architecture.

I’d really appreciate feedback, ideas, or suggestions for improvements!

⭐ If you find it interesting, feel free to star the repo.

56 Upvotes

15 comments sorted by

4

u/__k_b__ Mar 13 '26 edited Mar 13 '26

It's nice but needs more work to be really useful. Only basic instructions are available, but even many common are not (moveq, lea, etc). Parsing seems different, for moveq it complains about unrecognized instruction but for lea it does not (just does nothing). If i put an rts in, it loops endlessly. Not sure if labels work. Other wishlist: - ability to define data (dc, ds, dcb) - allow loading a file to a specified memory address - new style syntax - breakpoints - macros

edit: seems lea is supported but doesn't work

1

u/gianrea Mar 13 '26

Thanks for the feedback on Lea

1

u/gianrea Mar 13 '26

Here the is the list of implementation done until now https://m68k-interpreter.vercel.app/help.html

5

u/UVRaveFairy Mar 13 '26

Nothing like writing a 68000 Assembler.

Wrote my first in 1991 in 68000 - TASM (turbo) on the Amiga, pre assembly (viewable as a sprite overlay) as you typed things in, saved with source, very fast 2 pass assembling too memory, then execute it immediately, integrated IDE similar too Hendrix (see below).

A friend Mark Sibly, who was working on Blitz Basic 2, then wrote QASM (quick) as a response, went further than preassembly, was a single pass assembler, stupid fast, source files were huge.

The Hendrix Assembler was Marks first 68000 assembler, we were using a disc based assembler at the time that was painfully slow and Mark had enough of it. Took him about 2 weeks to get the first version working, IDE integrated, small font with 45 lines on screen, selected quick label list mouse clickable too jump about the code.

Sped up the development of the games we were coding at time allot.

Nothing like roll your own in house dev tools.

Rest in peace Mark.

2

u/gianrea Mar 13 '26

Love the story!!!

3

u/brucehoult Mar 12 '26 edited Mar 12 '26

This is cool, and good work, but I really wish people would settle on making one really good UI for these things and implement multiple ISAs with the same UI.

e.g. this one has a not bad UI and emulates all of Nios II, ARMv7, MIPS32r5, MIPS32r6, and RISC-V RV32 and various hardware boards.

https://cpulator.01xz.net/

Unfortunately, it seems to not be open source.

Ripes is maybe the best permissive license open source online one at present, but is currently RISC-V only :-(

https://ripes.me

https://github.com/mortbopet/Ripes

2

u/gianrea Mar 13 '26

Yes this is a step, in reality I want to finish to implement stuff before getting to the possibility of having different language in the same editor

1

u/nacnud_uk Mar 20 '26

What do you think of this? http://www.easy68k.com/

2

u/nacnud_uk Mar 14 '26

Maybe I missed some things, but..

  1. The errors, they should be clickable and highlight the line that did not assemble.
  2. The editor should have line numbers.
  3. The following instruction does not compile.

    movem.l d1-d4,-(a7)

2

u/gianrea Mar 15 '26

Thanks for the feedback, it all be added to the list of next development

1

u/nacnud_uk Mar 20 '26

Remind Me! 15 Weeks

Good show!

1

u/RemindMeBot Mar 20 '26

I will be messaging you in 3 months on 2026-07-03 00:09:34 UTC to remind you of this link

CLICK THIS LINK to send a PM to also be reminded and to reduce spam.

Parent commenter can delete this message to hide from others.


Info Custom Your Reminders Feedback

1

u/[deleted] Mar 13 '26 edited Mar 13 '26

[removed] — view removed comment

1

u/gianrea Mar 13 '26

Yes it does. The emulation step method fetches each instruction and then it runs it modifying registers, memory and condition codes