assembly - relocation error while linking an object file using alink which is of win32 format created using nasm assembler -


i using nasm assemble xyz.asm file xyz.obj using command :

nasm -f win32 xyz.asm 

linking using alink gives relocation error.

please me fix problem.

unfortunately, can't give "tested" code call gcd sample in windows (won't windows). might little this, not close enough work.

; nasm -f win32 callgcd.asm ; alink -ope -entry _main callgcd.obj gcdi.obj win32.lib  global _main extern _scanf extern _printf extern exitprocess extern xyz ; that's called  section .data     fmt db "%i", 0  section .bss     number1 resd 1     number2 resd 1  section .text      _main:      push number1     push fmt     call _scanf     add esp 4 * 2      push number2     push fmt     call _scanf     add esp, 4 * 2      push dword [number1]     push dword [number2]     call xyz     add esp, 4 * 2      push eax     push fmt     call _printf     add esp, 4 * 2      push 0     call exitprocess 

perhaps windows user can give better.


Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -