Solved

How to solve error A2004 ?

Posted on 2003-11-26
5
2,432 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Hi navut,

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

BRs,
Wu
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Binary Bomb: Phase 5 3 1,651
c code optimization 6 452
Why does je branch when they are not equal? 2 314
How to diplay the real thread ID 21 1,139
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
This article will show you how to create an ISO CD-ROM/DVD-ROM image (*.iso), and MD5 checksum signature, for use with VMware vSphere Hypervisor 6.5 (ESXi 6.5). It's a good idea to compare checksums, because many installations fail because of a corr…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

763 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

12 Experts available now in Live!

Get 1:1 Help Now