News:

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

I'd like to introduce myself...

Started by Big Duke 6, July 09, 2009, 06:51:30 PM

Previous topic - Next topic

Big Duke 6

My name is Big Duke 6, and I have written programs on many a different platform for the past few uhhhh, days shall we say? Including, but not limited to ASM on a few diff processors. Six axis robots (Motoman), concurrent I/O on said robot systems. PLC's, and machine vision. Somewhat of an eclectic mix, but it was always fun.

My goal here is to get a grip on MASM, or something low level for Win32, as I am bored and wish to maintain my skills as a programmer.

Should any here be interested in ladder logic, or robots, gimme a shout. I'll be happy to assist.

dedndave

welcome to the forum, Duke
i have had to mess with pld's and robotics in the past, a bit
here is a nice tutorial to get you started...
http://website.masm32.com/iczelion/iczelion.zip

Big Duke 6

Thank you dedndave. I'm a wee bit rusty, but I'll get up to speed.

It seems that programming rules never change, but the means by which we do it (programming) have differing means of accomplishing the tasks we wish to perform.

I've got a lot of work ahead of me! :bg

dedndave

one step at a time
start with a simple console app
try some console i/o
try some file i/o
build on that one API function at a time until you are an expert

Vortex

H Big Duke 6,

Welcome to the forum.

Big Duke 6

Thank you Vortex. I appreciate the welcome.

Big Duke 6

I couldn't think of a good place to say what I wanted to say, so I just stuck it here.

I've got MASM32 up and running, and after a few failed attempts, I finally remembered to save the file output from the text editor as an .asm file! DOH! It's been 6 or 7 years since I last wrote ASM programs...

At any rate, I really like the way MASM32 is set up, and how it really lessens the work load by having a library file of commonly used routines. Real nice feature, that one. Now if I could just get the wife off of my computer for a while, I'd be further ahead on my learning of Win32 ASM!

I was going to ask a few questions, but I knew darn well that reading the entire help file was something I should do first, and while I haven't read the whole thing yet, I no longer have any questions to ask as of right now.

This is mucho easier than using DEBUG, or any other type of assembler that I have used in the past, and I have to say I am impressed by it. I can recall some years back, I had a buddy who was getting his degree in Physics, and he had some math intensive programs written in GW BASIC, and he asked me if it was possible to speed up his 286 or 386 (I no longer recall which machine it was), so I just wrote a very short and sweet machine language proggy in BASIC whereupon I disabled the video IRQ and reenabled after the data was crunched. Achieved a 26% increase in speed. Not too bad, eh? Those were the days... 

At any rate, when I learn some more, I'll be back to ask questions then. Gotta get those basics down pat first. :toothy

dedndave

Duke,
you must get the wifee her own machine
it should LOOK nicer than yours
buy a new one - take the guts out of both machines and swap em
she'll never be the wiser
of course, i would never attempt such a thing with Zara, as i would get "the look" in place of "happy fun time"

Big Duke 6

LOL, she has her own machine. She can't get the kids off of hers, so I must suffer!

As far as MASM32 goes, I obtained the WIN32 API help file, and that opened many a door for me. As far as MASM32 goes, I know assembly inside and out. I just need to learn MASM32. That's gonna take some time.

I recall when I first started programming robots, I was struck by what at the time seemed to be redundent code, and later discovered that it was needed. Same thing here. I just need to get accustomed to this particular assembler, and it's style. Robot programming is four dimensional (X, Y, Z, and time), and it took some getting used to. ::)

ecube

MASM programming is a thing of beauty. It's by far more efficient/faster for me than c/c++ when developing commerical applications(although I use GoASM now which is similar to MASM but has some benefits I enjoy). When I say faster you don't need to install a gig+ SDK, few hundred megabyte IDE only to have various code you try and compile(assemble) simply not work with MASM, without first tweakin(like with visual C++).

While on the subject I recommend you use RadASM to program in as your IDE instead of notepad as it's a free, small, extremely powerful and useful IDE. Has color highlighting and lot of stuff.

I haven't really looked at the MASM examples, but it's always a good idea to add Invoke ExitProcess,0 at the end of your program for a clean exit, as a simple RET seems to crash things sometimes. You'll probably notice unlike old school ASM assemblers, masm supports C like calling convention, so you can call functions on a single line, instead pushing each 1 if you want, which is NICE. Its macro support allows even more functionality.

For windows API, success/fail status(if there is 1) is *always returned in eax on 32bit unless otherwise specified by microsoft.
;example http://msdn.microsoft.com/en-us/library/ms684320%28VS.85%29.aspx

invoke OpenProcess, PROCESS_ALL_ACCESS, FALSE, 4331 ;firefox.exe's pid on my system
;eax now has the return value

.if sdword ptr eax==NULL ;failed
  ;do watever
.endif


also thats something else that's important, that I myself ran into trouble with as I didn't see it mentioned anywhere. the .IF,.elseif statement does signed comparison only by default, which sucks as alot of things return negative values, so you can use .if SDWORD PTR to do unsigned comparison for both positive and negative values.