# #.global call_other #call_other: # call *%rdi # ret # Sneaky version of call other that calls all three! .global call_other call_other: push %rdi call *%rdi pop %rdi add $22, %rdi push %rdi call *%rdi pop %rdi add $22, %rdi call *%rdi ret test_string: .asciz "termite mayfly grub mealworm" .global try_count_bugs try_count_bugs: mov %rdi, %r8 mov $test_string, %rdi call *%r8 ret .global return_arg return_arg: mov %rdi, %rax ret .global call_functions call_functions: push %r12 push %r13 mov %rdi, %r12 mov %rsi, %r13 looptop_cf: call *(%r12) add $8, %r12 dec %r13 cmp $0, %r13 jne looptop_cf pop %r13 pop %r12 ret