News:

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

Learning how to use masm32

Started by greeneyehawk, February 22, 2009, 06:44:31 PM

Previous topic - Next topic

greeneyehawk

Okay, I bought the book 80x86 Assembly Language and Computer Architecture by Richard C. Detmer.  I bought this book on amazon, and it did not come with the disk.  So, I emailed the author, and he sent me the two files I need for the first example in the book, io.h and io.asm.  I am wondering where to put these files for the assembler to use, or if there is something else I need to do with these files. 

Thanks,
Greeneyehawk

PBrennick

What you are describing is the contents of a boot-disk, minus command.com

He probably sent you a bootable diskette and the files should stay right where they are.
Paul
The GeneSys Project is available from:
The Repository or My crappy website

greeneyehawk

he sent the two files in an email

MichaelW

Io.asm is the source for some number/string conversion and console I/O procedures. Io.h contains macros that call the procedures from Io.asm. To use io.h with ML 6.x or later you need to comment out the INVOKE macro, as it will conflict with the INVOKE that ML provides. Io.asm can be used as is. I would place both files in your current working directory. For the only win32 Detmer example I could find:

; Example assembly language program -- adds two numbers
; Author:  R. Detmer
; Date:    revised 7/97

.386
.MODEL FLAT

;ExitProcess PROTO NEAR32 stdcall, dwExitCode:DWORD
...
END _start                      ; end of source code


I had to uncomment the ExitProcess prototype, so ML would know how to call it, and I had to specify a start address on the end directive, so the linker would know what the entry point address is.

I was then able to assemble io.asm to io.obj, assemble the example source, link everything, and run the resulting EXE with this batch file (modify the specified paths as necessary):

@echo off

set file="example"
set lib=c:\masm32\lib
set path=c:\masm32\bin;%path%

if exist %file%.obj del %file%.obj
if exist %file%.exe del %file%.exe
if exist io.obj del io.obj

ml /c /coff io.asm

pause

echo.

ml /c /coff %file%.asm

echo.

pause

echo.

Link /SUBSYSTEM:CONSOLE kernel32.lib %file%.obj io.obj

echo.

pause

echo.

%file%.exe

echo.

pause

eschew obfuscation