News:

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

Help Compiling First Program

Started by Titan, February 23, 2005, 04:31:42 AM

Previous topic - Next topic

Titan

GoAsm looks very interesting... and I am very eager to start reading up on it!  I have limited knowledge in MASM, but I think the transition should be fun and easy. :)

I have a program that does absolutely nothing:

CODE SECTION
START:
RET


But even when I try to compile this, I receive the following error:
Quote
GoAsm.Exe Version 0.52 - Copyright Jeremy Gordon 2001/4 - JG@JGnet.co.uk
Output file: GoNothing.obj

GoLink.Exe Version 0.25.4 - Copyright Jeremy Gordon 2002/4 - JG@JGnet.co.uk

Error!
Could not open command file
Output file not made

Make error(s) occured.
Total compile time 341 ms
What is this "command file" supposed to be?  I'm pretty sure I have everything set up correctly.  This is frustrating I can't even get a nothing-program to compile. :(

I'm also wondering how, with RadASM, I can edit how my project compiles?  If I'm not mistaken... you have to specify all of the libraries to be included, as there is no "Include" macro.  Problem is, if I decide to use a library in the middle of my program, I'm not sure where I can edit the compile settings.

Thanks!
Titan

donkey

A command file is a file that is used by the linker (usually) and is specified with the @Filename in the command line. For my projects and the RadASM implementation of GoAsm I have set up a gfl.txt file in the GoAsm\Bin folder to list all of the DLL's normally imported from. I suspect you do not have this file. I will paste the text here, you have only to copy it and paste it into a text file...

QuoteKernel32.dll
User32.dll
Gdi32.dll
shell32.dll
comctl32.dll
comdlg32.dll
ole32.dll
oleaut32.dll
advapi32.dll
shlwapi.dll
odbc32.dll
riched20.dll
version.dll
winsock.dll
winmm.dll
msvcrt.dll
wininet.dll
HHCtrl.OCX
WINSPOOL.DRV
PSAPI.DLL
msimg32.DLL
crtdll.dll
"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

Titan

Hey thanks donkey, I got a nothing program working. ;)  Now I get the following error while trying to compile a simple "Hello World" application:
Quote

GoAsm.Exe Version 0.52 - Copyright Jeremy Gordon 2001/4 - JG@JGnet.co.uk
Output file: HiWorld.obj

GoLink.Exe Version 0.25.4 - Copyright Jeremy Gordon 2002/4 - JG@JGnet.co.uk

Warning!
Specified entry point (Start@0) was not found.
Output file: HiWorld.exe size: 2,048 bytes
Executing:
"C:\RadASM\GoAsm\Projects\HiWorld\HiWorld.exe"

Make finished.
Total compile time 300 ms
It does build the EXE, but when I go to run it it doesn't display "Hello World" and just instantly crashes.  My HelloWorld source is directly off of the GoAsm webpage so I know my code is not the problem.

donkey

Hi,

Once again you have run into my RadASM implementation, I use Start: instead of START: for my entry point, just change the case and it should be fine. Or you can edit the GoAsm ini file to remove the /entry Start directive from the command lines and use the default. I geuss I should have used START as it is more in tune with what GoAsm expects but it would have broken too much of my code to change it so I left Start: instead. If you read the GoAsm section of the RadASM help file I wrote you will get a complete breakdown of what my implementation expects to see. Again this is not a problem with either RadASM or GoAsm, mostly it is just that I originally posted my INI files for others to use and because of that it expects it to be coded in the style I generally use. I will possibly do a complete rewrite of the INI files and templates one day to better follow what GoAsm expects to see and have them work better out of the box. I have considered a way to automatically generate the GFL.TXT file for the compile as well.
"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

Titan

Thank you donkey, I've completed my first program in GoAsm. :U

I've been skimming the GoAsm tutorials, and this seems to be exactly what I'm looking for.  With MASM, the syntax was so high-level that I failed to grasp some of the basics that it tries to "simplify" for me.  I'm off to start the tutorials, and thanks again.:)

donkey

Hi Titan,

I am very glad to hear that you're up and running  :U

I think that you will find GoAsm very powerful and easy to follow, the fact that it is unambiguous is it's biggest advantage in my opinion. The lack of high level constructs has never bothered me and ofcourse the more powerful scoping, unicode support and invoke function are very useful.

If you have any more questions or concerns don't hesitate to ask.
"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

Titan

Wow, donkey, I was excited at first, but the more I play with this the more discouraged I get.  It seems to be insanely buggy.

I would compile the EXACT SAME CODE, and some times it would launch fine, and others it would crash.  All I was doing was moving tabbing a label back and forth.  Sometimes it would compile and run, others it would crash... even though it's the EXACT SAME CODE every time.  Is GoAsm not insanely buggy for you either?  I can't get anything done, I don't see how you do.

donkey

Hi Titan

I don't have any problems of that type at all and I have some very large projects. In general GoAsm is extremely stable and reliable. If you could perhaps zip up the project that is giving you problems I can find out why. Include both a crashing and uncrashing version, though the one that crashes is the most important to find where the problem is. You can email it to me directly at the address below or post it here and I will definitely look into the source of your problem.

Any new software system is frustrating at first, I already had experience with MASM and found the switch to GoAsm a bit tough, I can't imagine what it is like for someone without any assembly background. But take heart, you are using what in my opinion is the best of breed when it comes to assemblers and though the learning curve is a bit steep, it is definitely worth the climb.

Also, no matter how large the problem I will help as best I can, in some cases I will not be able to specifically answer your concerns but for the most part I can answer many of your questions. If I'm not able we have many others who are much more capable than I am, including Jeremy himself.
"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

Titan

#8
It seems to be a problem with my jumps.  Is there any warnings you can give me as to the composition of my jumps?  Is the compiler sensative of my indents?  That seems to be where my problem is....

Edit: Finished my program, it was just one I had from MASM that I was converting.  I'm having some difficulties without using the IFs and making everything run smoothly, but I'm getting better at it now. :)

donkey

Hi Titan,

The only errors jump composition will give are jumps to nowhere or short jumps over 127 bytes. In the latter case it will inform you how many bytes you missed the short jump by so you can either reduce the size of the code or use a long jump. Though I have found that WHILE, REPEAT etc... are easy enough to port from MASM, I agree that the most difficult transition was IF. It is exceedingly useful when using large compare blocks but once you get it your code will be much better without it. After all, it will be up to you how your block is structured and you can weed out many unnecessary jmps in the IF/ENDIF blocks of MASM.
"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

jorgon

Titan

If you come across any bugs in any of the "Go" tools I would be grateful if you could either post the code on this forum or send it directly to me at the email address displayed in the copyright notice when you run any of the tools.

I do aim to fix bugs soon after they are reported.  Having said that, I am aware of a couple of bugs reported on the forum which I have not yet got round to.

Thanks

Jeremy
Author of the "Go" tools (GoAsm, GoLink, GoRC, GoBug)

AeroASM

Quote from: Titan on February 24, 2005, 03:19:44 AM
With MASM, the syntax was so high-level

I disagree, and so does hutch (I think).

With MASM you can write as low level as you want; you are not forced to write in a high-level style (unlike HLA).
If you wanted to write low level stuff, then why didn't you?

donkey

Quote from: AeroASM on March 09, 2005, 06:47:00 PM
Quote from: Titan on February 24, 2005, 03:19:44 AM
With MASM, the syntax was so high-level

I disagree, and so does hutch (I think).

With MASM you can write as low level as you want; you are not forced to write in a high-level style (unlike HLA).
If you wanted to write low level stuff, then why didn't you?

And ofcourse you can write asm in C, but a langauge is judged by it's constructs, not the fact that it also does low level assembly. Otherwise you could say the same about PowerBasic. And BTW,in assembly there are no types so you do not have to do type casting, something that is very common in MASM, and something that you cannot turn off, a high level syntax whose origins you find in C.
"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