News:

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

Help with Masm 32 Bit Assembly

Started by Gio, April 26, 2006, 04:33:37 AM

Previous topic - Next topic

Gio

Hey guys, I've been trying to get some useful websites to learn about Masm 32 bit assembly. So, if you can, I would really appreciate someone posting any useful websites. I'm trying to create a Ping Pong program which I have less than 3 weeks to complete. And if you can, please post me some helpful suggestions that can get me started immediately, how do I go about handling the video memory? And what about threading? I want to be able to simultaneously control the input/output processes. Thanks.

hutch--

Gio,

This sounds suspiciously like homework and no-one will do it for you. People here wil help you learn to write assembler but you must be willing to do your own work. Tell us a bit more about your assignment, what tools you are using and we may be able to point you in the right direction.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

Mark Jones

Hello Gio and welcome to the group. What kinds of limitations are there, both in terms of the design goals and your abilities? (i.e., does the result have to be a text-mode console app, or a truecolor OpenGL app? And do you have a limited set of libraries or the whole MASM32 feature set?)

If you've got decent assembler skills you might want to look at the examples in Hitchikr's OpenGL forum here. He has several examples of sprites and sprite animation, which are perfect for your application. Pong could also be realized with traditional window GDI functions, but the results wouldn't be as nice. Still, that might be easier for a student. If you have to go this "traditional" route, here's some starting points. See what MSDN has to say about graphics. Also if you have the WIN32.HLP file, look in there for GetSystemMetrics, GetDC, BeginPaint, and InvalidateRect. Check out this thread. Robert Beiber made a random graphics-drawing routine, maybe you could learn from that. Most of this stuff was found by using the search box at the top of this page. These things should get you started. Enjoy! :bg
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

Gio

Quote from: hutch-- on April 26, 2006, 04:45:33 AM
Gio,

This sounds suspiciously like homework and no-one will do it for you. People here wil help you learn to write assembler but you must be willing to do your own work. Tell us a bit more about your assignment, what tools you are using and we may be able to point you in the right direction.

Yes I'm doing this as a final project for my assembly class. But no, getting anyone's direct solution to this isn't gonna help me and thats the last thing I would ever need. Maybe I can decipher a few examples here and there, but thats it, I just need a starting point. I'm using MASM assembler, and I decided to go with 32bit mode the reasons of muli-threading, painting objects onscreen, and thats it.

Quote from: Mark Jones on April 26, 2006, 05:54:36 AM
Hello Gio and welcome to the group. What kinds of limitations are there, both in terms of the design goals and your abilities? (i.e., does the result have to be a text-mode console app, or a truecolor OpenGL app? And do you have a limited set of libraries or the whole MASM32 feature set?)


If you've got decent assembler skills you might want to look at the examples in Hitchikr's OpenGL forum here. He has several examples of sprites and sprite animation, which are perfect for your application. Pong could also be realized with traditional window GDI functions, but the results wouldn't be as nice. Still, that might be easier for a student. If you have to go this "traditional" route, here's some starting points. See what MSDN has to say about graphics. Also if you have the WIN32.HLP file, look in there for GetSystemMetrics, GetDC, BeginPaint, and InvalidateRect. Check out this thread. Robert Beiber made a random graphics-drawing routine, maybe you could learn from that. Most of this stuff was found by using the search box at the top of this page. These things should get you started. Enjoy! :bg

Although I'm only limited to 16-bit assembly, which is basically all I've learned, I think the only way I can create this Pong game is by using 32-bit assembly. I'm good with C, FoxPro, and Java and from time to time I play around with some Windows API functions (mainly in C), so I have experience there. My major problem with creating the Pong program is having it handle multiple processes simulaneously like waiting for the user input to move the paddles, and at the same time, moving both the ball and the opposing computer paddle. My best guess to approach this is through multi-threading, and I'm not sure if thats possible in 16-bit assembly. I do a lot of threading in C so I just need to know how it is done in Assembly. Maybe I can change my algorithmn? I dunno, I guess threading is a definate...

I know this sounds overly impossible considering I have three weeks to get it done, but I'm willing.

Mark Jones

Quote from: Gio on April 29, 2006, 05:09:34 PM
Although I'm only limited to 16-bit assembly, which is basically all I've learned, I think the only way I can create this Pong game is by using 32-bit assembly.

Hi Gio. Let me see if I understand you correctly, you have lots of 16-bit DOS experience, but want to make a 32-bit Windows GUI version of Pong? We need to make sure we're talking about the same things. :)

QuoteI'm good with C, FoxPro, and Java and from time to time I play around with some Windows API functions (mainly in C), so I have experience there. My major problem with creating the Pong program is having it handle multiple processes simulaneously like waiting for the user input to move the paddles, and at the same time, moving both the ball and the opposing computer paddle. My best guess to approach this is through multi-threading, and I'm not sure if thats possible in 16-bit assembly.

Each Windows 32-bit graphical app gets "messages" sent to its WindProc each time a key is pressed or the mouse is moved, etc. Timers can be setup to update the display, etc., see the SetTimer API at MSDN or WIN32.HLP. So in this respect, every GUI app is already like "multi-threading." Take a look in \masm32\icztutes\tute03 - this explains what a window procedure is and how it is used. Does this help?
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

GregL

Hi Gio,

If you have experience with 32-bit Windows programming in C, it's done the same way, just with a different syntax. The basic concepts are the same. Look at the stuff Mark pointed you to. The Iczelion tutorials are very good. Have fun.




Gio

Oh thanks, that helped a lot. I'm glad to see things are getting clearer and clearer by the minute. If theres ever one thing you can love about programmers, is that we all work as a community. Thanks guys. I'll keep you posted if theres anything else I'm having problems with.

Gio

Quote from: Greg on April 29, 2006, 06:23:47 PM
Hi Gio,

If you have experience with 32-bit Windows programming in C, it's done the same way, just with a different syntax. The basic concepts are the same. Look at the stuff Mark pointed you to. The Iczelion tutorials are very good. Have fun.


Yeah I'm beginning to realise that now. Supprisingly, it doesn't seem as complicated as I'd expect.