News:

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

assembly error

Started by youngstorm, July 31, 2005, 04:02:10 AM

Previous topic - Next topic

youngstorm

Hi, Here's my command and results

C:\masm32\bin>ml fig2-1.asm
Microsoft (R) Macro Assembler Version 6.14.8444
Copyright (C) Microsoft Corp 1981-1997.  All rights reserved.

Assembling: fig2-1.asm
Microsoft (R) Incremental Linker Version 5.12.8078
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

/z2
"fig2-1.obj"
"fig2-1.exe"
NUL
LINK : warning LNK4044: unrecognized option "z2"; ignored
LINK : error : Segment reference in fixup record
fig2-1.obj : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt


here is my code

        .model small
        .stack 64
        .data
data1   db  52h
data2   db  29h
sum     db  ?
        .code
main    proc far
        mov ax, @data
        mov ds, ax
        mov al, data1
        mov bl, data2
        add al, bl
        mov sum, al
        mov ah, 4ch
        int 21h
main    endp
        end main
       

can anyone tell me what im doing wrong?

thank you
Mike

MichaelW

The linker included in the MASM32 package is a 32-bit linker. To link a 16-bit DOS app you need a 16-bit linker, available in a self-extracting archive here:

http://spiff.tripnet.se/~iczelion/download.html

Both linkers are named LINK.EXE, so take care not to overwrite the 32-bit linker. Assuming you rename the 16-bit linker to LINK16.EXE, you could assemble and link with command lines similar to this:

ML /c filename.asm
LINK16 filename.obj;

eschew obfuscation

youngstorm

Hey, that worked!!!  :)

many thanks

Mike

ninjarider

i have the above mentioned linker. not sure if its my code but it gives me the below error message

.MODEL SMALL
.STACK 200h
.DATA
.CODE

Start:
  mov ax, 4C00h
  int 21H
END Start

Assembling: C:\masm32\16BIT.asm
C:\masm32\16BIT.asm(9) : warning A4023: with /coff switch, leading underscore required for start address : Start
Volume in drive C has no label.
Volume Serial Number is F034-6802

Directory of C:\masm32

08/19/2005  03:39 PM                88 16BIT.ASM
08/19/2005  03:39 PM               436 16BIT.obj
               2 File(s)            524 bytes
               0 Dir(s)   7,131,131,904 bytes free

also when i run the linker. it leave what looks like a prompt at the end am i suppose to enter anything or just hit enter