From: H. P. A. <hp...@zy...> - 2013-08-05 20:56:12
|
On 08/04/2013 02:34 PM, Frank Kotler wrote: > Sorry to bother you guys again, but I wonder if anyone has time to look > at this: > http://forum.nasm.us/index.php?topic=1691.new#new > > In short, "-f macho64" is generating an error about 32-bit addresses. > "-f elf64" and "-f win64" seem to work. I can't see anything wrong with > the guy's code. Adding "bits 64" or "use64" as a section attribute seem > not to help... Help! > > Best, > Frank > default rel global _start _start: mov al,'*' mov byte [Msg+rsi],al ; ERROR The problem is that Msg here isn't PC-relative since it has an index. This is presumably illegal in MachO64. Instead he should: lea rdi,[Msg] mov [rdi+rsi],al Note lea, not mov... -hpa |