Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

asm noob needs help compiling tutorial samples!?
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


Report this thread to moderator Post Follow-up to this message
Old Post
giddy
03-23-08 09:01 AM


Re: asm noob needs help compiling tutorial samples!?
giddy 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


Report this thread to moderator Post Follow-up to this message
Old Post
Frank Kotler
03-23-08 12:58 PM


Re: asm noob needs help compiling tutorial samples!?
Hi 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


Report this thread to moderator Post Follow-up to this message
Old Post
giddy
03-23-08 11:59 PM


Re: asm noob needs help compiling tutorial samples!?
On 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.


Report this thread to moderator Post Follow-up to this message
Old Post
Alex Buell
03-23-08 11:59 PM


Re: asm noob needs help compiling tutorial samples!?
Frank 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


Report this thread to moderator Post Follow-up to this message
Old Post
Paul Carter
03-23-08 11:59 PM


Re: asm noob needs help compiling tutorial samples!?
oh sorry! One more question!!!

how do i use the Makefile?

Thanks so much
Gideon


Report this thread to moderator Post Follow-up to this message
Old Post
giddy
03-23-08 11:59 PM


Re: asm noob needs help compiling tutorial samples!?

> 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


Report this thread to moderator Post Follow-up to this message
Old Post
giddy
03-23-08 11:59 PM


Re: asm noob needs help compiling tutorial samples!?
giddy 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


Report this thread to moderator Post Follow-up to this message
Old Post
Paul Carter
03-23-08 11:59 PM


Re: asm noob needs help compiling tutorial samples!?
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


Report this thread to moderator Post Follow-up to this message
Old Post
giddy
03-25-08 03:04 AM


Re: asm noob needs help compiling tutorial samples!?
giddy 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


Report this thread to moderator Post Follow-up to this message
Old Post
Paul Carter
03-25-08 03:04 AM


Sponsored Links




Last Thread Next Thread Next
Pages (2): [1] 2 »
Search this forum -> 
Post New Thread

A86 Assembler archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:15 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.