_asm { mov eax,ebx add ecx,edx }
asm mov eax,ebx asm add ecx,edxNote that there isnīt a common standard, the implementation is always compiler-specific.
IFDEF masm option casemap :none ENDIFCan I delete them while using TASM?
nasm -f elf file.asm -o obj alink file.obj -oEXE file.exe
SendMessageA equ SendMessageA@16
?LoadBitmap
, LoadIcon
, CreateDialogParam
, etc.) or if multiple languages should be supported automatically, otherwise normal data segments are easier to use.VirtualProtect
as well as the section flags inside the PE header define.VirtualProtect
.code
section.data
) or additional allocated memory and executing it there.VirtualAllocEx
, thus you might directly call this function instead. However, most runtime libraries use optimized versions of malloc() or new() which try to get the requested memory out of a preallocated pool in order to reduce API calls for every small block. Following a new(), the corresponding constructor is also called as well.RDTSC
, CMOVxx/FCMOVxx
which use the standard integer or FPU registers can always be used. The same applies to MMX and 3DNow, since the MMX/3DNow registers are mapped onto the FPU registers and are thus preserved during a task switch. However, instructions sets like SSE and SSE2 use new registers which are not yet preserved by Win95 and older NT versions during a task switch.Query
, AddRef
and Release
as well).CreateWindow
function be found?CreateWindow
is just a macro which calls CreateWindowEx
with the additional parameter set to 0.CreateWindowEx
by specifying the predefined name of the window class (which are described in the API SDK). Or you can use a ressource editor to create a dialog with the elements needed, which is simpler.SetDlgItemInt
, SendMessage
,...). Thus, the same reentrancy rules than for recursive functions apply to the window procedure as well; especially that the variables used inside the window procedure should be local variables (allocated on the stack).CreateMDIWindow
. The window procedure of the main window now has to call DefFrameProc
rather than DefWindowProc
. Windows procedures of child windows call DefMDIChildProc
instead.Blit
.CreateDC
and DISPLAY as device name.BitBlt
or MaskBlt
.ChangeDisplaySettings
.KeyboardProc
, MouseProc
, SetWindowsHookEx
, UnhookWindowsHookEx
, etc.). DLL function calls can be trapped within a process by replacing the calling destinations of the DLL loaded into memory by addresses of your own functions. If you need to access other processes as well, the debug functions have to be used, but these require sufficient access rights. Information about it can be found at internals.comCheckSumMappedFile
function contained in imagehlp.dll.FlushInstructionCache()
needed after using selfmodifying code?GetCommandLine
retrieves the address of the whole command line string.FillConsoleOutputCharacter
API function in order to write a block of spaces to the console. Note that the size of the console may vary, so it is recommended to calculate the number of spaces needed using the information obtained by GetConsoleScreenBufferInfo
.printf
provided by MSVCRT.DLL:; Hello, World for the Windows Command Line ; Copyright 2007, Daryl Lee %include "win32n.inc" EXTERN exit IMPORT exit msvcrt.dll EXTERN printf IMPORT printf msvcrt.dll segment .data USE32 MsgContent db "Welcome to Windows Assembly Language Programming", 0 segment .code USE32 main: ..start: ; Display message push dword MsgContent call [printf] add esp, 4 ; clean up stack ; Exit with success code push 0 call [exit]
FindFirstFileA
, FindNextFileA
and FindClose
. Attention: Some windows include files use a wrong definition for the constant MAX_PATH
: The correct value is 260.GetLastError
and FormatMessage
mciSendString
, set DOOR to OPEN and then call mciSendString
a third time to close it. Sample code about using the multimedia interface can be found at Test Department.
BeginUpdateResource
, UpdateResource
and EndUpdateResource
.