Skip to content

Instantly share code, notes, and snippets.

@Alcaro
Last active April 19, 2018 17:17
Show Gist options
  • Save Alcaro/34b976f94cee8406d6803cd7a868c4a7 to your computer and use it in GitHub Desktop.
Save Alcaro/34b976f94cee8406d6803cd7a868c4a7 to your computer and use it in GitHub Desktop.
#run with:
# as --32 a.S -o a.o && ld -m elf_i386 a.o -o a.out && ./a.out; echo $?
.intel_syntax noprefix
.globl _start
_start:
vpbroadcastd %ymm0, DWORD PTR [p21] # requires AVX2
vpaddd %ymm0, %ymm0, %ymm0 # requires AVX2
vmovd %ebx, %xmm0 # "only" requires AVX
mov %eax, 1 # __NR_exit
int 0x80
p21: # vpbroadcastd takes a memory address for whatever reason
.long 21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment