News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Assembly prerequisites - why C ?

Started by frktons, May 20, 2010, 08:51:56 PM

Previous topic - Next topic

oex

Awesome I had to sit through that twaddle on the BBC last night :lol
We are all of us insane, just to varying degrees and intelligently balanced through networking

http://www.hereford.tv

frktons

Quote from: hutch-- on May 27, 2010, 02:32:56 PM
Frank,

It sounds like you need to shoot AVG. It does have its share of bad habits like this.

And if I made some errors? I mean I am not sure I did it right with the
resource file and the icon, so Win7 doesn't want to run it.

The only thing I changed was this line:

#include "\vctoolkit\include\windows.h"


with:

#include <windows.h>


because that folder doesn't exist on my pc.

AVG doesn't matter, I can temporarily disable it, but why the exe doesn't run?
I surely missed something, I am a "n00b" after all.  :P

Frank
Mind is like a parachute. You know what to do in order to use it :-)

Vortex

Hi frktons,

With custom C start-up modules, you can create small C executables :


pocc /Ze /Zx /Ox Window.c
polink /SUBSYSTEM:WINDOWS Window.obj kernel32.lib user32.lib crt0\crt0.lib

frktons

Quote from: Vortex on May 27, 2010, 09:12:17 PM
Hi frktons,

With custom C start-up modules, you can create small C executables :


pocc /Ze /Zx /Ox Window.c
polink /SUBSYSTEM:WINDOWS Window.obj kernel32.lib user32.lib crt0\crt0.lib


OK Vortex  :U

What about adding the resource file and the ico I posted and see the complete
template object at work?
It doesn't run on my Win7 installation.  ::)
Mind is like a parachute. You know what to do in order to use it :-)

Ghandi

It doesn't run because although AVG claims to have been disabled, the on access protection is still blocking Windows from accessing the file, hence the error message. I used AVG for a few years, that is how i know about file access being blocked once AVG flags it as malware, but they got steadily worse to the point where i changed AV. At the moment i'm just using MS Security Essentials, its enough for what i do.

HR,
Ghandi

frktons

Quote from: Ghandi on May 28, 2010, 05:53:35 AM
It doesn't run because although AVG claims to have been disabled, the on access protection is still blocking Windows from accessing the file, hence the error message. I used AVG for a few years, that is how i know about file access being blocked once AVG flags it as malware, but they got steadily worse to the point where i changed AV. At the moment i'm just using MS Security Essentials, its enough for what i do.

HR,
Ghandi

Thanks Ghandi, I'll give it a try as soon as I am on my pc.

Frank
Mind is like a parachute. You know what to do in order to use it :-)

hutch--

Frank,

We have a sub forum to address the many shortcomings of commercial AV products, its the AV Sh*t List. The problem is that many of the low end of AV vendors don't fully understand the Microsoft Portable Executable specifications and attempt to enforce a subset of those specs by trashing entirely valid executable files. It helps them to get their hit rate up but at the risk of missing serious security problems. If you must use AV stuff, get reliable stuff like Eset's NOD32 or Kaspersky but if you know enough about your OS/Computer, secure it yourself with a decent firewall, make sure your router has NAT enabled and scan your email at the server before you download it.

Simple rule is if malicious code cannot get onto your machine, it cannot harm it. It pays to have either disk imaging software with a backup image or know how to rebuild the OS from its own backup with Win7 so that if something gets past your security system you can simply restore it back to a safe form. This method cannot be beaten as you normally boot the machine off a CD and restore an archived disk image.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

Manos

About C:

C is a very fast language.It is called High Level Assembly.
One advantage is that you can do many combinations, to condense expressions e.t.c.
It is not blabby.
For example  ++i  and  i++  are two different things.
But the above advantage is a disadvantage also.
A bad programmer can do a program unreadable.

C++ is a culture-language.It has many advantages, like polymorphism, inheritance, templates e.t.c.
With C++ you can make ActiveX Controls easily.
I program in C/C++ 12 years and in Assembly 10 years.
My GenericGrid and DockWnd Controls I wrote the first in C and later in Assembly.

Assembly is the fasted language and give you full control on the machine.
Assembly has two disadvantages:
You have to write too many code and spend time.
You have to write too many comments to remember what you have done in the foretime.

By my above experience, I concluded the follow:

1.When I want to write a small, fast program or if I want to have full control, I use Assembly.

2.When I have to write a big program, I use C++ and templates, (ATL/WTL).

Manos.


joemc

C is a very fast language.It is called High Level Assembly.

I like C but don't really see it that way.   C/C++ is going to express an idea that becomes machine code, appose to ASM/MASM that is going to be machine code. I guess that may be what you mean by "High Level".

A big advantage to mention is that C code can adapt what it becomes with compiler options and/or updates.  If a new processor comes out and needs completely different optimizations, the compiler should be doing this for you ! I think that is 1000 times more important than the lines of code it is going to save you originally.  It can also output for different hardware from the same code to begin with.  It can also take your "idea" and write it fast in a way that would normally look obfuscated. And finally the C compiler is unfortunately smarter than me.

frktons

Actually I'm learning some C syntax because of two main things:

1 - it is the language Windows is mostly written with [and Linux and more OS as well]
2 - a lot of good Assembly books tend to use C as a parallel language to
     explain some stuff.

So I told myself "Better to speak some C anyway"  :lol

The portability, the wide documentation available, the huge number of forums,
tutorials, libraries, projects and tools are other good things to consider as well.

It'll suffice to understand some API programming under Windows and to
create an intermediate structure for inserting faster Assembly routines when needed.  :P
C/MASM are enough for just anything I have in mind, no need for more stuff
for the time being.  :lol

Well I solved the AVG problem telling it not to bother with the program
I generate with C/MASM and now everything ig OK.  :U

Frank



Mind is like a parachute. You know what to do in order to use it :-)

locche

Hello frktons
I suppose it's a bit late to add to this post but what I figured if you're still learning...

1. Borland had a good Compiler BCC55 ( (no ide :) ) ; which you can still find with a simple search.  I tried VCC yrs. ago and never   came to   terms.  The advantage here, is it has an easy to use resource compiler. The end product is a bit bloated, but for starting  out,  you might find it easier than the Microsoft stuff.  And you don't need to call main() WinMain to compile your Windows program.    Most people will say it's too old, but it was created for Windows 2000, so it's modern enough to learn with.  It also offers a few console functions like getch() , gotoxy() from real mode days.

2. For learning C, I suggest you look in K&R at the standard libraries and just examine the inventory now and again, testing stuff
out as you see it. This will quicken your progress quite a bit. You might want to look at the header files you've been including for definitions and stuff.

3. There are some API books about with small example programs that can help. Jeffrey Richter wrote a nice book about Win programming some yrs. back.  For the basics, there's a tutorial from Brook Miles ( the Forger's tutorial ) or something like that.
Easy to find, which covers plenty of basics.

I think C a useful language to know, though I'm sorry about your {} keys.  Best of Luck. If you need help, give us a shout.




frktons

Thanks locche.

Yes, I'm still learning C/MASM at a snail speed, so to speak. :-)
I'm actually using Pelle's C compiler, that is quite good for a beginner
like me.
I got some books, from beginning to advanced topics that I'm reading
at the same speed as above :-)
And at the same time I try to figure it out how the same things can be done
in MASM, just to stay close to the main objective: learning Assembly.

See you around the forum.

Frank

Mind is like a parachute. You know what to do in order to use it :-)