0

Compiling the below asm code in Visual studio 2012

page 60,132
TITLE A05ASM1 (EXE) MOVE AND ADD OPERATION
;---------------------------------------------
STACK   SEGMENT PARA STACK 'Stack'
        DW 32 DUP(0)
STACK ENDS
;---------------------------------------------
DATASEG SEGMENT PARA 'Data'
var_01  DW 215
var_02  DW 315
var_03  DW ?
DATASEG ENDS
;---------------------------------------------
CODESEG SEGMENT PARA 'Code'
_main   PROC FAR
        ASSUME SS:STACK, DS:DATASEG, CS:CODESEG
        MOV AX,DATASEG
        MOV DS,AX

        MOV AX, var_01
        ADD AX, var_02
        MOV var_03, AX

        MOV AX, 4C00H
        INT 21H
_main   ENDP
CODESEG ENDS
        END _main

Getting the below errors:

  • error A2004: symbol type conflict C:masmProject\check.asm 17 1 mASM

  • Error 2 error MSB3721: The command "ml.exe /c /nologo /Zi /Fo"Debug\check.obj" /W3 /errorReport:prompt /Tacheck.asm" exited with code 1. C:~\masm.targets 49 5 mASM

Have tried various suggestions from net, but could not fix it.

  • See here: http://stackoverflow.com/questions/14692582/assembly-fatal-error-lnk1190-invalid-fixup-found-type-0x0001 – Gunner Jun 30 '13 at 16:12

1 Answers1

0

It looks like you're trying to build an MS-DOS executable.

I think you can get rid of the immediate error by adding the /omf switch to the ML command line, but I don't know if ML will be able to link the resulting .obj file.

Ferruccio
  • 98,941
  • 38
  • 226
  • 299
  • Yes, it failed to link "error LNK1107: invalid or corrupt file:" –  Jun 30 '13 at 11:21
  • I suspect that modern versions of VS can no longer build DOS binaries. Your best bet may be to download a copy of MASM 6.11 and use the tools bundled with it to assemble and link your code. – Ferruccio Jun 30 '13 at 13:47