|
-
Jan 2nd, 2004, 02:14 AM
#1
Thread Starter
Fanatic Member
Windows Programming using Assembler
Why would anyone want to do this? The resulting code looks like C, but less readable. Furthermore, due to the efficiency of modern compliers, I do not see a great performance increase.
Anybody have thoughts on this topic or what was stated?
"Can't" and "shouldn't" are two totally separate things.
All questions should be answered. All answers should be true. That is why I post.
-
Jan 2nd, 2004, 03:56 AM
#2
Why program for Windows in Assembly?
Here are my answers:
1 I want to see if I can use an assembly language for Windows to write a programs.
Most things I do with programming are experiments to
try new things. I do them for fun and to learn.
2 I don't have C++.
3 I don't know anything about C++ but I am familiar with
realmode assembly programming (writing for MS-DOS for example)
4 If it doesn't work out, I simply will give up for now. I can use
Visual Basic for most things in Windows.
5 One of the reasons I started programming for MS-DOS
in assembly while I could do almost everything in Quick Basic
was because I thought it would be a nice challenge.
Last edited by Peter Swinkels; Jan 2nd, 2004 at 06:39 AM.
-
Jan 2nd, 2004, 12:39 PM
#3
Thread Starter
Fanatic Member
How about for commerical products?
"Can't" and "shouldn't" are two totally separate things.
All questions should be answered. All answers should be true. That is why I post.
-
Jan 2nd, 2004, 12:51 PM
#4
I have never made a commercial program, I did help write
small applications for a commercial program.
I usually write computer programs for a hobby though.
As for commercial products, I guess it depends on what
needs to be made. I have worked for a while at a small
software company. I had to write small programs in Visual Basic 6.0. They also used some other language but I don't remember
what it was called, never had to use it either.
I also wrote a few programs on request and got something
in return for it, not necessarily money though. I used Visual Basic
each time.
Last edited by Peter Swinkels; Jan 2nd, 2004 at 12:59 PM.
-
Jan 3rd, 2004, 07:16 AM
#5
It's very simple. There are people who think Assembly is more readable than C, faster to write and simply superior. These people usually are good enough to beat a compiler in efficiency too.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jan 7th, 2004, 05:30 PM
#6
I haven't met any of those people, I'm amazed that they exist.
I wouldn't expect anybody to write a commercial scale program in asm, but inline asm is still of value in games for creating specific high-speed routines.
However, I think the why doesn't have anything to do with which tool is best, rather I would expect that it has to do with the challenge and a desire to try new things. I got into programming because I was doing some mindless work (stepping on alligators in the Everglades, but even that gets old eventually), and wanted something to think about. I found assembler to be simple and straightforward for small things, but nothing that I'd want to use for a whole project. Still, knowing it can sure help in C.
-
Jan 8th, 2004, 02:43 AM
#7
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jan 10th, 2004, 05:37 PM
#8
Hyperactive Member
Re: Windows Programming using Assembler
Originally posted by Darkwraith
Why would anyone want to do this? The resulting code looks like C, but less readable. Furthermore, due to the efficiency of modern compliers, I do not see a great performance increase.
Anybody have thoughts on this topic or what was stated?
You don't write complete windows programs in ASM. More or less you write librarys or modules that the windows program would call to preform a certain task. Programs written in C and even visual basic would be able to access this ultrafast hardware accessing code. You may want to do this for performance reasons, resource reasons, or simply because an algorithm is impossible or complicated to accomplish in high level languages.
ASM provides the programmer with a lot more freedom and power then high level languages. ASM imposes very few restrictions on the programmer. For example it doesn't impose restrictions on the way variables and instructions are manipulated. Of course all this freedom and power comes at a price, the programmer is shouldered with the responsability to take care of many picky details that you normally do not have to think about in high level languages.
Even if you never write anything in ASM, it's definitly worth learning as all the secrets get unlocked after you learn that langauge.
Education is an admirable thing, but it is well to remember from time to time that nothing that is worth knowing can be taught. - Oscar Wilde
-
Jan 15th, 2004, 04:02 AM
#9
Junior Member
Hi everyone,
As a hobbyist, I used to write Windows applications in C using the Win32 API and then C++. Well, last year I stumbled upon this really outrageous idea: that one can just as easily create a Windows program in assembly not just inline assembly or coding libraries. Since then, I've used RosAsm to write simple but full Windows applications and it is really quite easy and fun.
When at work, I usually code web applications in php.
Best Regards,
Yeoh
--
Win32 Assembly Programming Using RosAsm
http://www.geocities.com/yeohhs
-
Jan 15th, 2004, 05:01 PM
#10
Thread Starter
Fanatic Member
Recently, I found an application written not very well in assembler. It was composed of a lot of invoke statements and undocumented (as in NO comments what so ever) assembler.
Going though this, the writer did some real atrocities like never taking stuff off of the stack.
My general feeling of this program was that it could have been done in C making the code a lot clearer and less buggy.
I agree that if you know what you are doing, you could create some wonderful apps with assembler, but I also feel that sometimes that is a very big IF. I am not against assembler optimizations or coding in assembler in general, but if you are, you should do it right.
"Can't" and "shouldn't" are two totally separate things.
All questions should be answered. All answers should be true. That is why I post.
-
Jan 15th, 2004, 05:22 PM
#11
__stdcall functions (like the WinAPI) pop off the arguments to themselves, so your code looks like
Code:
push 23
push 2365
call ApiFunc
No pops there.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jan 15th, 2004, 05:47 PM
#12
Thread Starter
Fanatic Member
PUSHAD
RET
POPAD
No pop there either.
"Can't" and "shouldn't" are two totally separate things.
All questions should be answered. All answers should be true. That is why I post.
-
Jan 16th, 2004, 08:20 AM
#13
Nope. Maybe it was a bad programmer?
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jan 17th, 2004, 03:13 AM
#14
Thread Starter
Fanatic Member
That was just one of the many things that urked me about the code (another was pratically no comments and when i mean pratically, I mean 1 comment per 1000 lines of code if that and I cannot forget the all so ever helpful labels like loop1 )
This was a commerical application of a game that did not need all too much processing power. The programmer (I hope you are right in the fact that might have been one poor, inexperienced programmer, CornedBee) did not know his tools enough to make something that was semi-readable. Lastly, at the end, the program was extremely buggy. I came to the conclusion that there was no reason for such effort and waste.
Do not get me wrong. I do support assembler optimizations, and I do support learning assembler, however, if you are going to do a complex windows application that will not need a ton of speed, I see no reason to use pure assembler.
"Can't" and "shouldn't" are two totally separate things.
All questions should be answered. All answers should be true. That is why I post.
-
Feb 6th, 2004, 12:18 PM
#15
Frenzied Member
-
Feb 9th, 2004, 09:15 AM
#16
Thread Starter
Fanatic Member
"Can't" and "shouldn't" are two totally separate things.
All questions should be answered. All answers should be true. That is why I post.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|