News:

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

which assembler is this?

Started by sancho1980, November 22, 2006, 11:27:07 PM

Previous topic - Next topic

sancho1980

hi
i've downloaded masm because i want to test the example code in "the undocumented pc" book by frank van gilluwe (which i've just purchased)
now, i've got the following problem: loading and building the masm example code works fine
but when trying to build the example code in the book, i get compile errors; am i using the wrong assembler?
unfortunately, the book doesnt say anything about the assembler that should be used.
i've attached an example asm file from the book, could someone of you tell me how ill get this compiled.
this is the error i get:

Assembling: C:\test\BIOSVIEW.asm
C:\test\undocpc.inc(73) : error A2085: instruction or register not accepted in c
urrent CPU mode
C:\test\undocpc.inc(74) : error A2034: must be in segment block
C:\test\undocpc.inc(75) : fatal error A1008: unmatched macro nesting
_
Assembly Error
Drücken Sie eine beliebige Taste . . .

Thanx,

Martin

[attachment deleted by admin]

PBrennick

I cannot test it because I do not have undocpc.inc
I need to see that file so I can find out if it contains the cpu and model declarations.

Paul
The GeneSys Project is available from:
The Repository or My crappy website

MichaelW

Martin,

It is old MASM code, for a 16-bit EXE. There were major changes to MASM starting with version 6.0, so to assemble it with version 6.14 you need to add the /Zm switch to the ML command line, or add an OPTION M510 directive at the start of the source file. In case you don't know already, you need a 16-bit linker to create the EXE.

eschew obfuscation

sancho1980

Quote from: MichaelW on November 23, 2006, 07:11:00 AM
Martin,

It is old MASM code, for a 16-bit EXE. There were major changes to MASM starting with version 6.0, so to assemble it with version 6.14 you need to add the /Zm switch to the ML command line, or add an OPTION M510 directive at the start of the source file. In case you don't know already, you need a 16-bit linker to create the EXE.



Where can I get this old linker and how do I have to write this m510 option at the start of the source file (just like that: M510???)
How do I start the compilation and linking. Can this still be done from inside the editor?

Thanx,

Martin

MichaelW

You can get the 16-bit linker here. Both linkers have the same name, so take care to avoid overwriting the 32-bit linker when you extract the 16-bit linker. I, like others here, rename the 16-bit linker to LINK16 to avoid confusing the two.

Write the directive as "OPTION M510", without the quotes.

You can assemble and link, and create an assembly listing and a map file, with command lines like this:

ML /Fl /c biosview.asm
LINK16 biosview.obj,,biosview;

Qeditor is set up for 32-bit Windows applications. You could assemble from within the editor, but that's about it. I put all of my 16-bit DOS stuff in a separate directory, along with copies of ML.EXE and ML.ERR, and the 16-bit linker, and assemble and link with batch files.
eschew obfuscation

sancho1980

Quote from: MichaelW on November 23, 2006, 07:41:12 AM
You can assemble and link, and create an assembly listing and a map file, with command lines like this:
ML /Fl /c biosview.asm
LINK16 biosview.obj,,biosview;

Thanx for your very clear directions. Alas, I still get an assembly error, which looks like this:

C:\PROGRA~1\masm32\bin>ml /Fl /c BIOSVIEW.ASM
Microsoft (R) Macro Assembler Version 6.14.8444
Copyright (C) Microsoft Corp 1981-1997.  All rights reserved.

Assembling: BIOSVIEW.ASM
BIOSVIEW.ASM(39) : fatal error A1010: unmatched block nesting

Any more suggestions?

Thanx,

Martin

MichaelW

Yes, I forgot about making that change. The statement should be "BMSG ends".
eschew obfuscation

sancho1980


sancho1980

for sure:
some of the example code in the book is supposed to be assembled and linked into a com file
how do i achieve that?
thanx,

martin

PBrennick

Have you tried the /AT option in ml.exe?

from the command prompt, you can type ml.exe /? to see these various options.

Paul
The GeneSys Project is available from:
The Repository or My crappy website

MichaelW

The ML command line would be the same as for an EXE.

LINK16 options <objs>,<exefile>,<mapfile>,<libs>,<deffile>

To create a COM file, the minimum command line would be:

LINK16 /tiny filename.obj;

Or specify the executable file name in the <exefile> field to avoid the "name of output file is filename.com" warning:

LINK16 /tiny filename.obj,filename.com;

A source that uses the simplified segment definitions need not specify a tiny memory model, but regardless of how the segments are defined, the source must not contain far segment references.
eschew obfuscation

kermit

Quote from: sancho1980 on November 23, 2006, 09:20:31 AM
for sure:
some of the example code in the book is supposed to be assembled and linked into a com file
how do i achieve that?
thanx,

martin

you can use the
.model tiny command on top of the source code

sancho1980

thank you
that helps
one more question: i also have a couple source examples which i think were written for tasm; the examples here deal with protected mode and how to switch over to it..what kind of an assembler would i need to compile this? 16 or 32 bit? is there a way to compile this using masm?
i've attached an example so you can have a look at it yourself!
thanx,
martin

[attachment deleted by admin]

PBrennick

What I meant to say is you need to enable Tiny mode if you are using the 32 bit assembler. You use the /AT switch to do that. It is in the docs.

Paul
The GeneSys Project is available from:
The Repository or My crappy website

Zest

Hi,
The question is if this book is worth buying considering its old materials?
I mean this book"The Undocumented PC".
Please let me know.
Regards,
Zest.