The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: sihotaamarpal on July 23, 2006, 06:26:23 PM

Title: getting error while assembling
Post by: sihotaamarpal on July 23, 2006, 06:26:23 PM
i got this error from the following code,i am using winasm studio v.5.1.0 for assembling the code
any thing wrong in the code


F:\Win32asm\masm32\bin\ML /c /coff /Cp /nologo /I"F:\Win32asm\Masm32\Include" "F:\Win32asm\16bit.asm"
Assembling: F:\Win32asm\16bit.asm
F:\Win32asm\16bit.asm(8) : error A2004: symbol type conflict
F:\Win32asm\16bit.asm(40) : warning A4023: with /coff switch, leading underscore required for start address : main

Make finished. 2 error(s) occured.


;code start here


_TEXT segment word public 'CODE'

  assume cs:_TEXT,ds:_DATA,ss:STACK
 
      main proc far          ;entry point
     
           mov ax,_DATA      ;make ur data segment addressable
           mov ds,ax
           
           mov dx,offset msg ;offset address of the buffer to be printed
           mov ah,09h        ;request dos to print buffer pointed by ds:dx
           int 21h           ;call dos interrupt service
          
          xor ah,ah         ;pause
          int 16h
          
          mov ax,4c00h     ;terminate program with exit code 0
          int 21h         
          
     main endp 

                   
_TEXT ends


_DATA segment word public 'DATA'
     
      msg db 'Hello World!$',13,10  ;define byte var
     
_DATA ends


STACK segment para stack 'STACK'

      db 128 dup (?)
     
STACK ends

      end main

;code end here
Title: Re: getting error while assembling
Post by: hutch-- on July 24, 2006, 02:42:22 AM
sihotaamarpal,

The error is probably from using 16 bit code with 32 bit binaries. ML.EXE will handle 16 bit command lines but the linker in MASM32 is 32 bit only. You will need to get the 16 bit OMF linker from Microsoft. You can find it on the forum web site.

You may have to check with Antonis about how to set up WinAsm Studio for 16 bit code.