News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

need help getting started

Started by John T, March 14, 2015, 07:03:39 AM

Previous topic - Next topic

habran

rrr314159  Certainly that I use macros :shock:
They make source small and nice readable.
Your idea about VS is inappropriate ;)
Cod-Father

jj2007

Quote from: Zen on June 16, 2015, 07:11:17 AMThey are not really compatible. Kip write overly simplistic code, and his examples are designed to be used only with other routines from the Irvine library

Compatibility is not a big problem. Most of his 32-bit examples work just fine when pasted into the template \Masm32\MasmBasic\IrvineMB\IrvineMasm32.asc - and you can add any Masm32 code, too.

Zen

JOCHEN,
Quote from: JOCHENCompatibility is not a big problem. Most of his 32-bit examples work just fine when pasted into the template.

Ha, Ha, Ha,...you know, I've been frequenting this Forum for years,...and I didn't know that,...I have to suspect that most novices aren't aware of it either.

rrr314159

habran,

thanks for the info. But I'm still thinking about that idea, here's another aspect of it. With VS u have a nice source debugger for regular asm and for C. But it doesn't help with compile-time macros does it? Such macros can get very complicated - good examples in qWord's stuff, in particular - and u have to debug them the old-fashioned way, put in print statements (or, echo statements) and so forth, right? So wouldn't u avoid really complex stuff like that in favor of C?

I'm not so much interested in your own technique - don't mean to get personal :biggrin: but instead, any normal VS programmer. Wouldn't they avoid such really complex stuff as, for instance, qWord's "RealMath"?

Reason I ask, as a "macro fan" I've not been interested in VS because of this idea. Wonder if I'm wrong? But it still makes sense to me, that in VS u would only use simple macros to, for instance, encapsulate a repeated block of code with one statement, not much more. Any further opinion welcome, thanks
I am NaN ;)

Zen

RRR314158,
You know,...I think QWORD is the only person on the planet that can understand QWORD's macros.
It's amazing stuff,...really !!! I wonder,...do you think he dreams in macros ???

habran

rrr314159,
VS doesn't assemble ASM source but the assembler you are using(masm,JWasm,yasm...)
it just serves as an IDE and a linker for compiled sources in to EXE
When you want to debug it you can set breakpoints in the .asm source by clicking on the frame on the left side of the row where you want like in C or C++
You can debug it in source mode or debug mode and you can switch from one to the other any moment
You never know if you never go ;)
Cod-Father

hutch--

One of the problems I have seen over a long period is that people who want to start programming in assembler by first setting up their own environment have a very high failure rate and it comes from trying to do things the old way. First they must configure an editor/IDE so it will build asm files then learn the bare minimum to build an object module which entails understanding an assembler, linker and resource compiler followed by having to try and write their own runtime library.

Collectively this is a near impossible task for a person starting out in assembler. Almost all of the older fellas can do all of this stuff but dumping this burden on a beginner is an act of stupidity as it almost always garrantees their failure. Assembler programming has nothing to do with elitism, it has always been a task of hard work and the most successful approach is to ease a learner into a successful path, not put obstacles in their path.

My disappointment with Kip Irvine's book is how badly it is supported and its lack of proper Intel ABI compliance. We regularly get people asking questions on how to build examples from the text book when it should be supported by the author or at least educational organisations that use it.

When I see a topic like "need help getting started" I see a person who does not know how to set up and configure a programming environment who expects other people to customise their often badly informed choices for them. Years ago you use to get "Why isn't it like a Borland IDE" then later it was "why isn't it like the VC/VS IDE" or "why isn't it like UltraEdit" and so on but it does reveal what the problem is, a lack of willingness to learn something new.

rrr314159

habran: You never know if you never go ;)

thanks now I understand how it works. I have installed VS a number of times over the years most recently when I came here a few months ago. Certainly a good product but I hate MS, when I discovered H/JWasm, evaluated it thoroughly and finally dumped ML I knew I'd found my niche. U know, I had to create an Outlook account just to try VS. Takes seconds to come up (qEditor takes milliseconds) ... I got a couple C++ examples working. 3 times they made me verify over the phone who I was, answer security questions, the third time I decided that was the end, never touched it again. It's not the product I hate, it's Microsoft.

hutch: Collectively this is a near impossible task for a person starting out in assembler

Maybe you're right, but it's hard to relate to your point of view. When I first ran into assembler, age 20-something, took maybe an afternoon to produce first program. Of course it was million times simpler back then, just thumbed in octal codes on the front panel, (later read them in from a tape, having thumbed in the tape driver), then put Instruction Counter at beginning and let 'er rip. If I'd had no experience b4 masm32 ... well it certainly would have been a lot harder I admit! But I still can't figure it's that big a deal; and I've taught plenty of math-illiterates topics such as math, physics, even programming (altho, never assembler). I think you'd find normal people are a lot smarter than u think if you can just get them to want to learn.

Having said that, emphasize again maybe you're right, you've had more experience with assembler beginners than me (not, however, with technical beginners in general)
I am NaN ;)

habran

rrr314159,
This world is composed of POSITIVE and NEGATIVE
NEGATIVE is there for development of our conscience
POSITIVE is there for our enjoyment
PREJUDICE makes us NEGATIVE ;)
Cod-Father

rrr314159

Surely you're aware that pi is a POSITIVE number

3.1415926535897932384626433832795028841971693993751 ...

Quote from: habranPREJUDICE makes us NEGATIVE

- prejudice makes you people negative, perhaps :biggrin:

- all my judice is postjudice

Hmmm ... better explain that for u non-native speakers,

Pre - judice means, to judge (judice) before (pre) learning the facts

Post - judice means, to judge AFTER learning the facts

Quote from: ZenI wonder,...do you think he dreams in macros ???

- Many people have the same recurring dream again and again, like flying for instance, or perhaps a nightmare ... qWord doesn't bother to have the dream again and again, why waste the effort? he just puts it in a macro :biggrin:
I am NaN ;)

jj2007

Quote from: hutch-- on June 16, 2015, 11:14:32 AMOne of the problems I have seen over a long period is that people who want to start programming in assembler by first setting up their own environment have a very high failure rate

Yes indeed, and the blame is to be put entirely on the developers of "IDEs".

What it should do: IDE greets the user with an empty window, you type print "Hello World", you click on "Run", and you see Hello World in a console window.

What it does instead: You spend a whole day googling desperately how to "set up" the "environment". This is the worst case - Visual Crap.

qEditor (Masm32's default editor) is a lot better than that, but it could be improved. When you paste...
include \masm32\include\masm32rt.inc

.code
start:
print "Hello World"
exit

end start

... and click "Build all", you see a cryptic message "Cannot perform this operation. There is no file loaded to perform it on".

Now if the user has a lot of creative imagination, he might find out this means "qEditor won't build this unless you save this file first".
So he hits Ctrl S and saves it as "test". Ouch:
Microsoft (R) Macro Assembler Version 6.15.8803
Copyright (C) Microsoft Corp 1981-2000.  All rights reserved.

Assembling: C:\Masm32\test.asm
MASM : fatal error A1000: cannot open file : C:\Masm32\test.asm
_
Assembly Error
Hit any key to continue. . .


After an hour of googling, trial and error and posting in the Masm32 forum, user finally finds out that qEditor doesn't automatically add the extension. So he saves again, this time as "test.asm", clicks "build all", and wow, this time the build succeeds!

But no Hello World on the screen. So user goes back studying the various options, and finally realises that making the program RUN is an extra item at the bottom of "Project".

So he clicks that and - nothing happens. Absolutely nothing.

When consulting the Masm32 forum, he gets three or four diverging opinions from jj and Dave, and finally finds out, after some days of trial and error, that
- every time he changes something, it must be saved (a warning "Build: Your changes have not been saved" would be most helpful)
- print "Hello World" needs Console build all (in hindsight, this should be the default)
- even if you do save your work, and you do use Console build all, and you do click Run again, you won't see your desperately awaited Hello World, because the editor doesn't keep the console window open.

So back to the Forum, "I see a very short flash but no Hello World". And somebody suggests to run the exe from a DOS prompt.

After a week or so, he has learned that inkey "Hello World" is the easiest way to see Hello World.

Now isn't that encouraging? And I stick to my opinion that VS is crap in comparison...

(btw if you paste the print hello world code above into RichMasm, and you click "Build and Run", you see Hello World; even if you didn't save it before, even if you don't know what console build is, even if you don't know the subtle difference between print and inkey... it simply does what the user expects).

hutch--

 :biggrin:

JJ,

Its from a common language that we both shared, GFAbasic from long ago. I swore I would never use anything other than a pure ascii editor ever again. Now its true that QE does not hold your hand and that MASM32 was never aimed at bare beginners to programming and this accounts for its basic ascii editor characteristics, you must save a file to disk to assembler it and you must name a file with the correct extension to assemble it. The expectation for a person using QE in MASM32 is that they know what a console is and to see the results they need to understand how a console works. The "inkey" macro is there to pause the exit for that reason.

Now I understand why you build these characteristics into your MASMbasic editor as it is a dedicated tool for your build environment but QE is intentionally built as a pure ascii editor as it gets used for basic, HTML, text files and anything that needs plain ASCII text so the differences are design differences. MASM32 was never aimed at 1st language learners, it was aimed at programmers who already knew how to use a compiler , write Windows API code and had at least some grasp of assembler mnemonics. Without this background the task is nearly futile.

rrr314159

hutch: I swore I would never use anything other than a pure ascii editor ever again.

- agree 1000%

But jj2007 has a point, and it would be very easy to help a beginner as he suggests. One could add to the Script menu a selection "Create Hello World Example", which would create this program:

; Instructions:
; Save this program as test.asm using File menu: Save As
; Select Project menu: Console Build All
; Select Project menu: Run Program

include \masm32\include\masm32rt.inc

.code

start:

    printf ("Hello World\n")
    inkey "pause..."

ret

end start


or, something similar
I am NaN ;)

habran

#43
rrr3.1415926535897932384626433832795028841971693993751
Don't keep a poison on your tongue, you could swallow it accidentally :biggrin:
How can you say Post - judice when you never built any assembly program in VS ::)   
Cod-Father

jj2007

Quote from: hutch-- on June 16, 2015, 02:11:01 PMNow I understand why you build these characteristics into your MASMbasic editor as it is a dedicated tool for your build environment

Guess what? RichMasm offers the same service to the 300+ sources in \Masm32\examples..!
- it autodetects if the source is console or GUI
- if it is a console application, it keeps the window open, so that the user can see the output
- it builds and runs with a single menu click or keystroke (btw is there ANYBODY here who builds code without running it??)
- just like Visual Crap, it builds and runs on the basis of the code you see, even if it hasn't been saved yet

But I agree, of course: noobs should suffer like C programmers do, so that only the best 1% survive as valid assembler programmers 8)