News:

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

Getting Started

Started by WayneSallee, April 28, 2007, 03:26:28 AM

Previous topic - Next topic

WayneSallee

I am having the hardest time gettig started.

16 bit pure asm was so much easier.

And most of the example code I have has so little comments in it to explain what the code is doing.

Could someone tell me how to creat dialog boxes, read input from the boxes, open a file, edit a file, and save a file?

Yes I know that the masm software has help files, but those help files just arn't cutting it for me. The help files leave out the basic information.

From that I should be able to make progress, but as of yet I'm just going in circles.

It's kind of hard to test code when you don't even understand how to output your data to windows, even though the sample code is doing it for you. :-)


I can't just ride the sample software, I need to be able to drive it. :-)

Wayne Sallee
Wayne's Pets
Wayne@WaynesPets.com

drhowarddrfine

You say 16-bit code was easier but you are just getting started?  I'm confused.  You don't need any windowing code, or windows at all, to learn 32-bit asm.  Or are you saying you know asm just not how to interface to Windows?  You have to learn asm before you mess with windowing stuff.  Or at least you should.

sinsi

QuoteCould someone tell me how to creat dialog boxes, read input from the boxes, open a file, edit a file, and save a file?
I've found that most Windows programming is knowing the Win32 API - looking up the functions in the SDK/MSDN/win32.hlp will usually tell you a lot
more than any comments would. If a function existed in DOS, chances are that win32 has one similar (or better).

Quote16 bit pure asm was so much easier.
32 bit pure asm is easy too...just add an E to everything (eax,esi,...) :bdg

Light travels faster than sound, that's why some people seem bright until you hear them.

dsouza123

The combination of MASM32 with the help file opcodes.hlp, the extensive example code,
Quick Editor (qeditor.exe) which gives access to the help files and many of the included tools
also getting the separate win32.hlp file that details the various API calls goes a long way
in writing 32 bit code.

Using some visual resource creating/editing utility will make creating dialogboxes easier.
The alternative is using a text editor on a rsrc.rc source text file but requires a multi step process of
alternately modifing text, compiling the resource, rebuilding the program to see the results.

The various example code covers reading input from editboxes, reading/writing files.
There is also the option of writing console mode 32 bit code, there are also examples for that.

The masm32 forum using search or just scanning posts and google search are quite invaluable.

Vortex

Quote16 bit pure asm was so much easier.

With the old segmented architecture, 16-bit asm is more difficult than 32-bit asm in my opinion.

Tedd

I recommend you get started using the GeneSys package - http://x86assembly.zapto.org/GeneSys.zip
It comes complete with a set of tutorials ('Iczelion') which will walk you through the basics of setting up a window, creating dialog boxes, doing text, etc -- after you've gone through about the first 6-7 you should get the hang of it and then be able to pick and choose whichever interest you most.
Just keep at it - it's easy once you know how :wink
No snowflake in an avalanche feels responsible.

WayneSallee

Quote from: Tedd on April 28, 2007, 01:14:06 PM
I recommend you get started using the GeneSys package - http://x86assembly.zapto.org/GeneSys.zip
It comes complete with a set of tutorials ('Iczelion') which will walk you through the basics of setting up a window, creating dialog boxes, doing text, etc -- after you've gone through about the first 6-7 you should get the hang of it and then be able to pick and choose whichever interest you most.
Just keep at it - it's easy once you know how :wink


Ok, I'm downloading it right now. Thanks.

Wayne Sallee
Wayne's Pets
Wayne@WaynesPets.com

WayneSallee

Quote from: drhowarddrfine on April 28, 2007, 03:36:12 AM
You say 16-bit code was easier but you are just getting started?  I'm confused.  You don't need any windowing code, or windows at all, to learn 32-bit asm.  Or are you saying you know asm just not how to interface to Windows?  You have to learn asm before you mess with windowing stuff.  Or at least you should.

Some of you may find this to be strange, but I have always found asm to be much easier to understand and work with than high level languages, such as those that are included in the asm32 examples.

And working in dos is different than working in windows, and if one is going to be doing 32 bit code, it only makes sence to do it in windows. It makes no sence to me to code in 32bit code and just stick with a dos style screen.

