I'm having trouble assembling two instructions: push [rsp] and movzx r12,ebx.
This is 64 bit on OSX with homebrew installed "NASM version 2.11.06 compiled on Nov 4 2014".
The assembler command line is:
nasm -f macho64 tst.asm -o tst.o
The errors are:
tst.asm:5: error: operation size not specified
tst.asm:6: error: invalid combination of opcode and operands
and the (minimal) source is:
%use smartalign
ALIGNMODE generic,32
BITS 64
section .text
push [RSP]
movzx R12,EBX
I really don't understand why the PUSH is not assembling. The MOVZX is a zero extend from 32b to 64b and the September 2014 Intel architecture manual, Vol. 1 5-29, says:
5.19 64-BIT MODE INSTRUCTIONS
MOVZX (64-bits) Move doubleword to quadword, zero-extension
FWIW, I can inline these instructions with Clang:
asm volatile("push [RSP]");
asm volatile("movzx R12,EBX");
begets:
## InlineAsm Start
push [RSP]
## InlineAsm End
## InlineAsm Start
movzx R12,EBX
## InlineAsm End