I am a new in assembler ... but the the incredible speed and small size likes me ... i wonder if exist an option like Visual Basic Doevent ... to make "while", "for next" or common asm loops routines more handy to the system ..i.e. if i make a search on 100000000000 files... than the system don't lock up ..until this search end...

BTW: RADasm rules !! do not stop the project!






P.D.:sorry about my english:grin:
Posted on 2002-11-19 13:17:59 by DrBios
Use a thread !

:)
Posted on 2002-11-19 13:27:09 by JimmyClif
.while/.endw
.if/.else/.elseif/.endif
....

Look at the masm lib help file. Masm gives us some hll syntax.
Posted on 2002-11-19 13:37:21 by Will
Will forgot
.Break
.repeat/.until

any as JimmyCliff says...anyhing that's doing shit loads of processing goes in a separate thread if you don't want your program interface to lock up
Posted on 2002-11-19 17:33:47 by MArtial_Code
Scronty has converted a "DoEvents" API from PowerBASIC to MASM. Just PM him or wait until he reads this thread ;)
Posted on 2002-11-19 17:58:12 by bazik
DrBios,

A thread is the right way to run something seperate from an application. Rather than try and imitate VB or anything else, just look up the thread functions and you can easily put seperate code in a thread or alternatively have a seperate thread call a DLL so that the interface keeps working while the code is being run.

Regards,

hutch@movsd.com
Posted on 2002-11-19 18:06:25 by hutch--
Oops@me for skimming the original post. I thought DrBios was just asking about the hll stuff. ....i was wondering what JimmyCliff meant by that post, but now it's all clear! ;)
Posted on 2002-11-19 18:31:06 by Will
DoEvents proc

LOCAL msg:MSG
@@peek: xor eax, eax
lea ecx, [msg]
invoke PeekMessage, ecx, eax, eax, eax, PM_REMOVE
test eax, eax
jz @@done
lea eax, [msg]
push eax
invoke TranslateMessage, eax
call DispatchMessage
jmp @@peek
@@done: ret
DoEvents endp
Posted on 2002-11-19 18:49:42 by comrade
So with another thread Windows will not lock up ...if i remember right Doevent make a pause to let the system do something......

a good example to explain my point could be a Seti@client.... How can i select the amount of priority of the cpu?
Posted on 2002-11-19 20:29:22 by DrBios
Afternoon, DrBios.

This is what Sven was talking about:
;--------------------------------------------------------------------------

;-- CheckEvents -----------------------------------------------------------
;--------------------------------------------------------------------------
;-- Allow processing of a waiting message ---------------------------------
;--------------------------------------------------------------------------
CheckEvents PROC
LOCAL msg:MSG
invoke PeekMessage,ADDR msg, NULL, 0, 0, PM_REMOVE
.if eax != 0
invoke TranslateMessage, ADDR msg
invoke DispatchMessage, ADDR msg
.endif

ret
CheckEvents ENDP

Just have a ...
invoke CheckEvents  ; allow processing of waiting messages

... inside your loop, and it'll process a single waiting Windows message.
It's used in the Tsunami Demo proggy, so that the user can abort the loop.

A better way would be to use a separate thread, however there'd be a lot more coding involved.
If you wanted to do a search upon a hundred billion files, then using a "CheckEvents" proc is definitely not what you want to use.

Cheers,
Scronty
Posted on 2002-11-19 23:18:47 by Scronty
Thanx so much ...all of u guys r a Large pool of wisdom....now i am very clear on this matter:grin: :alright:
Posted on 2002-11-20 17:36:09 by DrBios
How can i include an .inc file (or other files) than is in the same folder of my project...?...i mean ... just by default to avoid put the complete path of the archive? i use

include <filename>

but masm32 gave me an error
Posted on 2002-11-20 18:35:10 by DrBios
Internally, a DoEvents simply calls a PeekMessage and then calls TranslateMessage and DispatchMessage. It does not create another thread nor is in in the slightest way another thread.


Thanks,
_Shawn
Posted on 2002-11-20 19:36:58 by _Shawn

a good example to explain my point could be a Seti@client.... How can i select the amount of priority of the cpu?

first note that vb isn't multi threaded... it is just one instance and you
have to peek messages from your msg quene if you don't want to lock
up your own application... (in every loop haha) thats the main reason
why vb sucks. in every other language you can use threads for every
thing that could block the main app. you can even launch several threads.
you can also set the thread priority... i think seti does it like this but i'm
not sure... i don't use seti.

your 2nd question: INCLUDE FILENAME ...thats it
Posted on 2002-11-21 04:47:24 by mob
thanx mob ... recently i discovered my error with INCLUDE statement ... i just wonder order my .asm files ...put in separated .asm files some functions ... to mantein a clear structure of my aplication ...

if i want to put in another .asm another function i have to :


+++++++++++++++this is another .asm of my program++++++++++++++++
CheckEvent proto

.code

CheckEvents PROC
LOCAL msg:MSG
invoke PeekMessage,ADDR msg, NULL, 0, 0, PM_REMOVE
.if eax != 0
invoke TranslateMessage, ADDR msg
invoke DispatchMessage, ADDR msg
.endif

ret
CheckEvents ENDP

++++++++++++++++++ end of the other .asm+++++++++++++++

and in the main .asm use INCLUDE <filename.asm>

am i right?

SAludo2

DrBios

Added [ code].... around your code - Scronty
Posted on 2002-11-21 09:05:44 by DrBios
INCLUDE filename.asm would do the job. but after all these postings
telling you not to use this technique why do you want to do this?
anotherthing is that comrades version is far more optimized and
smaller in size... ahh however, good luck

before i forget it, please consult iczelions tut#15 -threading-
Posted on 2002-11-21 09:19:23 by mob
in tis statement what mean !eax?
.WHILE TRUE
invoke GetMessage, ADDR msg,NULL,0,0
.BREAK .IF (!eax)
invoke TranslateMessage, ADDR msg
invoke DispatchMessage, ADDR msg
.ENDW
Posted on 2002-11-21 15:55:06 by DrBios
Hi,

I presume you do not do HLL programming ;) ... !eax means "not eax" in other words
Posted on 2002-11-21 21:51:23 by roticv