Game development with assembly. Where to start?

Started by
22 comments, last by MarkS_ 8 years, 5 months ago

Hello,

For the past few days I have been learning assembly and I was wondering how to display graphics on the screen.

I'm doing this just for fun because I feel like I'm starting to burn out on my main game project and I thought I would do something fun like learn assembly. However displaying text on a console wasn't very exciting for me. So I'm taking it to the next level.

So, does anyone know how to start game development with assembly?

thanks happy.png

Advertisement

...something fun like learn assembly. However displaying text on a console wasn't very exciting for me.


Writing assembly doesn't get much more exciting than that! It does get more tedious and much more difficult, however. You do graphics in the exact same way as you'd do it in C - just with more effort to manage the same data and make the same calls.

If you want to have fun with assembly, you should try reverse engineering and modifying other people's programs instead.

I'm not entirely sure about game dev in assembly, but I do know that rollercoaster tycoon was made in assembly except for the parts to interface with windows and directx. My guess would be that you have to do something along those lines.

Alternatively, make a game using ascii art?

You use the same APIs you would use from C or C++. You'll need to properly prototype the functions you want to call, then call them according to their calling convention. There are some simple examples at this page.

You might also want to browse through this series. It's quite old (I can't believe it's been 16 years! I didn't expect it would still be online), but it should still be full of useful info.


I'm doing this just for fun because I feel like I'm starting to burn out on my main game project and I thought I would do something fun like learn assembly. However displaying text on a console wasn't very exciting for me.

C/C++ is actually a perfect tool to learn assembly. You may write methods within C++ source using an assembly functions; or write assembly function is separate *.asm file and link with C++ project (need to understand well the convention to transfer parameters). The problems where writing in assembly makes a practical sense is some bit-juggling algorithms where each CPU cycle is absolutely critical to ensure max performance; once you deal with bytes/words etc... the algorithms implemented in C is often more efficient, the more complex algorithm the more advantage C code may have; modern C compilers do a marvelous job to optimize... BUT to write a performance optimal C algorithms you must have a good idea how it is translated to assembly so assembly listing of C++ code is a paramount to have during such performance-critical-development. You may gain a way more performance improving/inventing algorithms; it is a major method to make things run faster. Once algorithm is perfected you may consider to implement/optimize some tiny parts in assembly... Another area where assembly makes sense is to write some performance optimized standard calls; for example, setjump/longjump to return back to root level from a deep recursion can be times faster then standard equivalents (as soon as the compromises/limitations of such fast implementation are well understood). Anyway, writing/understanding in/assembly is really a fun and very useful (actually, it's a critical skill) to get maximum performance; but writing all project in assembly makes no practical sense...

I'll throw in my recommendation: http://www.nand2tetris.org/

I think, therefore I am. I think? - "George Carlin"
My Website: Indie Game Programming

My Twitter: https://twitter.com/indieprogram

My Book: http://amzn.com/1305076532

Great !

well thanks everyone happy.png

Have you considered old school game programming ie vga based game? Or homebrew development for the GBA?

Another hobby thing you could look into is SIMD coding using intrinsics.

-potential energy is easily made kinetic-

Are you trying to learn asm or just take a rest from your project? If this is just for short distraction then try something completely else ( I did that and keep coming back to it, also just for fun) - write something for any of old 8 bit consoles or computers. My favourite is Atari 2600 VCS and 6502 assembler language (look for Stella emulator, it's not only emulator, it's very sophisticated and full featured debugger! If only developers could have such tool in 80s ;)). VCS is very simple in terms of architecture, but because of constraints incredibly challenging (today if feels like solving a puzzle rather than making a game;)). This will not teach you any modern assembler, but will show you basics of ANY asm. For many years rules didn't change, while knowing 6502 you will be able if not write, then at least read modern asm code. It may appear very handy during debugging mysterious issues.

This topic is closed to new replies.

Advertisement