News:

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

Win 7 Debug - Status of ASM for PC's ?

Started by Mel_3, March 18, 2012, 01:36:48 PM

Previous topic - Next topic

Mel_3

Way back I did some Assembly language programming for the PC using MASM and Turbo Assembler. Now I'm about to jump back in and do a couple of programming projects... but I would really like the ability to code (at least some of the project) in ASM.

It seems today's  high level languages and IDE's and Frameworks were hopefull of protecting the programmer from them self... and making programming easier by having the programmer not write the code but just call the code... or some such...

But, IMO they, in many cases, they have created a monster and the programmer is is often left clueless about what is really going on with the CPU, memory, peripherals... the computer... kinda like putting on a suit of armor before you ride a bicycle... so you are safe and secure... and to heck with how cumbersome it may be...

But enough whining :)

My Questions:

1 - Windows Command Line Debug:
I understand that Debug is not included in Windows 7 but I see "Debugging Tools for Windows" available as a download from Microsoft (I think)...
If so does this have the command line debug tool or something similar?
If not is there something similar to the command line debug available for Win7 (& Win8 when it comes out)?

2 - What about MASM32 for 64 bit Windows? Do you have to run the code in virtual 32 bit machine or is a 64 bit version in the works or what?

3 - What is the future of assembly language programming on Windows PC's? Are they making it more and more difficult?

4 - If you write a MASM32 application does it prevent other Windows applications from running while it is running or? How is multi-tasking with other Win Apps accommodated?

These are probably basic questions and I'm sure I can dig them out but was hopeful some kind soul would help me get a quick start :)

Thanks for any help.


jj2007

Hi Mel,
Welcome to the Forum :thumbu

> 1 - Windows Command Line Debug:
Forget command line debugging, and use Olly instead. REALLY.

> 2 - What about MASM32 for 64 bit Windows? Do you have to run the code in virtual 32 bit machine or is a 64 bit version in the works or what?
You can use 32-bit code as if it was a 32-bit OS.

> 3 - What is the future of assembly language programming on Windows PC's? Are they making it more and more difficult?
Opinions differ, but Win7 allows it, no problems, and even Win8 seems to work fine with Masm32.

> 4 - If you write a MASM32 application does it prevent other Windows applications from running while it is running or? How is multi-tasking with other Win Apps accommodated?
No such problems. You can run any number of other apps in parallel.

HTH, jj

dedndave

welcome to the forum, Mel   :U

command-line debugging was fine in single-app OS's like DOS - at least, i had no problems with it
like Jochen says, it just can't do the job under windows

donkey

Quote from: Mel_3 on March 18, 2012, 01:36:48 PM
1 - Windows Command Line Debug:
I understand that Debug is not included in Windows 7 but I see "Debugging Tools for Windows" available as a download from Microsoft (I think)...
If so does this have the command line debug tool or something similar?
If not is there something similar to the command line debug available for Win7 (& Win8 when it comes out)?

WinDbg is my debugger of choice, it handles 64 bit which last I checked OllyDbg does not and it integrates well into my home grown debug tools. It is available from Micrsoft as part of the Debugging Tools for Windows x64.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

Mel_3

Great help Guys !

Thanks for the quick and help full response.

Just wondering if MS offers anything like the old MASM now days... or do they want you to write your assembly language in the Visual Studio C as a Win32 Console App?
(per http://social.msdn.microsoft.com/Forums/en/vcgeneral/thread/3e24f203-c516-41e2-a7bf-325452157336)

Not that I'm going to do that as I'm really looking forward to using MASM32 !

Finally, I see my post was moved. No problem. But is this the forum for newbie's to ask getting started and basic questions? For instance...

- How to use an existing dll from your own asm app?
- How to create a dll from scratch in asm
- How to access and use windows API's via asm
- Are asm calls to the bios still available and useable and advantageous vs other ways?
- Are any of the old DOS interrupt calls still available, useable, and advantageous vs other ways?
- How to create a "window" and a "button" and other 'controls' using ASM (API calls?)
- How to detect an event... like a mouse click on a button, or an 'on open' event or whatever using asm

Those are some of the things I'll be digging around for and if I can't find a satisfactory explanation... where would I post such questions on thee masm32 fourms?

Thanks again for the help !



donkey

Hi Mel,

Quote- How to use an existing dll from your own asm app?

If the DLL has an INC and LIB file, you can include those in your application and call the functions in the DLL via invoke. If it doesn't you always have the LoadLibrary/GetProcAddress functions. There are tools around to create import library files (LIB) that should be useful.

Quote- How to create a dll from scratch in asm

You have to follow the Microsoft specification for a DLL, that is you need to export at least an entry point function (DllMain or some such the name doesn't matter) and it has to respond correctly. Once you have done that you can add other functions and export them in a DEF file. Then use MASM to assemble your project into an OBJ file and LINK to build the DLL from that, the command line options for LINK determine what type of executable it builds (EXE, DLL, SYS). There are many example projects on the board to get you started.

Quote- How to access and use windows API's via asm

Include the INC and LIB file for the particular API library you want (for example User32.dll) and call the functions with INVOKE. You will also need to include the standard definitions, they can be found in Windows.INC

Quote- Are asm calls to the bios still available and useable and advantageous vs other ways?

No, not directly in protected mode (user mode), some of the bios can be accessed through special functions like DeviceIoControl etc. though there is rarely a reason to do so and it can be fairly dangerous.

Quote- Are any of the old DOS interrupt calls still available, useable, and advantageous vs other ways?

DOS is dead, leave it to rest in peace.

Quote- How to create a "window" and a "button" and other 'controls' using ASM (API calls?)

CreateWindowEx is what you're looking for. You can also use a resource editor and create a full window with controls with a graphical UI. RadAsm is pretty good as is Easy Code, look in the IDE Development and Support forum for one you like.

Quote- How to detect an event... like a mouse click on a button, or an 'on open' event or whatever using asm

All windows and controls have a message queue and are sent messages by Windows about events. When you create your main window the thread it is run in recieves messages that you then dispatch to a message handling procedure. Generally you allow Windows to just do the default handling for messages however in many cases you might want to do something special and process the message in your handler. Button presses are generally sent to the main window via a WM_COMMAND message, you can look at pretty much any GUI program here and get an idea how a message handler works.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

GregL

Quote from: Mel_3Just wondering if MS offers anything like the old MASM now days... or do they want you to write your assembly language in the Visual Studio C as a Win32 Console App?
(per http://social.msdn.microsoft.com/Forums/en/vcgeneral/thread/3e24f203-c516-41e2-a7bf-325452157336)

Every new version of Visual Studio comes with a new version of MASM for both 32-bit and 64-bit. You can use ml.exe and ml64.exe from either the command-line or in the Visual Studio IDE. You can write both Console apps and GUI apps.


Mel_3

Great info to get me started.

Very helpful !!!

Thanks again Guys for the super comments and suggestions.