         title   DebugTest

         .586
         .model flat, stdcall
         option casemap:none   ; Case sensitive

            include  windows.inc
            include  user32.inc
            include  kernel32.inc
            include  L:\AsmEdit\include\debug.inc

         includelib  user32.lib
         includelib  kernel32.lib
         includelib  L:\AsmEdit\lib\debug.lib

.data
dwVar     dd  0
dwTest    dd  12345678
szMsg1    db  'Have a nice day!', 0
szMsg2    db  "If you don't have a nice day have a good night!", 0
szMsg3    db  'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'
          db  '`~!@#$%^&*()_+-=[]|\;:",<.>/?',0

.data?
hDefHeap  dd  ?
hMem      dd  ?
Cnt       dd  ?

.code
start:

      INVOKE     GetProcessHeap
         mov     hDefHeap, eax

;---------- [Allocate memory from the default heap] ----------
      INVOKE     HeapAlloc, hDefHeap, 0, 4096
         mov     hMem, eax
      INVOKE     lstrlen, addr szMsg3
         mov     ecx, eax
         xor     edx, edx
         lea     esi, offset szMsg3
         mov     edi, hMem
      .while (ecx)
            mov     al, byte ptr[esi+edx]
            mov     byte ptr[edi+edx], al
            inc     edx
            dec     ecx
      .endw
         mov     byte ptr[edi+edx], 0

;---------- [You can load the memory using the above or below] ----------

;      INVOKE     lstrcpy, hMem, addr szMsg3

         mov     eax, 0FFFFAAAAh
;---------- [You can use one or more of the following.] ----------
    PrintDec     eax
    PrintHex     eax
    PrintBin     eax
  PrintDword     eax

;---------- [You can use one or more of the following.] ----------
         mov     eax, 4d2h
    PrintDec     eax
    PrintHex     eax
    PrintBin     eax
  PrintDword     eax
   PrintRegs

;---------- [You can use one or more of the following.] ----------
    PrintDec     dwTest
    PrintHex     dwTest
    PrintBin     dwTest
  PrintDword     dwTest

    PrintNum     12345678901234567890

   PrintText     "Test string"   ; Must be in double quotes!

 PrintString     szMsg1

         lea     eax, szMsg2
PrintStringByAddr eax

         lea     edx, szMsg2
     DumpMem     edx, 48

     DumpMem     offset szMsg2, 48

      INVOKE     lstrlen, hMem
     DumpMem     hMem, eax

     DumpMem     410092h, 26

      INVOKE     SetLastError, 0Bh
  PrintError

         Spy     dwVar
         mov     dwVar, 5
         add     dwVar, 2
         shl     dwVar, 1
         sub     dwVar, 4
     StopSpy

      INVOKE     HeapFree, hDefHeap, 0, hMem

         ret
end start
