0

Would somebody care to explain how "Super Mario Bros." was released in 1985. But the DASM Assembler came out in 1987?

The 6502 Assembly language was introduced in 1975. How would you compile/convert Assembly code into machine code back then? Why wouldn't we just use that compiler instead of using DASM? How does that compiler compare to DASM? What are the differences?

TL;DR What did Nintendo use to compile their Assembly code? There's no way they wrote actual machine code, right?

3 Answers 3

7

TL;DR:

Your confusion might steam from not being aware that DASM is just one of many 6502 capable assemblers which most came way before DASM - and some much later, like CA65.


The Fine Print

Would somebody care to explain how "Super Mario Bros." was released in 1985. But the DASM Assembler came out in 1987?

There is no relation between Super Mario Bros. and DASM.

The 6502 Assembly language was introduced in 1975. How would you compile/convert Assembly code into machine code back then?

By using the cross assembler provided by MOS. That cross assembler did run on a GE timeshare system and was already available before the 6502 went to market. Cross assembler packages were as well offered for IBM mainframe and DEC PDP-11.

Heck, in some way we have returned to these times by using again cross assemblers like DASM, XA65 or CC65, haven't we?

Why wouldn't we just use that compiler instead of using DASM?

Well, shouldn't the question be rather "why using DASM?", as it is just one of many assemblers (and other tools) able to produce 6502 code. (*1)

How does that compiler compare to DASM?

Well, the first ones provided by MOS are rather primitive, something that is even visible in the syntax of basic 6502 instructions, as they are made to be compiled in a single run without much analysis needed.

Later assemblers added more tools to structure and modularize source code, macro capabilities, language/runtime linking and so on.

What are the differences?

Since there are literally dozens of 6502 capable assemblers (if not hundreds), any serious comparison would take a book of many pages, so a bit out of scope here. If there are really pairs of interest to you, maybe add a more specific page.

In general it ranges from Wozniaks Mini-Assembler build in the Apple II ROMs (1977) over similar but more sophisticated ones available for many 6502 machines of the late 70s/early 80s, over third party assemblers like LISA, some grew from simple to quite sophisticated, like Merlin, all the way to serious capable systems like CA65 or, IMHO the best of all, ORCA/M which gives almost mainframe like flexibility.

In this range DASM occupies a spot at the lower middle class. Its capabilities are rather limited, but it shines with a good documentation.

TL;DR What did Nintendo use to compile their Assembly code?

I'd says some tool chain of their own, were the assembler was only a tiny part of. Being a well funded company they did employ standard development systems, usually hosted on larger workstations running special cross assembler packages. Such systems do as well include ICE (In Circuit Emulation) debugging and alike, simplifying bug hunting a lot.

There's no way they wrote actual machine code, right?

Not really, who would? (*2)


*1 - DASM is not among the most capable. It might be fine for small projects, but as a professional, getting paid to do the job, I wouldn't use DASM for anything larger than a few pages - the same amount one writes Sunday afternoon using Notepad - if at all.

*2 - Then again, Wozniak did not only write all Apple 1 software, but as well the Apple II monitor and much of Integer BASIC by hand. But these were not only the very early times but as well at a time when Apple wasn't loaded with cash like now - to put it mildly.

6
  • Actually writing direct machine code for 6502 isn’t that arduous. While it’s unlikely that many if any significant projects were carried out that way, it’s far from impossible and if that’s what you have to do then that’s what you do. After reverse-engineering some 6502 code (in this case because the source had been lost) thinking in terms of assembler instructions or machine code become almost the same thing.
    – Frog
    Jan 17, 2021 at 19:47
  • @Frog all true - except that a useful assembler is so much more than a mnemonic to opcode translator.
    – Raffzahn
    Jan 17, 2021 at 21:37
  • Certainly, but it is possible to do everything by hand/on paper if there’s no other option. Qualitatively I’d say that the machine code to assembler step is about the same as the assembler to C step in terms of tool development.
    – Frog
    Jan 18, 2021 at 18:51
  • @Frog Hmm, not sure if I can follow, as I'd see assembler at about the same level as C when it comes to abstraction and programming support.
    – Raffzahn
    Jan 18, 2021 at 18:54
  • Maybe, perhaps I'm just better at it these days ;-)
    – Frog
    Jan 19, 2021 at 8:19
12

The Japanese children's book The Stars of Famicom Games includes pictures of Super Mario Brothers 3 development for the NES/Famicom. Code was written on an HP 64000 Logic Development System and cross assembled. See also: NES (Famicom) Development Kit Hardware

1
  • The HP64000 was certainly a beautiful piece of kit that I was lucky enough to use in the 80s. Jan 17, 2021 at 22:48
2

DASM is not the only 6502 assembler. It wasn't the first or last, either. Nintendo had their own in-house development system, which included an assembler among other tools. I'm sure that 3rd party developers used a variety of assemblers, as well. 6502 assemblers were widespread even on non-6502 platforms by the mid-80s, so it's doubtful anyone ever wrote significant amounts of direct machine code for the Famicom or NES.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .