Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Compiling to binary

158 views
Skip to first unread message

Miikka

unread,
Oct 14, 2000, 3:00:00 AM10/14/00
to

I'm trying to write a boot sector, that would be assembled
into a binary file, and the I'd use another program to write
the bootsector to disk.

How can I compile my application to flat-form binary files
with MASM or TASM? Or is it even possible?
I do know that NASM can do it... but I'm already familiar
with TASM and MASM, so I'd like to use them.


Philip Scott

unread,
Oct 14, 2000, 3:00:00 AM10/14/00
to

Use the /t switch when linking with tlink to create a .com file which is
basicly pure binary - remember though that the .com file is loaded at
cs:100h where as the boot sector is loaded to 0000:7c00h so you may need to
take account of this when using direct refrences.

Regards,
Philip
"Miikka" <mii...@hushmail.com> wrote in message
news:suh0fbn...@corp.supernews.com...

Adam

unread,
Oct 15, 2000, 3:00:00 AM10/15/00
to

Or use EXE2BIN if your linker doesn't support pure binary output (although I
guess they probably all do...)

There is a good version of it called BIN available on GARBO.
Adam

In article <suhhmaj...@corp.supernews.com>, "Philip Scott"

--
-=Adam=-
coma@{I-HATE-SPAM-WITH-A-LOATHING-THAT-IS-DEEP-AND-REAL}beer.com


E.P. van Westendorp

unread,
Oct 15, 2000, 3:00:00 AM10/15/00
to
This is the start of an .ASM file I use to create MBR622.BIN that I can
use to replace the original MBR on the harddisk.
You can use the same syntax to create bootsector code.

TITLE MBR622.ASM

;MS-Dos 6.22 Master Boot Record

;Used: MASM 6.11D
;Syntax: ML /AT /Fe MBR622.BIN MBR622.ASM

_TEXT SEGMENT
ASSUME DS:_TEXT,SS:_TEXT
.RADIX 16
ORG 0000H


--

Eric P. van Westendorp Tel: +31(0252)210579
Reigerslaan 22 2215NN Voorhout Netherlands

Ed Pizzi

unread,
Oct 15, 2000, 3:00:00 AM10/15/00
to

> I'm trying to write a boot sector, that would be assembled
> into a binary file, and the I'd use another program to write
> the bootsector to disk.
>
> How can I compile my application to flat-form binary files
> with MASM or TASM? Or is it even possible?
> I do know that NASM can do it... but I'm already familiar
> with TASM and MASM, so I'd like to use them.

I had the same problem when I started writing bootsector stuff for my
operating system project. I think there are other solutions and other
linkers that will do this but anyway I couldn't find any so I wrote my own.

My solution was called Elink, a linker that creates raw BIN dumps, COM files
and boot sector (org 7C00h) BIN files. It is written in C so it's pretty
modifyable if you want to make your own format. It works on OMF files so I'm
not sure if it works with MASM or not. I know it works with TASM.

My site is http://pizzi.cjb.net/ which at present maps to
http://members.xoom.com/edpizzi/ but that's subject to change. Anyway my
linker is under the "Utilities" section.

Just a note on usage, use a hex editor to verify that the segments are in
the order you wanted if it has more than one segment. It puts the segments
in the order they appear in the object file, which should be the order they
appear in your source, but it's worth checking.

- Ed pizzi


0 new messages