Jump to content
  • Advertisement
Sign in to follow this  
john13to

The programming language in NES games

This topic is 4000 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Which language did the programmers use back in those days when they developed NES games? Was it perhaps C, Assembler or BASIC?

Share this post


Link to post
Share on other sites
Advertisement
I'm pretty sure it was all assembler, but I dont have a source to back me up ;)

Share this post


Link to post
Share on other sites
In general, the NES was programmed in 6502 assembly. Might want to check out NESDev for more.

The 16-bit consoles were also generally programmed in their native assembly languages, but later on I'm sure there were at least some games written in C.

Share this post


Link to post
Share on other sites
In General it was Assembly Language. 6502 asm on the NES and Atari, 65816 on the SNES (A 16bit superset of the 6502), 68000 on the Genesis and z80 on the Master system, Gameboy and GameGear.

The primary reasons to use Assembler include Speed and Instruction density, but more importantly, total control over which trade-off was made at what time. These early systems dealt with two main limitations: Speed and program memory. A relatively average NES game contained two ROM chips, a 128KB chip containing the program and constant data such as maps and music, and another 128KB chip containing the graphic tiles used by the game. 128KB is not a lot of room, so it was important that code which was not performance-critical was optimized for size, rather than speed. On the flip-side of that coin, performance-critical code could be written using the fastest possible instructions instead.


On the later systems like the SNES and Genesis, C was used to some extent. Remember, C is essentially platform-agnostic assembly, most things in C map 1-to-1 with most processors. That said, the 65816 (and 6502) was not particularly well suited to compiled languages because of the limited amount of registers, "16+8" address bus, and a somewhat un-orthogonal instruction set. The 68000 in the Genesis, on the other hand, with it's 16 32-bit registers, true 24bit address bus and highly orthogonal instruction set, was much more easily exploited by compilers and so C was more common there, though still usually eschewed for performance-critical code.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!