OK, ich hab das jetzt in einen asm block geschrieben.
Laut objdump wird nach edx $0x0 gelegt.
der neue asm block:
asm("movl %0, %%edx;"
"movl $0, %%eax;"
"int $49;"::"r"((void*)eventHandler));
Ausgabe von objdump:
main.o: file format elf32-i386
Disassembly of section .text:
00000000 <puts>:
0: 55 push %ebp
1: 89 e5 mov %esp,%ebp
3: 8b 45 08 mov 0x8(%ebp),%eax
6: 89 c6 mov %eax,%esi
8: b8 02 00 00 00 mov $0x2,%eax
d: cd 30 int $0x30
f: 5d pop %ebp
10: c3 ret
00000011 <putc>:
11: 55 push %ebp
12: 89 e5 mov %esp,%ebp
14: 83 ec 14 sub $0x14,%esp
17: 8b 45 08 mov 0x8(%ebp),%eax
1a: 88 45 ec mov %al,-0x14(%ebp)
1d: 8a 45 ec mov -0x14(%ebp),%al
20: 88 45 fe mov %al,-0x2(%ebp)
23: c6 45 ff 00 movb $0x0,-0x1(%ebp)
27: 8d 45 fe lea -0x2(%ebp),%eax
2a: 50 push %eax
2b: e8 fc ff ff ff call 2c <putc+0x1b>
30: 83 c4 04 add $0x4,%esp
33: a1 00 00 00 00 mov 0x0,%eax
38: 40 inc %eax
39: a3 00 00 00 00 mov %eax,0x0
3e: c9 leave
3f: c3 ret
00000040 <putn>:
40: 55 push %ebp
41: 89 e5 mov %esp,%ebp
43: 83 ec 50 sub $0x50,%esp
46: c7 45 f8 00 00 00 00 movl $0x0,-0x8(%ebp)
4d: 83 7d 0c 24 cmpl $0x24,0xc(%ebp)
51: 7f 65 jg b8 <putn+0x78>
53: 8d 45 b7 lea -0x49(%ebp),%eax
56: 83 c0 40 add $0x40,%eax
59: 89 45 fc mov %eax,-0x4(%ebp)
5c: 8b 45 fc mov -0x4(%ebp),%eax
5f: c6 00 00 movb $0x0,(%eax)
62: ff 4d fc decl -0x4(%ebp)
65: 8b 55 0c mov 0xc(%ebp),%edx
68: 8b 45 08 mov 0x8(%ebp),%eax
6b: 89 d1 mov %edx,%ecx
6d: ba 00 00 00 00 mov $0x0,%edx
72: f7 f1 div %ecx
74: 89 d0 mov %edx,%eax
76: 03 45 f8 add -0x8(%ebp),%eax
79: 8a 10 mov (%eax),%dl
7b: 8b 45 fc mov -0x4(%ebp),%eax
7e: 88 10 mov %dl,(%eax)
80: 8b 55 0c mov 0xc(%ebp),%edx
83: 8b 45 08 mov 0x8(%ebp),%eax
86: 89 d1 mov %edx,%ecx
88: ba 00 00 00 00 mov $0x0,%edx
8d: f7 f1 div %ecx
8f: 89 45 08 mov %eax,0x8(%ebp)
92: 83 7d 08 00 cmpl $0x0,0x8(%ebp)
96: 75 ca jne 62 <putn+0x22>
98: 83 7d 0c 10 cmpl $0x10,0xc(%ebp)
9c: 75 0d jne ab <putn+0x6b>
9e: 68 25 00 00 00 push $0x25
a3: e8 fc ff ff ff call a4 <putn+0x64>
a8: 83 c4 04 add $0x4,%esp
ab: ff 75 fc pushl -0x4(%ebp)
ae: e8 fc ff ff ff call af <putn+0x6f>
b3: 83 c4 04 add $0x4,%esp
b6: eb 01 jmp b9 <putn+0x79>
b8: 90 nop
b9: c9 leave
ba: c3 ret
000000bb <printf>:
bb: 55 push %ebp
bc: 89 e5 mov %esp,%ebp
be: 83 ec 20 sub $0x20,%esp
c1: 8d 45 0c lea 0xc(%ebp),%eax
c4: 89 45 ec mov %eax,-0x14(%ebp)
c7: c7 45 f8 00 00 00 00 movl $0x0,-0x8(%ebp)
ce: e9 14 01 00 00 jmp 1e7 <printf+0x12c>
d3: 8b 45 08 mov 0x8(%ebp),%eax
d6: 8a 00 mov (%eax),%al
d8: 3c 25 cmp $0x25,%al
da: 0f 85 f3 00 00 00 jne 1d3 <printf+0x118>
e0: ff 45 08 incl 0x8(%ebp)
e3: 8b 45 08 mov 0x8(%ebp),%eax
e6: 8a 00 mov (%eax),%al
e8: 0f be c0 movsbl %al,%eax
eb: 83 f8 70 cmp $0x70,%eax
ee: 74 7d je 16d <printf+0xb2>
f0: 83 f8 70 cmp $0x70,%eax
f3: 7f 2a jg 11f <printf+0x64>
f5: 83 f8 63 cmp $0x63,%eax
f8: 0f 84 98 00 00 00 je 196 <printf+0xdb>
fe: 83 f8 63 cmp $0x63,%eax
101: 7f 12 jg 115 <printf+0x5a>
103: 85 c0 test %eax,%eax
105: 0f 84 eb 00 00 00 je 1f6 <printf+0x13b>
10b: 83 f8 25 cmp $0x25,%eax
10e: 74 7a je 18a <printf+0xcf>
110: e9 a1 00 00 00 jmp 1b6 <printf+0xfb>
115: 83 f8 64 cmp $0x64,%eax
118: 74 36 je 150 <printf+0x95>
11a: e9 97 00 00 00 jmp 1b6 <printf+0xfb>
11f: 83 f8 75 cmp $0x75,%eax
122: 74 2c je 150 <printf+0x95>
124: 83 f8 78 cmp $0x78,%eax
127: 74 44 je 16d <printf+0xb2>
129: 83 f8 73 cmp $0x73,%eax
12c: 0f 85 84 00 00 00 jne 1b6 <printf+0xfb>
132: 8b 45 ec mov -0x14(%ebp),%eax
135: 8d 50 04 lea 0x4(%eax),%edx
138: 89 55 ec mov %edx,-0x14(%ebp)
13b: 8b 00 mov (%eax),%eax
13d: 89 45 f0 mov %eax,-0x10(%ebp)
140: ff 75 f0 pushl -0x10(%ebp)
143: e8 fc ff ff ff call 144 <printf+0x89>
148: 83 c4 04 add $0x4,%esp
14b: e9 94 00 00 00 jmp 1e4 <printf+0x129>
150: 8b 45 ec mov -0x14(%ebp),%eax
153: 8d 50 04 lea 0x4(%eax),%edx
156: 89 55 ec mov %edx,-0x14(%ebp)
159: 8b 00 mov (%eax),%eax
15b: 89 45 f4 mov %eax,-0xc(%ebp)
15e: 6a 0a push $0xa
160: ff 75 f4 pushl -0xc(%ebp)
163: e8 fc ff ff ff call 164 <printf+0xa9>
168: 83 c4 08 add $0x8,%esp
16b: eb 77 jmp 1e4 <printf+0x129>
16d: 8b 45 ec mov -0x14(%ebp),%eax
170: 8d 50 04 lea 0x4(%eax),%edx
173: 89 55 ec mov %edx,-0x14(%ebp)
176: 8b 00 mov (%eax),%eax
178: 89 45 f4 mov %eax,-0xc(%ebp)
17b: 6a 10 push $0x10
17d: ff 75 f4 pushl -0xc(%ebp)
180: e8 fc ff ff ff call 181 <printf+0xc6>
185: 83 c4 08 add $0x8,%esp
188: eb 5a jmp 1e4 <printf+0x129>
18a: 6a 25 push $0x25
18c: e8 fc ff ff ff call 18d <printf+0xd2>
191: 83 c4 04 add $0x4,%esp
194: eb 4e jmp 1e4 <printf+0x129>
196: 8b 45 ec mov -0x14(%ebp),%eax
199: 8d 50 04 lea 0x4(%eax),%edx
19c: 89 55 ec mov %edx,-0x14(%ebp)
19f: 8b 00 mov (%eax),%eax
1a1: 89 45 fc mov %eax,-0x4(%ebp)
1a4: 8b 45 fc mov -0x4(%ebp),%eax
1a7: 0f be c0 movsbl %al,%eax
1aa: 50 push %eax
1ab: e8 fc ff ff ff call 1ac <printf+0xf1>
1b0: 83 c4 04 add $0x4,%esp
1b3: 90 nop
1b4: eb 2e jmp 1e4 <printf+0x129>
1b6: 6a 25 push $0x25
1b8: e8 fc ff ff ff call 1b9 <printf+0xfe>
1bd: 83 c4 04 add $0x4,%esp
1c0: 8b 45 08 mov 0x8(%ebp),%eax
1c3: 8a 00 mov (%eax),%al
1c5: 0f be c0 movsbl %al,%eax
1c8: 50 push %eax
1c9: e8 fc ff ff ff call 1ca <printf+0x10f>
1ce: 83 c4 04 add $0x4,%esp
1d1: eb 11 jmp 1e4 <printf+0x129>
1d3: 8b 45 08 mov 0x8(%ebp),%eax
1d6: 8a 00 mov (%eax),%al
1d8: 0f be c0 movsbl %al,%eax
1db: 50 push %eax
1dc: e8 fc ff ff ff call 1dd <printf+0x122>
1e1: 83 c4 04 add $0x4,%esp
1e4: ff 45 08 incl 0x8(%ebp)
1e7: 8b 45 08 mov 0x8(%ebp),%eax
1ea: 8a 00 mov (%eax),%al
1ec: 84 c0 test %al,%al
1ee: 0f 85 df fe ff ff jne d3 <printf+0x18>
1f4: eb 01 jmp 1f7 <printf+0x13c>
1f6: 90 nop
1f7: 8b 45 f8 mov -0x8(%ebp),%eax
1fa: c9 leave
1fb: c3 ret
000001fc <eventHandler>:
1fc: 55 push %ebp
1fd: 89 e5 mov %esp,%ebp
1ff: 83 ec 10 sub $0x10,%esp
202: 83 7d 08 01 cmpl $0x1,0x8(%ebp)
206: 75 2f jne 237 <eventHandler+0x3b>
208: 66 a1 28 00 00 00 mov 0x28,%ax
20e: 66 89 45 fe mov %ax,-0x2(%ebp)
212: 8b 45 0c mov 0xc(%ebp),%eax
215: 88 45 fe mov %al,-0x2(%ebp)
218: c6 45 ff 00 movb $0x0,-0x1(%ebp)
21c: ba 07 00 00 00 mov $0x7,%edx
221: 8d 45 fe lea -0x2(%ebp),%eax
224: 89 c6 mov %eax,%esi
226: b8 00 00 00 00 mov $0x0,%eax
22b: bb 0a 00 00 00 mov $0xa,%ebx
230: b9 05 00 00 00 mov $0x5,%ecx
235: cd 30 int $0x30
237: c9 leave
238: c3 ret
00000239 <_start>:
239: 55 push %ebp
23a: 89 e5 mov %esp,%ebp
23c: b8 00 00 00 00 mov $0x0,%eax
241: 89 c2 mov %eax,%edx
243: b8 00 00 00 00 mov $0x0,%eax
248: cd 31 int $0x31
24a: 68 00 00 00 00 push $0x0
24f: 68 2c 00 00 00 push $0x2c
254: e8 fc ff ff ff call 255 <_start+0x1c>
259: 83 c4 08 add $0x8,%esp
25c: b8 00 00 00 00 mov $0x0,%eax
261: c9 leave
262: c3 ret
Hab inzwischen noch eine printf funktion eingebaut, um die pointer zu vergleichen. Da hat komischerweise alles gestimmt ...
Danke für die Antwort