MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite
include masm32rt.inc
CreatemyHeap proto
mymalloc proto :DWORD, :DWORD
myfree proto :DWORD, :DWORD
.data
hmyHeap dd 0
mtest db "test, testtttt dj a test ",0
hMylp1 dd 0
hMylp2 dd 0
.code
main:
call CreatemyHeap
;I need to 300h bytes
push 300h
push hmyHeap
call mymalloc
mov hMylp1,eax
invoke RtlMoveMemory,eax,addr mtest,10
push 200h
push hmyHeap
call mymalloc
mov hMylp2,eax
invoke RtlMoveMemory,eax,addr mtest+10,10
; free memory 1
push hMylp1
push hmyHeap
call myfree
; free memory 2
push hMylp2
push hmyHeap
call myfree
CreatemyHeap proc
invoke HeapCreate,NULL,1000h,1000h ; 1000h bytes, I think it's suficient lol
mov hmyHeap,eax
ret
CreatemyHeap endp
mymalloc proc hmyheap:DWORD, Memsize:DWORD
invoke HeapAlloc,hmyheap,HEAP_ZERO_MEMORY,Memsize
ret
mymalloc endp
myfree proc hMem:DWORD, hAlloc:DWORD
invoke HeapFree,hMem,NULL,hAlloc
invoke HeapDestroy,hMem
ret
myfree endp
end main
.while var1 < 768 ;<< Bitmap width
invoke BitBlt,memDCBack,0,0,767,576,memDC,1,0,SRCCOPY ;take from pixel 1 to width
invoke BitBlt,memDCBack,767,0,1,576,memDC,767,0,SRCCOPY ;take pixel 1 to last column
invoke BitBlt,hDC,10,10,768,576,memDCBack,var1,0,SRCCOPY ;draw the image
inc var1
.endw
Paint_Proc proc hWin:DWORD, hDC:DWORD, movit:DWORD
LOCAL hOld :DWORD
LOCAL hNew :DWORD
LOCAL memDC:DWORD
LOCAL memDCBack:DWORD
invoke CreateCompatibleDC,hDC
mov memDC, eax
invoke SelectObject,memDC,hBmp
mov hOld, eax
invoke CreateCompatibleDC,hDC
mov memDCBack, eax
invoke SelectObject,memDC,hBmp
mov hNew, eax
.if movit == 0
invoke BitBlt,hDC,10,10,768,576,memDC,0,0,SRCCOPY
.else
mov var3, 0
.while var3 < 2 ;<< set the number of times image is looped
mov var1, 0
.while var1 < 768 ;<< Bitmap width
invoke BitBlt,memDCBack,0,0,767,576,memDC,1,0,SRCCOPY ;take from pixel 1 to width
invoke BitBlt,memDCBack,767,0,1,576,memDC,767,0,SRCCOPY ;take pixel 1 to last column
invoke BitBlt,hDC,10,10,768,576,memDCBack,var1,0,SRCCOPY ;draw the image
inc var1
.endw
inc var3
.endw
.endif
invoke SelectObject,hDC,hOld
invoke DeleteDC,memDC
invoke SelectObject,hDC,hNew
invoke DeleteDC,memDCBack
return 0
Paint_Proc endp
Quote from: jj2007 on May 20, 2012, 01:09:48 AM
MB is good because I had many friendly helpers here. For example, the GetFiles macro was very actively discussed in the lowest possible stack address thread.
Quote from: HUTCH...Post in the new forum, this one may not be around much longer,...