Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Super Mario Bros. is definitely the most famous videogame created yet, selling a scorching 40.23 million copies.

What programming language was it written in? Does anyone have some original code reference?

share|improve this question

closed as not constructive by Nicol Bolas, doppelgreener, Le Comte du Merde-fou, Noctrine Nov 22 '12 at 19:23

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

I get the feeling a lot of the old NES games were written in machine-specific assembly. – meagar Dec 2 '10 at 15:40
possible duplicate of How were 8-bit and 16-bit games developed? – user744 Dec 2 '10 at 16:34
Not a duplicate, as this one asks for specific code samples from a specific game. – AttackingHobo Dec 2 '10 at 20:00
I don't see the value in having many "What language was X written in?" questions, no matter how notable X is, unless it was notable because of the development platform. Also, it's asking for specific code samples of a game still under copyright (and still being sold) with no intentional source availability. – user744 Dec 2 '10 at 22:11
@Toad: Yes, but you generally don't have the right to post it online, or to download a copy (even if you own the game yourself), or to make derivative works based off your own reading of the code. – user744 Dec 3 '10 at 9:51

6502 Assembler

Here is a forum page about hacking the ROM.

It should contain any code references you need as well.

A few posts down there is a link to a zip file that contains these items needed to edit/hack the game.

  • ca65 - a 6502 assembly compiler from
  • ld65 - a 6502 linker from
  • smbdis.asm - a comprehensive Super Mario Bros. disassembly
  • smb.chr - Super Mario Bros. graphics (character ROM data)
  • smb.hdr - Super Mario Bros. ROM header (iNES header)
  • MAKESMB.BAT - a batch file I made that automates the compilation process.
  • 6502jsm.doc - a summary of 6502 instructions.
share|improve this answer
Wow, perfect answer! Kudos – DFectuoso Dec 2 '10 at 19:00
I'm confused by this answer myself. You're basically pointing to an executable (the ROM) and claiming that it was written in assembly... because it was disassembled. It's an executable; of course it can be disassembled. By this logic, every C/C++ program ever written was actually written in assembly. To prove that this was written in assembly, you need to actually show that Nintendo wrote it in assembly, not that you can disassemble the executable binary. – Nicol Bolas Nov 22 '12 at 20:18

Almost all NES games were hand-written in 6502 assembly, the same as used in the Commodore 64, the Apple ][e, etc. The very few which were written in C had a reputation for being terribly slow because the NES is only 2Mhz and has 2Kb of onboard RAM (with an 8Kb window for the cartridge to patch more in). Careful assembly designed to take full advantage of the NES's peculiar architecture was much more effective.

Stop and think about that... games like Super Mario Bros 3 and Kirby's Adventure ran on 2Mhz. Compare how rich they are to today's games which swallow gigahertz and hundreds of megabytes of RAM...

share|improve this answer
+1 gameplay > everything else – o0'. Dec 3 '10 at 13:48
@Lohoris I just logged in to up-vote that comment. And to my surprise, I already did – NSAddict Nov 19 '13 at 15:43
@NSAddict wow, thank you! – o0'. Nov 19 '13 at 15:50
What's an example of a licensed NES game that was written in C? – tgies May 19 '15 at 15:51
[citation needed] – Almo Jan 7 at 15:06

Not the answer you're looking for? Browse other questions tagged or ask your own question.