Manipulating bits for fun [..and profit..?]

For years I’ve understood assembly enough to get by with debugging and disassembling when needed; I finally decided it was time to learn to write.

The world of the computer language is intriguing, easy and frustrating all at the same time. Here are two equivalent pieces of code, they do the two very simple things in slightly different ways.

The first I wrote interpreting from a higher-level language that I can read & write (C); the second was the code rewritten to be more compact.

Why?  I don’t know… just because….  at what point would I ever use this newly acquired(ing) skill for something valuable…  I guess we’ll see…

assembly code