Settings

Theme

An interactive guide to x86-64 assembly – moving data

halb.it

144 points by halb 2 years ago · 7 comments

Reader

Joker_vD 2 years ago

> When we (humans using Hindu-Arabic numerals) represent numbers, we write the most significant value first, and continue in descending order.

Funny trivia: while the Arabs wrote the numbers exactly as we do, they actually wrote them in the opposite order, the least significant digit first, and continued in ascending order, because Arabic script is actually written right-to-left. We the Europeans borrowed the notation as it looked when finished being written, so it had the unfortunate side effect of switching to the unnatural big-endian order.

  • srean 2 years ago

    That indeed adds up. In old Sanskrit texts numbers are spelled out in words, units place first then the higher powers of tens. Arabs took the system but it had never occurred to me what caused the switch in endian order.

    • Cyder 2 years ago

      Your comment made me dig out my BHS, since i had not counted in Hebrew since my Masters 20 years ago. Biblical Hebrew also spells out numbers, but in a slightly mixed order of the 2 systems: six and forty thousand and five of hundreds (Num 1:21), nine and fifty thousand and three of hundreds ( 1:23 ).

  • halbOP 2 years ago

    That's pretty cool. I always thought that the big-endian way we write numbers feels backward, I guess that explains it

  • hsfzxjy 2 years ago

    The quoted sentence still holds for Arabics, as RTL language has different concept of "first" than LTR ones. :-)

TedHerman 2 years ago

So back in the 1970s I had a job working on an IBM mainframe computer. Not multicore, no cache or instruction pipeline that I was aware of. A coworker had the idea of writing a timer interrupt to see what kind of instruction was executing at the instance of the interrupt; eventually it accumulated tens of thousand of samples. What kind of instruction was most frequent, was it addition, multiplication, bit-logic, or what? If I remember correctly, at least 90% of the samples were moving data from one place to another (memory-to-memory, register to memory, memory to register, register to register). Computers don't "calculate" most of the time the way I had previously thought. They mostly just rearrange bits, copying this to that.

smartis2812 2 years ago

As somebody how tries to get into Assembly, I love this so much.

Thank you!

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection