I have this:
bits 16
global start
section .text
start:
add cx, 1234
With this Makefile:
test:
@nasm -f macho64 test.asm
@objdump -x86-asm-syntax=intel --full-leading-addr -d test.o
.PHONY: test
It prints:
% make
test.o: file format Mach-O 64-bit x86-64
Disassembly of section __TEXT,__text:
0000000000000000 start:
0: 81 c1 <unknown>
2: d2 04 <unknown>
Why does it produce the <unknown>
and not show the instruction here? Did I do something wrong? Still learning the very basics of machine code so sorry if it's obvious.
It seems to work fine in 32 bit mode:
bits 32
global start
section .text
start:
add cx, 1234
Outputs:
% make
test.o: file format Mach-O 64-bit x86-64
Disassembly of section __TEXT,__text:
0000000000000000 start:
0: 66 81 c1 d2 04 add cx, 1234