The MASM Forum Archive 2004 to 2012

Miscellaneous Forums => 16 bit DOS Programming => Topic started by: sancho1980 on November 22, 2006, 11:27:07 PM

Title: which assembler is this?
Post by: sancho1980 on November 22, 2006, 11:27:07 PM
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]
Title: Re: which assembler is this?
Post by: PBrennick on November 23, 2006, 01:51:08 AM
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
Title: Re: which assembler is this?
Post by: 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.

Title: Re: which assembler is this?
Post by: sancho1980 on November 23, 2006, 07:22:22 AM
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
Title: Re: which assembler is this?
Post by: MichaelW on November 23, 2006, 07:41:12 AM
You can get the 16-bit linker  here (http://spiff.tripnet.se/~iczelion/download.html). 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.
Title: Re: which assembler is this?
Post by: sancho1980 on November 23, 2006, 08:26:06 AM
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
Title: Re: which assembler is this?
Post by: MichaelW on November 23, 2006, 08:34:48 AM
Yes, I forgot about making that change. The statement should be "BMSG ends".
Title: Re: which assembler is this?
Post by: sancho1980 on November 23, 2006, 08:49:38 AM
thank you!
that helped!
Title: Re: which assembler is this?
Post by: 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
Title: Re: which assembler is this?
Post by: PBrennick on November 23, 2006, 08:05:43 PM
Have you tried the /AT option in ml.exe?

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

Paul
Title: Re: which assembler is this?
Post by: MichaelW on November 24, 2006, 02:28:17 AM
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.
Title: Re: which assembler is this?
Post by: kermit on November 25, 2006, 10:32:16 AM
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
Title: Re: which assembler is this?
Post by: sancho1980 on November 25, 2006, 12:37:23 PM
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]
Title: Re: which assembler is this?
Post by: PBrennick on November 26, 2006, 02:25:06 AM
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
Title: Re: which assembler is this?
Post by: Zest on November 27, 2006, 03:55:33 AM
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.
Title: Re: which assembler is this?
Post by: MichaelW on November 27, 2006, 09:34:52 AM
Hi Paul,

I started using MASM before 6.0 appeared, when there was no /AT switch. I tested it just now, and it does work, but ML expects the 16-bit linker to be named LINK.EXE, instead of LINK16.EXE as I normally name it. You can specify an alternate linker, but for anything unusual you still need to know the linker command line syntax, so IMO it's easier, and simpler, to assemble and link in separate steps.
Title: Re: which assembler is this?
Post by: MichaelW on November 27, 2006, 05:53:21 PM
Quote from: Zest on November 27, 2006, 03:55:33 AM
The question is if this book is worth buying considering its old materials?
I mean this book"The Undocumented PC".

I have the first edition, copyright 1994. To me it was definitely worth buying, and I have used it so much that it is falling apart, and when it's convenient to do so I will probably buy a later edition. But I use and work on relatively old hardware, and for that most of the information in the book is still applicable.
Title: Re: which assembler is this?
Post by: PBrennick on November 27, 2006, 11:30:19 PM
I remember buying this book a long time ago tha t I bought that book. It was VERY useful to 'me,' whether or not it will be useful to you is inderterminant. You need to make your own decision. I like to know everything, though. Remember that most of those undocumented things are no long in use by recent CPUs so unless you have an old machine, I would say NO.

Michael,
Thanks for testing. I did, also. Like you, I do not use that method. It is good to know it, though, in case someone asks for help who is using it. I do not like to force my preferences on others, so I like to express ALL methods and leave the choice of methods to the learner.

Paul
Title: Re: which assembler is this?
Post by: Zest on November 29, 2006, 06:13:46 AM
Hi,
Thanks Michael and Paul.
I have placed an order for purchasing this book.
Hopefuly it is not out of print and it's still available.

By the way, Michael, the last book you recommneded me purchase was put of print.
I mean "Undocumented DOS" by "Andrew Schulman"
http://www.awprofessional.com/bookstore/product.asp?isbn=0201570645&redir=1&rl=1

I couldn't find it anywere.
So I sent an email to its publisher to purchase at leat ane EBook version of the book.
Here is their response:
Quote
Response (Christine) 11/27/2006 11:13 AM
Dear Sourav Parmar,

Thank you for your inquiry. Unfortunately, the titles below are not available in an ebook format. Most of the titles are now out of print. We do not have stock or an ebook format for the texts.

Sincerely,

Christine
Customer Service

I don't know while they,as the publisher of this book, are having the full text for this book why they can't provide the ebook version.
There should exist a special policy behind thier response.
I really don't know how to obtain this book. :(
Seemingly,making a copy of this book or making an Ebook shouldn't be considered as a illegal action.
Because the publisher is reluctant and abandoned to support the book.
I wish I could get my hands on this book just for a week,and then I could make a nice ebook.

In my humble opinion,the best way is to talk to the Author of this book who is "Andrew Schulman".
I don't know how to obtain his email address and how to contact him.
Any help would be appreciated.


Regards,
Zest.

EDIT:
UPDATE

This is their recent answer to my request:

Quote
Response (Christine) 12/01/2006 02:38 PM
Dear Sourav,

I am sorry, I have checked with our Editorial department and we are not allowed to give out Author contact information. Please try contacting an Out of Print bookstore for assistance in locating the titles below.

Sincerely,

Christine
Customer Service
The fact is that I don't have access to any Out of Print bookstores otherwise I could purchase one.
I know that the greatest library in the world whch is known as Library of Congress has the Ebook version.

http://catalog.loc.gov/cgi-bin/Pwebrecon.cgi?v1=2&ti=1,2&Search%5FArg=undocumented%20dos&Search%5FCode=TALL&CNT=25&PID=28550&SEQ=20061201225313&SID=2

As the last resort I should ask for a ridiculous request to the publisher.
This might be efficient.

Regards,
Zest.
Title: Re: which assembler is this?
Post by: LouisStDubois on December 16, 2006, 04:30:05 AM
Hi.  Just thought that I would put in my two cents worth and say that I've had a great deal of success finding old and out-of-print books on Alibris.  If it exists, they can find it.  Good luck! 
Title: Re: which assembler is this?
Post by: LouisStDubois on December 16, 2006, 04:45:34 AM
Hi again.  I just check with Alibris.  They have two copies (one first edition) of The Undocumented PC and one copy of the book Undocumented DOS.  So there you are, and you're very welcome.
Title: Re: which assembler is this?
Post by: Zest on December 17, 2006, 06:15:22 AM
Hi,
Thanks LouisStDubois for your help.
But I have already placed an order for these books through an institute in ENGLAND which is known as SALBOOK.
I just have to check their proforma invoice and then try to purchase from the one which  offers the books in cheaper cost.
*******
SAL UK LTD .  PO BOX 312  LONDON – SE3 – 7TS – UK.  TEL : 0208 694 1294 
FAX : 0208 691 1927  EMAIL: SALUK@DIAL.PIPEX.COM
UK REG . NO : 1950057
*******

It's also funny to know that at last, Christine from Addison Wesly admitted that they want to sell the books in Ebook format but they can't.It's because they are under the dominance of an organization which is known as Pearson Education.(Let's call it an IDOL!)
The idol has come to know that these books have been out of print.So as this understanding is made,
the text of these books is not worth even referencing and should be considered obsolete.
When this tag is made by the IDOLthe publication can't do anything ,because any action by the publication is considered as a defiance to the rule made by the IDOL.
Neither the publication nor I have enough power before the sacred throne of the IDOL.
There we just can kiss the ground and ask for prosperity.
That's all.

Regards,
Zest.