File: curpos-err.asm

package info (click to toggle)
yasm 1.3.0-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,880 kB
  • sloc: asm: 74,423; ansic: 53,055; python: 9,927; sh: 5,276; xml: 1,617; makefile: 214; pascal: 95; sed: 16
file content (27 lines) | stat: -rw-r--r-- 431 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
global bar
global foo

section .bar
bar:
dd foo-$
dd baz-$
call foo
call baz
foo:

section .data
baz:
dd foo-$
dd $-foo	; illegal
dd baz-$
dd $-baz
dd foo+4-$		; with constant
dd $-baz+foo+4-$	; both local and cross-segment (legal)
dd baz+foo+4-$-$	; ditto, slightly different
dd (bar-$)+(foo-$)	; illegal (too many cross-segment)
dd baz-$+baz-$		; two from same segment

section .text
mov dword [foo-$], 5
mov eax, foo-$
call foo