Code Comments
Programming Forum and web based access to our favorite programming groups.hi, I'm an experienced C# programmer i also know quite a couple of other things. I tried to learn x86 asm before and got turned off/stuck with the complex compiling and the never ending types of compilers (TASM,MASM,DASM??) .... I finally found a nice tutorial but i can't seem to compile the source code!? http://drpaulcarter.com/pcasm/ I downloaded the Microsoft Source code on the bottom, but im having some problems compiling it. http://drpaulcarter.com/pcasm/ms-ex.zip I've got nasm.... .... In the source file itself is says: ; Using MS C/C++ ; nasm -f win32 first.asm <-----------This works fine, i get first.obj outputted. ; cl first.obj driver.c asm_io.obj <---------- Were do i get cl from? It didn't come with NASM??(I have the other files) I'm guessing cl is a linker right? How do i get it? Thanks so much Gideon
Post Follow-up to this messagegiddy wrote: > hi, > > I'm an experienced C# programmer i also know quite a couple of other > things. > > I tried to learn x86 asm before and got turned off/stuck with the > complex compiling and the never ending types of compilers > (TASM,MASM,DASM??) .... > > I finally found a nice tutorial but i can't seem to compile the source > code!? > http://drpaulcarter.com/pcasm/ > > I downloaded the Microsoft Source code on the bottom, but im having > some problems compiling it. > http://drpaulcarter.com/pcasm/ms-ex.zip > > I've got nasm.... .... > In the source file itself is says: > ; Using MS C/C++ > ; nasm -f win32 first.asm <-----------This works fine, i get > first.obj outputted. > ; cl first.obj driver.c asm_io.obj <---------- Were do i get cl from? > It didn't come with NASM??(I have the other files) > > I'm guessing cl is a linker right? How do i get it? Should be some part of "MS C/C++"... It's looking for a compiler - which invokes the linker... which links first.obj, driver.obj, and asm_io.obj into "first.exe". "driver.c", as you've probably seen, contains "main", and just calls "asm_main"... which is declared (as "global") in your "first.asm". "asm_io.obj" can be assembled with Nasm from "asm_io.asm", if you haven't got it... or it turns out not to be the right format. The idea of Dr. Carter's tut using C for all the I/O (that's what "asm_io.asm" does) is that it'll work cross platform. Works slick on Linux... where everybody uses gcc, pretty much. Under Windows, there's more choice. If "cl" isn't what you type to compile a C program, try whatever you *do* use. Same thing, just some of the object files are made from asm, not C. If for some reason the compiler you're using isn't liking Dr. Carter's tut, post the error messages, and we can probably fix it. Best, Frank
Post Follow-up to this messageHi Frank, Thanks so much for your reply. > The idea of Dr. Carter's tut using C for all the I/O (that's what > "asm_io.asm" does) is that it'll work cross platform. Works slick on > Linux... where everybody uses gcc, pretty much. Under Windows, there's > more choice. If "cl" isn't what you type to compile a C program, try > whatever you *do* use. Same thing, just some of the object files are > made from asm, not C. > > If for some reason the compiler you're using isn't liking Dr. Carter's > tut, post the error messages, and we can probably fix it. I use visual studio 2005 for C/C++ !! I only used turbo c for a few ws, years ago when i started C but then took off with VC6.I don't think i have turbo C anymore? Do you think TC will work? Any other ideas!? Thanks so much Gideon
Post Follow-up to this messageOn Sun, 23 Mar 2008 00:51:51 -0700 (PDT), I waved a wand and this message magically appears in front of giddy: > ; cl first.obj driver.c asm_io.obj <---------- Were do i get cl from? > It didn't come with NASM??(I have the other files) > > I'm guessing cl is a linker right? How do i get it? Download and install OpenWatcom 1.7. It comes with WLINK, which will do the job. I use WLINK for linking object files. -- http://www.munted.org.uk Fearsome grindings.
Post Follow-up to this messageFrank Kotler wrote: > giddy wrote: > > Should be some part of "MS C/C++"... It's looking for a compiler - which > invokes the linker... which links first.obj, driver.obj, and asm_io.obj > into "first.exe". "driver.c", as you've probably seen, contains "main", > and just calls "asm_main"... which is declared (as "global") in your > "first.asm". "asm_io.obj" can be assembled with Nasm from "asm_io.asm", > if you haven't got it... or it turns out not to be the right format. > > The idea of Dr. Carter's tut using C for all the I/O (that's what > "asm_io.asm" does) is that it'll work cross platform. Works slick on > Linux... where everybody uses gcc, pretty much. Under Windows, there's > more choice. If "cl" isn't what you type to compile a C program, try > whatever you *do* use. Same thing, just some of the object files are > made from asm, not C. > > If for some reason the compiler you're using isn't liking Dr. Carter's > tut, post the error messages, and we can probably fix it. > > Best, > Frank > cl is the Microsoft C/C++ command line compiler. You can download the free Visual Studio C++ 2008 Express program from MS to get. http://www.microsoft.com/express/product/ You will need to open a Visual Studio Command Prompt to create a Command window that has it's environment set up to use cl. (An entry for this prompt is added to the Visual Studio Express start menu and to the program's menu too.) My tutorial assumes you are familiar with C so it doesn't cover how to use your C compiler. HTH Paul Carter
Post Follow-up to this messageoh sorry! One more question!!! how do i use the Makefile? Thanks so much Gideon
Post Follow-up to this message> cl is the Microsoft C/C++ command line compiler. You can download the > free Visual Studio C++ 2008 Express program from MS to get. Thats all i needed to know!!! Thanks I have the whole Visual Studio 2005 and i didn't know cl.exe came with it!... so yes, i have had cl.exe on my pc(for 2 years now) Like i said, i'm a real noob about anything "non-visual"! =P Thanks again! Gideon
Post Follow-up to this messagegiddy wrote: > oh sorry! One more question!!! > > how do i use the Makefile? > > Thanks so much > Gideon > nmake comes with VS 2005 too. general use: nmake <what you want to build> for example, typing: nmake prime.exe will build the prime example program -- Paul Carter
Post Follow-up to this messageand it almost never ends!.......... but i did manage to get to first.exe so this is for anyone else who has the same problems. I tried using cl.exe and i got Application failed to start 'mspdb80.dll' missing. Seems the environment variables needed by Visual Studio were missing/ not present, the file vSvars32.bat fixes everything, there is another file vCvars32.bat that just runs the earlier file. This wasn't the end of it, the batch file did not work for some reason, i tried running it in every different way. None of the env vars were actually set. I ended up copying the "missing" dll files from my VS Install dir to the VC\Bin, which is mentioned in some post on forums.microsoft.com, after that i still got a link error 'some lib file missing', for that i manually set LIB=G:\Microsoft Visual Studio 8\VC\ATLMFC\LIB;G:\Microsoft Visual Studio 8\VC\LIB;G:\Microsoft Visual Studio 8\VC\PlatformSDK\lib;G: \Microsoft Visual Studio 8\SDK\v2.0\lib; (I'm guessing setting all the Env vars mentioned in vsvars.bat should fix any other errors) So finally i got first.exe created! And somehow it was terribly exciting to see the output of the program that took all that effort! lol -Gideon
Post Follow-up to this messagegiddy wrote: > and it almost never ends!.......... but i did manage to get to > first.exe so this is for anyone else who has the same problems. > > I tried using cl.exe and i got Application failed to start > 'mspdb80.dll' missing. > > Seems the environment variables needed by Visual Studio were missing/ > not present, the file vSvars32.bat fixes everything, there is another > file vCvars32.bat that just runs the earlier file. This wasn't the end > of it, the batch file did not work for some reason, i tried running it > in every different way. None of the env vars were actually set. > > I ended up copying the "missing" dll files from my VS Install dir to > the VC\Bin, which is mentioned in some post on forums.microsoft.com, > after that i still got a link error 'some lib file missing', for that > i manually set > > LIB=G:\Microsoft Visual Studio 8\VC\ATLMFC\LIB;G:\Microsoft Visual > Studio 8\VC\LIB;G:\Microsoft Visual Studio 8\VC\PlatformSDK\lib;G: > \Microsoft Visual Studio 8\SDK\v2.0\lib; > > (I'm guessing setting all the Env vars mentioned in vsvars.bat should > fix any other errors) > > So finally i got first.exe created! And somehow it was terribly > exciting to see the output of the program that took all that effort! > lol > > -Gideon > Something must be messed up with your install. I've had none of this trouble. I just use the VS 2005 Command Prompt (which sets up the environment by using one of the bat files you mention) and everything works. You did try this, right? -- Paul Carter
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.