Live data from Hacker News

Ask HN: What are some examples of beautiful x86 assembly code?

news.ycombinator.com

61–70 of 93 posts

Re: Ask HN: What are some examples of beautiful x86 assembly code?

#61
post #26

Earlier quoted context omitted.

No, loop decrements rcx until it reaches zero and then stops

But rcx has not been initialised.

The code above I believe is the point to jump to when the register has been assigned some value for x. Think along the same lines as a function call once the pre-amble is out of the way (or a ‘goto’ by someone who knows when to use it!)

Re: Ask HN: What are some examples of beautiful x86 assembly code?

#64
post #47

The coolest one liner is xor eax,eax :) 1 cycle for setting register to 0.

Yeah, but with the side effect of clearing the flag registers. So can't be used between operations that rely on flags. Alternatively it is great to break false flag dependency.

Re: Ask HN: What are some examples of beautiful x86 assembly code?

#67
not quite the assembly, but you may look at small intros at https://www.pouet.net/prodlist.php of sizes 32 bytes and so on.

many intros are provided with source codes, and others could easily be viewed in disassemblers.

especially look at intros by such brilliant people like Digimind and Řrřola.

Re: Ask HN: What are some examples of beautiful x86 assembly code?

#68

Pokémon! GBA (ARM7) is even being used in some undergrad level OS classes. Although you may get more mileage out of RP3 development. disassembly of Pokémon Red/Blue https://github.com/pret/pokered TONC GBA Programming Principles https://www.coranac.com/tonc/text/toc.htm

Red and blue are gbc (z80-like, not ARM).

GB was Sharp LR35902. Similar but not quite an z80 or x80.

https://realboyemulator.wordpress.com/2013/01/02/the-nintend...

Post reply on HN