Hi !!!

Do you know tutorials for MASM (write applications for windows) ??? I have tutorials writed by Iczelion, but this tutorial is very difficult :-(
Posted on 2002-02-17 06:58:38 by jelcyn
Iczelion's tutorials are very easy to follow - but they teach win32
programming more than they teach assembler.

There's a basic asm tutorial available at http://www.madwizard.org/
for download in chm format, perhaps you should take a look at that.
Posted on 2002-02-17 07:02:14 by f0dder
MASM is very difficult because I programming in Visual Basic and I never programming in assembler :-(
Posted on 2002-02-17 09:12:35 by jelcyn
I was in the same situation. Follow f0dders advice and read some assembly tutorials first. You need to know alot before you cn start to code things.

Also, forget VB, the best attitude o have when starting assembly is to assume you'll have to do everything yourself. Then the few things that are done for you will seem like a blessing, rather than simply not enough.
Posted on 2002-02-17 11:42:21 by Eóin

I came from a similar background. I programmed in VB for a few years and one thing I noticed about vb programmers is that most hate using the Win API which should actuallly be their frind. I'd suggest getting to understand the WinAPI in a familar language that your comfortable so problems and such don't seem like uncrossable barriers. Then when you move onto asm you'll only have to learn about memory stuff and the syntax of asm...

The transition isn't over night but learning to use the api in vb will help you understand how it works in asm and how windows will talk to your asm programs...

Oh also, MSDN CD's are your friend!! If you aren't blessed with the fortune of having it on CDs, you can check out the website at http://msdn.microsoft.com

Hope this helps a bit:alright:,
Posted on 2002-02-27 17:14:23 by JamesE
Forgive me for bumping this thread back to the top. :) I'm taking a much needed coding break, reading through some old posts.

Anyways I thought I'd throw in my $.02 about api programming with visual basic.... To tell you the truth it confuses the hell out of me. Once you figure out the work around for the conspicuous lack of an unsigned long data type things start getting more bearable though. But what really confuses me the most is the syntax. This is taken from a project which a friend mailed me for advice on:

lhWnd = WindowFromPoint(pt.X, pt.y)

Now this is not logical at all. First you call the api function, wait for its return, then deal with the return. It doesn't make sense that the function and its return can be handled in one line of code. Maybe that's just me being silly but to me it's much more easy to follow in 32 bit asm:

invoke WindowFromPoint,pt.x,pt.y
mov lhWnd,eax

I guess the same argument could be made against the invoke syntax....in favor of the old push/call style though. -shrugs-

....and the way a lot of vb programmers cram multiple statements and function calls on one line makes the code very difficult to understand. Like embedding an api call inside a "left()" call, inside a "instr()" call, etc, etc

If you haven't started with the vb api coding yet jelcyn, I'd highly suggest that you just read Iczelion's excellent masm tuts which address masm api use indepth. Now if you were making the transition from c++ to masm, you'd be able to make a very easy and smooth transition from c++ api use to masm....
Posted on 2002-03-19 00:08:01 by Will

Gee, VB statememts look completely natural to me, but then I've been using HLL assign statements almost long enough to forget how long I've been using them. (It was 33 years ago).

I do agree too many statements are occasionally crammed into a single statement line, but I do this myself when intermediate values have no worth except in some further statement, then I will cram some in. I do keep it down to where normal mortals can still understand the statement.

On the other hand, I'll chime right in with you concerning C/C++ code, where variables may be (and frequently are) defined right where they are used. I much prefer all local variables to be defined at the top of a procedure (as is the case with VB and MASM).

C even has contests for :"the most obsure line of code ever seen."
Posted on 2002-03-19 19:17:19 by Ernie

lhWnd = WindowFromPoint(pt.X, pt.y)

Now this is not logical at all. First you call the api function, wait for its return, then deal with the return. It doesn't make sense that the function and its return can be handled in one line of code.

This syntax by nature is mathematical. To a mathematician it would make perfect sense. For example, take this simple algebraic formula:

x = cosine y

Here the cosine is found for angle y and only after this has been calculated, the value is then assigned to x. All "on one line". If you look again, it is very similar to:

x = cos( y );


x = Math.cos( y )

...etc. etc.
There was once a time when a solid mathematical knowhow was a prerequisite for computer programming. This might explain the syntax of many of the current HLLs. Don't forget why HLLs were invented in the first place... to alleviate the confusion of machine code.
Posted on 2002-03-21 15:04:35 by iblis
hiya Ernie and Ibilis

I've been using hll languages for the past 18 years or so on and off. It's not that I don't see their usefulness and whatnot. Afterall nobody (besides Bogdan) has got the time to develop a huge commercial app with asm. You have to know how to pick the right tool for the job so to speak.

But the vb source that I see is often convoluted. Your point about not wasting time defining variables for intermediate values if you don't need them is understandable. It's not that I can't read code like that, it's just that I don't want to. :) The easier the code is to read, the easier it is to maintain (rewrites, bug hunting/fixing, etc)

And of course programming is mathematical in nature. I doubt anyone would have difficulty reading "x = cos(y)". :) There are extremely more complicated math algos than that though, and there's no reason why they can't be broken down into several lines of more comprehensible code is all that I meant.

That's just the way that my mind works I guess. I'm just a simple programmer that way. ;)
Posted on 2002-03-22 10:07:25 by Will