Click here to Skip to main content
15,921,174 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hi,
i need a source code in assembly that make paint imvironment such as windows paint...not so profetionally like that...just when i drag a shape such as rectangle and drop this, draw a big rectangle.
please help me,
thanks
Posted
Comments
Sergey Alexandrovich Kryukov 25-May-11 11:52am    
May I know why suffering so much?
--SA

Here's a site with nice collection of Win32 assembly programming tutorials: Iczelion's Win32 Assembly Homepage[^].

You can also get a nice little IDE package for MASM from MASM32[^].

Combine the info from these tutorials with the info on painting from something like Charles Petzold's Win32 API book and you should be able to get something working.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 25-May-11 13:49pm    
Well, good to know. My 5.
Still, I would not say it can be a good justification for writing the whole Windows application using just assembly.
--SA
Try Fasm[^], it has support for Windows built in.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 25-May-11 13:48pm    
Interesting, good to know. Still would not understand why doing it, but the tools itself is good to know. My 5.
--SA
Richard MacCutchan 25-May-11 16:21pm    
I could not understand either, but if OP wants pain, then let's give it to them. :)
Sergey Alexandrovich Kryukov 28-May-11 1:37am    
:-)
See our discussion with Kythen over my answer. I'm not dismissive about assembly language at all, but being practical is important (and not easy). Several months ago I tried to overview what can be used for assembly these days, come across Fasm as well. There are interesting assemblers out there, some are pretty high level... And I really like the idea of using inline assemblers which I used the most.
--SA
Richard MacCutchan 28-May-11 4:18am    
I am more than happy for developers to use whatever tools they wish for development. I started my PC programming life using assembler and wrote a very basic "Windows" type program before moving on to C and C++. As Kythen points out, a knowledge of assembler can help in understanding what goes on under the covers. Far too many people these days, as evidenced from their questions, seem to have little understanding of how source code gets turned into a program or of the underlying architecture of the systems they are writing programs for.
Sergey Alexandrovich Kryukov 28-May-11 4:25am    
Absolutely. I often faced with lack of understanding of technology in people who mastered just one language (sometimes brilliantly, but it did not help). They know the language but not programming. One reason for this problem is lack of understanding what's going on behind the scene: stack, registers, all those descriptors, segments, pages... without it deep understanding of technology is not possible.
--SA
This is quite possible but very difficult if you want it all in assembly. I never heard anyone did it as it looks very impractical. These days, even creating a rudimentary Windows application using bare Windows API looks like a heroic effort. I personally did it — needs fairly good amount of knowledge.

Frankly, I never met a person who did it as assembly-only project. I would not hope anyone would provide such code or would do it for you. Again, why?

I don't know why doing this, but this is a step you can start from bare Windows API project. It could be in C, C++, or, as I preferred, in native-Windows Delphi. Develop the code and that disassemble it to see what's involved. I fear to say it will look very sobering. :-)

You can also start putting some fragments in inline assembly at first, which is a lot more easier. When you're comfortable, you can gradually shift to pure assembly language.

I cannot help asking "why". If this is some kind of Penance (I mean http://en.wikipedia.org/wiki/Penance[^]), I would be afraid even to ask about your sins which led you to this. :-)

—SA
 
Share this answer
 
v3
Comments
Sergey Alexandrovich Kryukov 25-May-11 12:06pm    
I just took an overview of this text and noticed that I provided only one Web link here. Well, maybe this is the only relevant one... :-)
--SA
Kythen 25-May-11 12:36pm    
I've done a few very small things in assembly. It's certainly more manual than C/C++, but with macros like the ones in the MASM32 package, it's not that bad. I know there has been at least one commercial application done in 100% assembly: the old Playstation emulator "Bleem!" back in 1999.
Sergey Alexandrovich Kryukov 25-May-11 13:46pm    
Well, yes, I can believe that, even though I never knew such things. "Bleem!"? Interesting, I did not know.

I hope you understand that this fact no way dismisses my assessments? I never said it is impossible or could be a miracle. In principle, this is quite possible.
--SA
Kythen 25-May-11 14:28pm    
Yes, I entirely understand. :)

Generally speaking, it is impractical to do development in 100% assembly language. However, I think we as development community (not just CP) are far too dismissive of assembly language coding. We tend to make it sound like some intimidating lost black art that has almost no use whatsoever when in fact learning assembly and doing a little toy project or two can be very helpful in understanding what's really going on beneath what we see in our IDEs and debugging your other projects.
Sergey Alexandrovich Kryukov 28-May-11 1:20am    
I'm personally not dismissive at all.
For example, I personally implemented very early threading system (object-oriented), when it was not yet available in Linux (only processes were) with fully-fledged structured exception handling, when it was not yet introduced in C++; both based on some critical codes I did in inline assembly. It's clear to me that without those assembly code such tasks are not implementable in principle. Both mechanism go above the procedural semantics supported by higher-level languages.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900