ABIs are weird. If a function can accept six pointers on general-purpose registers, and eight floating-point arguments on FP registers, it should be able to return as many, dammit! Instead, we can't even return an integer and a float on separate registers simultaneously ๐Ÿ˜ญ

Also the perfectionist's nightmare that is the selection of GPRs in AMD64 calling convention on Linux. The six integer arguments go in rdi-rsi-rdx-rcx-r8-r9.

memcpy's arguments are therefore dst:rdi, src:rsi, count:rdx.

Meanwhile, REP MOVSB takes rdi as destination, rsi as the source, and... rcx as the count.

0

If you have a fediverse account, you can quote this note from your own instance. Search https://mastodon.gamedev.place/users/amonakov/statuses/114687883434151395 on your instance and quote it. (Note that quoting is not supported in Mastodon.)