Home | History | Annotate | Download | only in tests
      1 global bar
      2 global foo
      3 
      4 section .bar
      5 bar:
      6 dd foo-$
      7 dd baz-$
      8 call foo
      9 call baz
     10 foo:
     11 
     12 section .data
     13 baz:
     14 dd foo-$
     15 ;dd $-foo	; illegal
     16 dd baz-$
     17 dd $-baz
     18 dd foo+4-$		; with constant
     19 dd $-baz+foo+4-$	; both local and cross-segment (legal)
     20 dd baz+foo+4-$-$	; ditto, slightly different
     21 ;dd (bar-$)+(foo-$)	; illegal (too many cross-segment)
     22 dd baz-$+baz-$		; two from same segment
     23 
     24 section .text
     25 mov dword [foo-$], 5
     26 mov eax, foo-$
     27 call foo
     28