Wayne Sallee
Wayne's Pets
Wayne@WaynesPets.com

PBrennick

Wayne,
Your last statement is correct. Remember the advice given by dsouza 123. the win32.hlp file goes into great detail for each API that is listed in it. Not all of them are in there, but the major ones that you will use in the beginning are all there. After that, there is us. Everyone here is willing to help. The idea of the examples is to show you how some things are done, but remember to try monkeying with some of the code to observe what happens. If you go too far astray you can always reboot.

Have fun,
Paul
The GeneSys Project is available from:
The Repository or My crappy website

WayneSallee

Quote from: PBrennick on April 28, 2007, 11:38:22 PM
Wayne,
Your last statement is correct. Remember the advice given by dsouza 123. the win32.hlp file goes into great detail for each API that is listed in it. Not all of them are in there, but the major ones that you will use in the beginning are all there. After that, there is us. Everyone here is willing to help. The idea of the examples is to show you how some things are done, but remember to try monkeying with some of the code to observe what happens. If you go too far astray you can always reboot.

Have fun,
Paul


Ok, I'm downloading it now.

Wayne Sallee
Wayne's Pets
Wayne@WaynesPets.com

drhowarddrfine

There is much to learn in console mode but if you already know asm then doing Windows is just learning the API and how to interface to it.  My concern was getting enamored with the pretty blinking lights over actually learning how to code asm.

WayneSallee

    .data
    MyBox   db"This is my box",0
    MyText  db"This is my text",0
    MyData    db DWORD
               db  0

    .code
    mov     MyData,eax
    invoke MessageBox,0,addr MyText, addr MyBox,0


Ok how do I get the "move" statement to work? This mov works in 16 bit. And even the 32 bit examples show it this way.

Wayne Sallee
Wayne's Pets
Wayne@WaynesPets.com

japheth



    MyData    db DWORD
          db  0
         .code
    mov     MyData,eax



> This mov works in 16 bit.

No. And if you don't see the - obvious - problem you can't have much experience in ASM, at least not with MASM: "db DWORD" will not define a DWORD variable.

> and if one is going to be doing 32 bit code, it only makes sence to do it in windows

I bet there exist people who don't agree. Me, for example.



WayneSallee

Quote from: japheth on April 29, 2007, 05:28:38 AM


    MyData    db DWORD
          db  0
         .code
    mov     MyData,eax



> This mov works in 16 bit.

No. And if you don't see the - obvious - problem you can't have much experience in ASM, at least not with MASM: "db DWORD" will not define a DWORD variable.

> and if one is going to be doing 32 bit code, it only makes sence to do it in windows

I bet there exist people who don't agree. Me, for example.




In masm 16, I used Mydata DW 0
But masm 32 won't take that.
But you still have not answered my question.

And as far as not seeing the obvious, If you have never had a bug in a program that you looked for and looked for for ever finaly to find it and realize that the bug was so obvious, and were suprised that you did not see it, then you have not been doing much programing.

But as for me, it has been a number of years since I was deeply into computer programming. In fact most of my asm programing hours were spent years ago on a TRS 80 collor computer, with memory so small that you had to cut the program in pieces and then put the compiled code together to have the program. Then later I did some coding with masm 16, on windows 31, some on win 98, and some on windows xp, now I'm trying to get going on masm 32.

So why did you not answer my question? Were you affraid that you might give me a wrong answer, and that someone else would tell you that you were wrong?

Wayne Sallee
Wayne's Pets
Wayne@WaynesPets.com

hutch--

Wayne,

Just get the swing of how data allocation works in either the .DATA or .DATA? sections.

For initialised data (data with a preset value) it looks like this.


.data
  mynumber dd 1234
  mytext db "zero terminated text in quotes",0


With UNinitialised data its like this.


.data?
  mynumber dd ?
  mybuffer db 128 dup (?)


The code you posted,


    MyData    db DWORD


i simply a notation error, you have two (2) conflicting data sizes and the second is being used for what the content should be.

MyData is the data objects name, "db" is the data type and by derivation its unit size but the DWORD is trying to put a data type where the content should be.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php