看了几篇博客不知道 org 到底有什么用,实际测试下就了解了~
x.asm
start:
mov ax ,label
label:
nop
nasm x.asm -o x
b804 0090
ndisasm -o 0x0 x > dx.asm
00000000 B80400 mov ax,0x4
00000003 90 nop
y.asm
org 0x02
start:
mov ax ,label
label:
nop
nasm y.asm -o y
b805 0090
ndisasm -o 0x02 y > dy.asm
00000002 B80500 mov ax,0x5
00000005 90 nop
看出 org 会影响 相对偏移量