MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite
Quote from: rags on April 10, 2012, 11:51:59 PM
... Also, I would like to know if a state ultimately becomes responsible for the debt incurred,
by a cities fiscal mismanagement?...
QuoteBits 6-0 are flags raised by the FPU whenever it detects an exception. Those exception flags are cumulative in the sense that, once set (bit=1), they are not reset (bit=0) by the result of a subsequent instruction which, by itself, would not have raised that flag. Those flags can only be reset by either initializing the FPU (FINIT instruction) or by explicitly clearing those flags (FCLEX instruction).
Quote
fstsw ax ;retrieve exception flags from FPU
fwait
shr al,1 ;test for invalid operation
jc short _error
include masm32rt.inc
mymalloc proto :DWORD
myfree proto :DWORD
.data
hmyHeap dd 0
mtest db "test, testtttt dj a test ",0
hMylp1 dd 0
hMylp2 dd 0
.code
main:
call InitHeap
;I need to 300h bytes
invoke mymalloc,300h
mov hMylp1,eax
invoke RtlMoveMemory,eax,addr mtest,10
invoke mymalloc,200h
mov hMylp2,eax
invoke RtlMoveMemory,eax,addr mtest+10,10
; free memory 1
invoke myfree, hMylp1
; free memory 2
invoke myfree, hMylp2
InitHeap proc
invoke GetProcessHeap
mov hmyHeap,eax
ret
InitHeap endp
mymalloc proc Memsize:DWORD
invoke HeapAlloc,hmyheap,HEAP_ZERO_MEMORY,Memsize
ret
mymalloc endp
myfree proc hAlloc:DWORD
invoke HeapFree,hmyHeap,NULL,hAlloc
ret
myfree endp
end main