From: Gregory 'G. C. <ga...@cl...> - 2007-02-23 16:06:15
|
Hello, I've got the following code : SECTION .data interrupt: SECTION .text irq_entries_start: %assign irq_nb 0 %rep 4 ALIGN 4 mov eax , esp mov edx , irq_nb SECTION .data dd $ SECTION .text %assign irq_nb irq_nb+1 %endrep I compile it with : nasm test1.s -o test1.o -f elf Then, if I dump it with : objdump --disassemble-all test1.o |less I get this : test1.o: file format elf32-i386 Disassembly of section .data: 00000000 <interrupt>: 0: 00 00 add %al,(%eax) 2: 00 00 add %al,(%eax) 4: 04 00 add $0x0,%al 6: 00 00 add %al,(%eax) 8: 08 00 or %al,(%eax) a: 00 00 add %al,(%eax) c: 0c 00 or $0x0,%al ... Disassembly of section .text: 00000000 <irq_entries_start>: 0: 89 e0 mov %esp,%eax 2: ba 00 00 00 00 mov $0x0,%edx 7: 90 nop 8: 89 e0 mov %esp,%eax a: ba 01 00 00 00 mov $0x1,%edx f: 90 nop 10: 89 e0 mov %esp,%eax 12: ba 02 00 00 00 mov $0x2,%edx 17: 90 nop 18: 89 e0 mov %esp,%eax 1a: ba 03 00 00 00 mov $0x3,%edx What I would like to do is fill 'interrupt' with current code address (.text section), not the current data address. I tried a few things (macros, local labels) but can't find a way to get it. Can you please help me ? Thanks. Greg. PS: the following code works with the GNU assembler : .data interrupt: .text vector=0 irq_entries_start: .rept 4 1: pushl $(vector) nop nop .data .long 1b .text vector=vector+1 .endr -- _ ASCII ribbon campaign ( ) - against HTML email X & vCards / \ |