[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2608
  • Last Modified:

How to solve error A2004 ?

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
navut
Asked:
navut
  • 3
  • 2
1 Solution
 
BeyondWuCommented:
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
 
navutAuthor Commented:
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
 
BeyondWuCommented:
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
 
navutAuthor Commented:
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
 
BeyondWuCommented:
Hi navut,

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

BRs,
Wu
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now