Solved

How to solve error A2004 ?

Posted on 2003-11-26
5
2,449 Views
Last Modified: 2007-12-19
Hello all,
I got a problem when compile an asm file to 16-bit .obj. I used compiler ml.exe to do this work. Here is my command line:
ml /DIS_16 /c /W3 /Zi /nologo /Fo Disk16.obj Disk.asm
The error was:
error A2004: symbol type conflict
These error always occurred at lines where had "seg" directives in the 16-bit code section.
My .asm file is automatically created by the thunk compiler from a thunk script, so I think it had no problem. I wondered if the version of my compiler ml.exe caused this error. Please give me other suggestion(s) to solve this problem.
Thanks for your supporting.
Sincerely.
0
Comment
Question by:navut
  • 3
  • 2
5 Comments
 
LVL 9

Expert Comment

by:BeyondWu
ID: 9847116
could you please post your .asm file, I think this file is small because it's created by the thunk compiler. Also, could you please post your Thunk Script?
0
 

Author Comment

by:navut
ID: 9850404
Here is my .asm file, which was generated by thunk compiler. I just copy the 16-bit code section, because it's ok when I compile with /DIS_32 option.

;================================================================
      page      ,132

;Thunk Compiler Version 1.8  May 11 1995 13:16:19
;File Compiled Wed Nov 26 10:21:07 2003

;Command Line: C:\WORKING\PROJECTS\FLATTH~1\THUNKS~1\THUNK.EXE -t thk -o disk.asm diskthnk.thk

      TITLE      $disk.asm

      .386
      OPTION READONLY
      OPTION OLDSTRUCTS

IFNDEF IS_16
IFNDEF IS_32
%out command line error: specify one of -DIS_16, -DIS_32
.err
ENDIF  ;IS_32
ENDIF  ;IS_16

IFDEF IS_32
IFDEF IS_16
%out command line error: you can't specify both -DIS_16 and -DIS_32
.err
ENDIF ;IS_16
;************************* START OF 32-BIT CODE *************************
;(skipped)

      .code
;************************* COMMON PER-MODULE ROUTINES *************************
      .data
;(skipped)
      .code
;************************ START OF THUNK BODIES************************
;(skipped)

ELSE
;************************* START OF 16-BIT CODE *************************

      OPTION SEGMENT:USE16
      .model LARGE,PASCAL

      .code      

externDef CheckInt13Extension:far16
externDef ReadDisk:far16


FT_thkTargetTable label word
      dw      offset CheckInt13Extension
      dw         seg CheckInt13Extension ;-----error A2004 in this line------
      dw      offset ReadDisk
      dw         seg ReadDisk ;-----error A2004 in this line------

      .data

public thk_ThunkData16      ;This symbol must be exported.
thk_ThunkData16      dd      3130534ch      ;Protocol 'LS01'
      dd      09f8h      ;Checksum
      dw      offset FT_thkTargetTable
      dw      seg    FT_thkTargetTable ;-----error A2004 in this line------
      dd      0      ;First-time flag.

      .code

externDef ThunkConnect16:far16

public thk_ThunkConnect16
thk_ThunkConnect16:
      pop      ax
      pop      dx
      push      seg    thk_ThunkData16 ;-----error A2004 in this line------
      push      offset thk_ThunkData16
      push      seg    thk_ThkData32 ;-----error A2004 in this line------
      push      offset thk_ThkData32
      push      cs
      push      dx
      push      ax
      jmp      ThunkConnect16 ;-----error A2004 in this line------
thk_ThkData32 label byte
      db      "thk_ThunkData32",0

ENDIF
END
;================================================================

Here is my thunk script
;================================================================
enablemapdirect3216 = true;

typedef int BOOL;
typedef unsigned char *LPBYTE;
typedef unsigned long DWORD;

BOOL ReadDisk(DWORD Drive, DWORD Cylinder, DWORD Head, DWORD Sector, DWORD NumSectors, LPBYTE Buffer, DWORD RelativeSector, BOOL Flag)
{
      Buffer = inout;
}

BOOL CheckInt13Extension(DWORD Drive)
{
}
;================================================================
0
 
LVL 9

Accepted Solution

by:
BeyondWu earned 250 total points
ID: 9854589
Which version of MASM are you using?
I tested it with MASM and TASM ,and it looks every thing is OK.
Please try to use the ml.exe from you VC++ folder, x:\Program Files\Microsoft Visual Studio\VC98\Bin\ml.exe
MASM version "Microsoft (R) Macro Assembler Version 6.15.8803",
TASM version "Turbo Assembler  Version 5.3  Copyright (c) 1988, 2000 Inprise Corporation"

Hope this can help you.
0
 

Author Comment

by:navut
ID: 9860238
Dear BeyondWu,
Thank you very much. I found where the problem was. My MASM version 7 -- came with VS.Net -- caused these errors. I downloaded its version 6.15 and compiled it successfully. Again, thanks alot.
Best Regards.
0
 
LVL 9

Expert Comment

by:BeyondWu
ID: 9864737
Hi navut,

you are welcome, I'm really glad to can help you.

BRs,
Wu
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
When we talk about DevOps toolchains, I sometimes wonder how many people really get what we’re talking about. I don’t know if it’s just semantics or tone or something else, but sometimes I think it just sounds like buzzword sausage. So it’s always …
Many of my clients call in with monstrous Gmail overloading issues with Outlook. A quick tip is to turn off the All Mail and Important folders from synching. Here is a quick video I made to show you how to turn off these and other folders in Gmail s…
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now