Bennett
Bennett

Reputation: 1107

impossible combination of address sizes and invalid effective address on simple operation

I have some assembly, the following lines of which are causing nasm to complain about impossible combination of address sizes and invalid effective address:

mov [rbp], eax
mov [rbp - 4], eax
mov edi, [rbp]
mov esi, [rbp - 4]
mov edi, [rbp - 8]
mov [rbp - 8], eax

Why is this?

Upvotes: 1

Views: 1632

Answers (1)

Bennett
Bennett

Reputation: 1107

Stupid mistake, pointed out by Michal Petch.

Forgot to add the -f macho64 flag (-f elf64 on Linux).

Upvotes: 1

Related Questions