Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change
Quote from: daydreamer on July 02, 2025, 06:58:12 PM32bit fastcall transfer data in registers vs 32 bit invoke pushing data would be most fair to test
AMD Athlon Gold 3150U with Radeon Graphics (SSE4)
400 cycles for 100 * proc aligned 16
400 cycles for 100 * proc aligned 16+3
417 cycles for 100 * aligned push+pop
273 cycles for 100 * aligned reg32
405 cycles for 100 * proc aligned 16
409 cycles for 100 * proc aligned 16+3
426 cycles for 100 * aligned push+pop
276 cycles for 100 * aligned reg32
409 cycles for 100 * proc aligned 16
402 cycles for 100 * proc aligned 16+3
422 cycles for 100 * aligned push+pop
290 cycles for 100 * aligned reg32
403 cycles for 100 * proc aligned 16
406 cycles for 100 * proc aligned 16+3
426 cycles for 100 * aligned push+pop
278 cycles for 100 * aligned reg32
406 cycles for 100 * proc aligned 16
416 cycles for 100 * proc aligned 16+3
421 cycles for 100 * aligned push+pop
281 cycles for 100 * aligned reg32
15 bytes for proc aligned 16
19 bytes for proc aligned 16+3
24 bytes for aligned push+pop
20 bytes for aligned reg32
D:\BCX>DllToInc64.exe
Usage : DllToInc64.exe DllFile.dll [optional -u]
Version 1.0
-u : Create include file for UNICODE API functions.
DllToInc64.exe kernel32.dll
\FreeBASIC\fbc32 -nodeflibs -c GetPublicIP.bas
\FreeBASIC\bin\win32\ld -e _mainCRTStartup -subsystem console -o GetPublicIP.exe GetPublicIP.o -L\FreeBASIC\lib\win32 -lkernel32 -luser32 -lgdi32 -lWininet -lmsvcrt -s
' Example of retrieving the WAN IP adress from an external source :
'
' GetPublicIP.exe http://whatismyip.akamai.com
' GetPublicIP.exe https://ipecho.net/plain
'
' If no command line option is specified then the application
' defaults to the address http://icanhazip.com
' Source code compiled with FreeBASIC Compiler - Version 1.09.0 (2021-12-31)
#include "windows.bi"
#include "win\wininet.bi"
Declare Function __getmainargs Cdecl Alias "__getmainargs" (Byval As Integer Ptr,_
Byval As Zstring Ptr Ptr Ptr,Byval As Zstring Ptr Ptr Ptr,_
Byval As Integer,Byval As LPSTARTUPINFO) As Integer
Public Function StdOut ( Zstr As Zstring Ptr) As Integer
Dim As HANDLE hOutput
Dim As DWORD bWritten
hOutput=GetStdHandle(STD_OUTPUT_HANDLE)
WriteFile(hOutPut,Zstr,lstrlen(ZStr),@bWritten,NULL)
Function=bWritten
End Function
Function main () As Integer
Dim As Integer i,RetVal
Dim As HINTERNET hInt,hUrl
Dim As WINBOOL Irf
Dim As DWORD BuffSize
Dim As LPCSTR url
Dim As ZString * 128 App
Dim As ZString * 68 IpAddr
Dim As ZString Ptr Buffer=@IpAddr
Dim As Integer argc
Dim As ZString Ptr Ptr argv
Dim As ZString Ptr Ptr env
Dim As Integer sinfo=0
__getmainargs(@argc,@argv,@env,0,Cast(LPSTARTUPINFO,@sinfo))
If argc=1 Then
url=Cast(ZString Ptr,@"http://icanhazip.com")
Else
url=argv[1]
End If
GetModuleFileName(0,@App,128)
hInt=InternetOpen(@App,INTERNET_OPEN_TYPE_PRECONFIG,0,0,0)
If hInt=0 Then Return 1
hUrl=InternetOpenUrl(hInt,url,0,0,0,0)
If hUrl=0 Then
InternetCloseHandle(hInt)
Return 2
End If
Irf=InternetReadFile(hUrl,@IpAddr,64,@BuffSize)
InternetCloseHandle(hUrl)
If Irf=0 Then
InternetCloseHandle(hInt)
Return 3
End If
*Cast(Ubyte Ptr,Buffer+BuffSize)=0
For i=1 To BuffSize
If *Cast(Ubyte Ptr,Buffer)<32 Then *Cast(Ubyte Ptr,Buffer)=32
Buffer+=1
Next i
StdOut IpAddr
InternetCloseHandle(hInt)
Return 0
End Function
Sub mainCRTStartup Cdecl Alias "mainCRTStartup"()
ExitProcess(main())
End Sub