2017-02-20 18:39:56 +08:00
|
|
|
bits 32
|
|
|
|
foo: ; Backwards reference
|
|
|
|
mov eax,[foo - $]
|
|
|
|
mov ebx,[ebx + foo - $]
|
|
|
|
mov ecx,foo - $
|
|
|
|
mov edx,foo - bar
|
|
|
|
|
|
|
|
mov eax,[bar - $]
|
|
|
|
mov ebx,[ebx + bar - $]
|
|
|
|
mov ecx,bar - $
|
|
|
|
mov edx,bar - foo
|
|
|
|
|
|
|
|
mov eax,[baz - $]
|
|
|
|
mov ebx,[ebx + baz - $]
|
|
|
|
mov esi,[baz - bar]
|
|
|
|
mov ecx,baz - $
|
|
|
|
mov edx,baz - bar
|
|
|
|
|
|
|
|
bits 64
|
|
|
|
default rel
|
|
|
|
|
2017-02-21 05:06:02 +08:00
|
|
|
times 16 nop
|
|
|
|
|
2017-02-20 18:39:56 +08:00
|
|
|
mov eax,[foo]
|
|
|
|
mov eax,[foo - $]
|
|
|
|
mov eax,[abs foo - $]
|
2017-02-21 05:06:02 +08:00
|
|
|
mov ebx,[rbx + foo - $]
|
2017-02-20 18:39:56 +08:00
|
|
|
mov ecx,foo - $
|
|
|
|
mov edx,foo - bar
|
|
|
|
|
|
|
|
mov eax,[bar]
|
|
|
|
mov eax,[bar - $]
|
|
|
|
mov eax,[abs bar - $]
|
2017-02-21 05:06:02 +08:00
|
|
|
mov ebx,[rbx + bar - $]
|
2017-02-20 18:39:56 +08:00
|
|
|
mov ecx,bar - $
|
|
|
|
mov edx,bar - foo
|
|
|
|
|
|
|
|
mov eax,[baz]
|
|
|
|
mov eax,[baz - $]
|
|
|
|
mov eax,[abs baz - $]
|
2017-02-21 05:06:02 +08:00
|
|
|
mov ebx,[rbx + baz - $]
|
2017-02-20 18:39:56 +08:00
|
|
|
mov esi,[baz - bar]
|
|
|
|
mov esi,[abs baz - bar]
|
|
|
|
mov ecx,baz - $
|
|
|
|
mov edx,baz - bar
|
|
|
|
|
|
|
|
bar: ; Forwards reference
|
|
|
|
hlt
|
|
|
|
|
|
|
|
section ".data"
|
|
|
|
baz: ; Other-segment reference
|
|
|
|
dd 0
|