Live data from Hacker News

Floppy Bird: A Flappy Bird clone in 16-bit x86 assembly

github.com

1–10 of 73 posts

Re: Floppy Bird: A Flappy Bird clone in 16-bit x86 assembly

#3
post #2

This is really cool. Is there a practical reason why you would write a game in assembly (speed? portability?)

Assembly is about as nonportable as you can get. Hardware access (not exposed by other languages), speed, and possibly executable size are the practical reasons one would write in assembly. The second and third are almost entirely outdated - storage of executables is free relative to storage of data; hardware speeds have made "slow" programs plenty fast for most things; and compilers can do better than you can quickly do, very quickly. The first is still a valid reason to use assembly, but typically in the form of a small snippet of inline assembly in C/C++ code.

Re: Floppy Bird: A Flappy Bird clone in 16-bit x86 assembly

#4
post #2

This is really cool. Is there a practical reason why you would write a game in assembly (speed? portability?)

Assembly is about as nonportable as you can get. Hardware access (not exposed by other languages), speed, and possibly executable size are the practical reasons one would write in assembly. The second and third are almost entirely outdated - storage of executables is free relative to storage of data; hardware speeds have made "slow" programs plenty fast for most things; and compilers can do better than you can quickl…

Thanks for the in-depth answer. Was there a hardware access issue here, or did you just write this for the challenge/practice?

Re: Floppy Bird: A Flappy Bird clone in 16-bit x86 assembly

#5
post #4

Earlier quoted context omitted.

Assembly is about as nonportable as you can get. Hardware access (not exposed by other languages), speed, and possibly executable size are the practical reasons one would write in assembly. The second and third are almost entirely outdated - storage of executables is free relative to storage of data; hardware speeds have made "slow" programs plenty fast for most things; and compilers can do better than you can quickl…

Thanks for the in-depth answer. Was there a hardware access issue here, or did you just write this for the challenge/practice?

I didn't write this at all, but I assume it was just for hack value, much like the myriad 2048 clones.

Re: Floppy Bird: A Flappy Bird clone in 16-bit x86 assembly

#7
post #2

This is really cool. Is there a practical reason why you would write a game in assembly (speed? portability?)

The person who wrote this wrote it to be booted directly from BIOS. That means it must handle everything an OS would otherwise do for it: bootloader, resource management, hardware access, random number generation, etc. So a project like this has great value as an introduction to low level systems and OS development.

Re: Floppy Bird: A Flappy Bird clone in 16-bit x86 assembly

#8
post #2

This is really cool. Is there a practical reason why you would write a game in assembly (speed? portability?)

Assembly is about as nonportable as you can get. Hardware access (not exposed by other languages), speed, and possibly executable size are the practical reasons one would write in assembly. The second and third are almost entirely outdated - storage of executables is free relative to storage of data; hardware speeds have made "slow" programs plenty fast for most things; and compilers can do better than you can quickl…

Well, in the embedded system field Assembly is still pretty much used everywhere, I think you are talking about doing asm for the regular PC.

http://spectrum.ieee.org/static/interactive-the-top-programm...

Re: Floppy Bird: A Flappy Bird clone in 16-bit x86 assembly

#10
post #6

This is just beautiful: https://github.com/icebreaker/floppybird/blob/master/src/mai... Nicely structured code! I'm almost tempted to port it to amd64, just for fun. After all we really don't need any more x86/16bit example code, we need more amd64 code! :-)

Almost Forth like. That should be read in schools.
Post reply on HN