Attachment – The Yasm Modular Assembler Project

Ticket #114: pic.asm

File pic.asm, 299 bytes (added by Loren Merritt, 13 months ago)

minimal testcase

Line 
1extern _GLOBAL_OFFSET_TABLE_
2
3section .rodata
4myvar: dd 0
5myptr: dd myvar
6
7section .text
8global main
9main:
10    push ebx
11    call .getgot
12.getgot:
13    pop ebx
14    add ebx, _GLOBAL_OFFSET_TABLE_ + $$ - .getgot wrt ..gotpc
15    mov eax, [myptr + ebx wrt ..gotoff]
16    mov eax, [eax]
17    pop ebx
18    ret