The strings you print with syscall 4 need to be ASCIIZ, i.e. ASCII with a zero terminator. So you need to store a byte with the value zero after the last character in each string. And to be able to store that extra byte, you need to reserve one additional byte for each string (i.e. … Read more
The complete memory addressing mode format in AT&T assembly is: offset(base, index, width) So for your case: offset = 0 base = ebx index = eax width = 4 Meaning that the instruction is something like: eax = *(uint32_t *)((uint8_t *)ebx + eax * 4 + 0) In a C-like pseudocode.
AVX-2 @HadiBreis’ comment links to an article on fast population-count with SSSE3, by Wojciech Muła; the article links to this GitHub repository; and the repository has the following AVX-2 implementation. It’s based on a vectorized lookup instruction, and using a 16-value lookup table for the bit counts of nibbles. # include <immintrin.h> # include <x86intrin.h> … Read more