I have the following code in NASM:
;sleep.asm
[SECTION .text]
global _start
_start:
xor eax,eax
mov ebx, 0x00016630 ;address of Sleep
mov ax, 5000 ;pause for 5000ms
push eax
call ebx ;Sleep(ms);
Where 0x00016630 is the address of Sleep function (taken from dumpbin from kernel32.dll).
I would like to make executable file to run in Win 10. What I did was:
nasm -f win32 sleep.asm
and have sleep.obj
as result.
So now I have to link it. I choose link.exe Unfortunately with the following command
link sleep.obj /entry:_start /subsystem:windows /nodefaultlib
Microsoft (R) Incremental Linker Version 14.00.24215.1
Copyright (C) Microsoft Corporation. All rights reserved.
LINK : error LNK2001: unresolved external symbol __start
sleep.exe : fatal error LNK1120: 1 unresolved externals
Can anybody help how to fix this issue?