Ok So I'm trying to get a bit of sample code working so I did a little modification of a book example because in amd64 you can no longer use pushl, so I'm using pushq:
# cmovtest.s - An example of the CMOV instructions
.asciz "The largest value is %d\n"
.int 105, 235, 61, 315, 134, 221, 53, 145, 117, 5
movl values, %ebx
movl $1, %edi
movl values(, %edi, 4), %eax
cmp %ebx, %eax
cmova %eax, %ebx
cmp $10, %edi
addl $8, %esp
I have debugged and the seg fault occurs during the call to printf. Everything seems to function fine through the loop (all of the register values are what they should be). I guess I don't understand the magic going on with pushq enough to fix this myself. Any help would be greatly appreciated.
PS: This is being assembled on an amd64 Ubuntu with gas linking against ld-linux-x86-64.so.2