Solved

How to solve error A2004 ?

Posted on 2003-11-26
5
2,497 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Huffman Compression and decompression code on assembly language 7 1,469
Cascading assemblies in .net libraries 4 358
Dword and Qword in PHP 5 1,012
i7 introduced date in different markets 4 546
Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime is disastrous for companies and can lead to major hits on a brand, reputation, an…
We have put together a white paper that aims to explain how MSPs can both improve their offering and ease the pain of after-hours service by: -Suggesting changes to workflow -Indicating how to rework policy to suit your team -Providing ConnectW…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

696 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