News:

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

symbol type conflict

Started by roze, June 07, 2010, 01:31:52 AM

Previous topic - Next topic

roze

hi.I have a problem with this code and i am using masm 10.plz help me.when i try to compile the code below an error begin on line 8.
error A2004 symbol type conflict

dseg    segment para public 'data'
f       word    ?
dseg    ends

cseg    segment para public 'code'
        assume cs:cseg,ds:dseg
main    proc
mov ax, dseg                                       ;Error
mov ds, ax
mov es, ax
main    endp
cseg    ends

sseg    segment para stack 'stack'
stk     byte 1024 dup ("stack   ")
sseg    ends

zzzzzzseg   segment para 'zzzzzz'
lastbyte    byte 16 dup ("?")
zzzzzzseg   ends

end main

dedndave

you are trying to assemble and link a 16-bit program with a 32-bit assembler/linker
actually - the assembler should be ok - it is the linker that cannot handle 16-bit code
at the end of the sub-forum list is one for 16-bit programming
search that subforum
there are 16-bit linker downloads, as well as batch files to perform assembly and linking
there are also a number of 16-bit program examples
you do not have to declare all those segments - there are shortcuts   :U

then, the data segment is best refered to as @DATA

also, you should terminate your program with...
        mov     ax,4C00h
        int     21h

japheth


Quote
yyy.asm(8) : error A2004:symbol type conflict
yyy.asm(22) : warning A4023:with /coff switch, leading underscore required for start address : main

16-bit programs require cmdline-option /omf if Masm v7 or higher is used:

ml -omf -c pgmname.asm

dedndave

hi Andrae - i think he's using version 6.14   :P
he may need to get c:\masm32\bin into the path variable

Roze - the forum search tool is your friend
but - let me see about getting a little program going to set up 16-bit assembly

dedndave

#4
ok
first, you need a 16-bit linker
this zip file also has a batch file and a readme

http://www.4shared.com/file/VU75K7M0/Link16.html

you will also want to add the masm32\bin folder to the PATH environment variable
these pictures are pretty much self-explanitory
one thing to note - path folders are seperated by a semicolon

i thought about writing a little program to set the PATH variable for you
then, it entered my mind that i'd have to start messing around with manifest files and virtualized hives to support win 7 64 bit
if you can't place files in the BIN folder and set up the PATH variable, you probably shouldn't be programming in ASM - lol





EDIT:
it may be simpler to use copy/paste to put the path variable text in a temporary text file
then, it is easy to edit - copy/paste it back when done