Fatal error l1101 invalid object module

Fatal error l1101 invalid object module This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions. Answered by: Question Hi.I have MS VS2005 Professional, which has Masm v.8 (OS MS Windows XP SP2) I recently started learning assembly language. And I have no problems compiling 32-bit code. There’s only something […]

Содержание

  1. Fatal error l1101 invalid object module
  2. Answered by:
  3. Question
  4. Answers
  5. All replies
  6. ASM Community
  7. Fatal error l1101 invalid object module
  8. Answered by:
  9. Question
  10. Answers
  11. All replies
  12. Microsoft KB Archive/95121
  13. Contents
  14. FIX: L1101 Error Linking MASM Object Module w/ Large Structure
  15. SYMPTOMS
  16. CAUSE
  17. RESOLUTION
  18. STATUS
  19. MORE INFORMATION
  20. Sample Code

Fatal error l1101 invalid object module

This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.

Answered by:

Question

Hi.
I have MS VS2005 Professional, which has Masm v.8 (OS MS Windows XP SP2)
I recently started learning assembly language. And I have no problems compiling 32-bit code.

There’s only something wrong while compiling asm code to produce COM files.

Here’s simple code sample:

CSEG segment
ORG 100h

mov ah,9
mov dx,offset Message
int 21h
int 20h
Message db ‘Hello, world!$’
CSEG ends
end Begin

I compile it in command line like this:
ml test.asm /AT
I use /AT to enable tiny model (COM files). But I get the following:
test.obj : fatal error LNK1190: invalid fix-up found, type 0x0001 .

Could anyone tell me if there is a way to compile the 16-bit assembly code using Masm v.8 to produce COM files? Or I need to install like Masm v.6.xx?

Would appreciate any help

Answers

when you invoke ml.exe without any specific parameters the type of object file that it generates will be in coff format. coff format name mangling requires that your «Begin» should have a leading underscore. what you have written will work for intel’s omf object files. try using this with v.8 : «ml.exe /omf filename.asm». As far as I remember MS assemblers used to generate omf by default which the linker used to consume. Looks like this has been changed.

I’m not sure you have to follow this way. to build COM components.

A COM component hosts one or multiple COM class or coclass with is represented, structurally, as a virtual C++ class.
So you should continue to learn ASM, but to build COM class, you will have to build C++ applications, it is easier.

Note:
In the case you cant to build every thing from scratch, I do’nt know asm samples, but there are some C samples.
In the early days of COM programming, in the Win16 land, there were C sample code, provided in the Platform SDK that shown how to build COM coclass (with registration and every thing needed) using C langage.
May be it was in the OLE samples.

Well, I write C++ code anyways ( I’m first-year Computer Science student). I would just like to know whether it’s technically possible to compile, for instance, the above mentioned simple16-bit code using Masm v.8 to produce a COM file. (It just writes a classical «Hello World!»). It’s not the program itself that interests me. It’s how to do it in assembly language. And to be exact, how to produce a COM file using Masm v.8.

Maybe someone knows.

P.S.Thanks anyway for the answer

OK, at last I compiled the above mentioned 16-bit code to produce working COM file, but only after installing MASM v6.xx and only using 16-bit linker. And after linking I get .EXE file, which I convert to COM using exe2bin.

Seems like MASM v.8 is not supposed to link 16-bit programs.

when you invoke ml.exe without any specific parameters the type of object file that it generates will be in coff format. coff format name mangling requires that your «Begin» should have a leading underscore. what you have written will work for intel’s omf object files. try using this with v.8 : «ml.exe /omf filename.asm». As far as I remember MS assemblers used to generate omf by default which the linker used to consume. Looks like this has been changed.

Wow, it worked. You’re right that by default it generates object files in coff format. Without specifying, that ml has to compile an object module format object file, even if I used 16-bit linker, it would give a fatal error:

TEST.OBJ : fatal error L1101: invalid object module

, which now makes sense. A couple of days ago I figured out on myself how to compile my example code using MASM v.6.xx and 16-bit link.exe. I thought that I definetely have to use not only 16-bit linker, but ml.exe version 6.xx. But at last I was able to compile using ml.exe v.8! But still you have to use 16-bit linker ( for instance Microsoft link.exe v.5.xx) to link 16-bit code. It will produce an .EXE file, which I easily convert to .COM using exe2bin.

And of course it’s easier to write a batch file for this to make the compilation faster:

Источник

I am trying to pick up some Win32asm. I am doing the «hello world» first program (plz don’t laugh 😉 ) from http://www.thomasbleeker.nl/exagone/WIN32ASM/tutor12.html
I have adjusted his code to reflect my ‘MASM’ directory rather than his ‘MASM32’ dir. I got the required .inc and .lib files from another PC which has MASM32 v6 SP2 installed, and added them to the appropriate MASM folders.

When I follow his instructions I get the following error:

«first.obj : fatal error L1101: invalid object module»

Could anybody please tell me what’s going wrong?

Thanks,
Bill Miller

Below are my program specs and complete console dump of command prompt error:

WinXP; MASM 6.15 and Link 5.63

My (User) Variables:
PATH=C:MASMBIN;C:MASMBINR;%PATH%
LIB=C:MASMLIB
INCLUDE=C:MASMINCLUDE
INIT=C:MASMINIT
HELPFILES=C:MASMHELP*.HLP
ASMEX=C:MASMSAMPLES

NOTE: I do *NOT* have MASM32 installed. I got the .lib and .inc files from another computer.

kernel32.lib, user32.lib, kernel32.inc, user32.inc (MASM32 v6SP2)
windows.inc v1.25

Here’s my cmd-prompt dump:
ps. when I leave out the ‘/subsystem:windows’ it won’t complain about that but the ‘invalid object module error’ remains.
C:MASMBIN>make
Microsoft (R) Macro Assembler Version 6.15.8803
Copyright (C) Microsoft Corp 1981-2000. All rights reserved.

Microsoft (R) Segmented Executable Linker Version 5.60.339 Dec 5 1994
Copyright (C) Microsoft Corp 1984-1993. All rights reserved.

Источник

Fatal error l1101 invalid object module

This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.

Answered by:

Question

Hi.
I have MS VS2005 Professional, which has Masm v.8 (OS MS Windows XP SP2)
I recently started learning assembly language. And I have no problems compiling 32-bit code.

There’s only something wrong while compiling asm code to produce COM files.

Here’s simple code sample:

CSEG segment
ORG 100h

mov ah,9
mov dx,offset Message
int 21h
int 20h
Message db ‘Hello, world!$’
CSEG ends
end Begin

I compile it in command line like this:
ml test.asm /AT
I use /AT to enable tiny model (COM files). But I get the following:
test.obj : fatal error LNK1190: invalid fix-up found, type 0x0001 .

Could anyone tell me if there is a way to compile the 16-bit assembly code using Masm v.8 to produce COM files? Or I need to install like Masm v.6.xx?

Would appreciate any help

Answers

when you invoke ml.exe without any specific parameters the type of object file that it generates will be in coff format. coff format name mangling requires that your «Begin» should have a leading underscore. what you have written will work for intel’s omf object files. try using this with v.8 : «ml.exe /omf filename.asm». As far as I remember MS assemblers used to generate omf by default which the linker used to consume. Looks like this has been changed.

I’m not sure you have to follow this way. to build COM components.

A COM component hosts one or multiple COM class or coclass with is represented, structurally, as a virtual C++ class.
So you should continue to learn ASM, but to build COM class, you will have to build C++ applications, it is easier.

Note:
In the case you cant to build every thing from scratch, I do’nt know asm samples, but there are some C samples.
In the early days of COM programming, in the Win16 land, there were C sample code, provided in the Platform SDK that shown how to build COM coclass (with registration and every thing needed) using C langage.
May be it was in the OLE samples.

Well, I write C++ code anyways ( I’m first-year Computer Science student). I would just like to know whether it’s technically possible to compile, for instance, the above mentioned simple16-bit code using Masm v.8 to produce a COM file. (It just writes a classical «Hello World!»). It’s not the program itself that interests me. It’s how to do it in assembly language. And to be exact, how to produce a COM file using Masm v.8.

Maybe someone knows.

P.S.Thanks anyway for the answer

OK, at last I compiled the above mentioned 16-bit code to produce working COM file, but only after installing MASM v6.xx and only using 16-bit linker. And after linking I get .EXE file, which I convert to COM using exe2bin.

Seems like MASM v.8 is not supposed to link 16-bit programs.

when you invoke ml.exe without any specific parameters the type of object file that it generates will be in coff format. coff format name mangling requires that your «Begin» should have a leading underscore. what you have written will work for intel’s omf object files. try using this with v.8 : «ml.exe /omf filename.asm». As far as I remember MS assemblers used to generate omf by default which the linker used to consume. Looks like this has been changed.

Wow, it worked. You’re right that by default it generates object files in coff format. Without specifying, that ml has to compile an object module format object file, even if I used 16-bit linker, it would give a fatal error:

TEST.OBJ : fatal error L1101: invalid object module

, which now makes sense. A couple of days ago I figured out on myself how to compile my example code using MASM v.6.xx and 16-bit link.exe. I thought that I definetely have to use not only 16-bit linker, but ml.exe version 6.xx. But at last I was able to compile using ml.exe v.8! But still you have to use 16-bit linker ( for instance Microsoft link.exe v.5.xx) to link 16-bit code. It will produce an .EXE file, which I easily convert to .COM using exe2bin.

And of course it’s easier to write a batch file for this to make the compilation faster:

Источник

Microsoft KB Archive/95121

Contents

FIX: L1101 Error Linking MASM Object Module w/ Large Structure

Article ID: 95121

Article Last Modified on 10/20/2003

  • Microsoft Macro Assembler 6.0 Standard Edition
  • Microsoft Macro Assembler 6.0a
  • Microsoft Macro Assembler 6.0b
  • Microsoft Macro Assembler 6.1 Standard Edition
  • Microsoft Macro Assembler 6.1a
  • Microsoft Macro Assembler 6.11 Standard Edition

This article was previously published under Q95121

SYMPTOMS

An attempt to link an application assembled with the Microsoft Macro Assembler (MASM) fails and the Microsoft Link utility (LINK) generates the following message:

fatal error L1101: invalid object module

CAUSE

MASM generates an incorrect LIDATA record when the source code declares large data structures.

RESOLUTION

To work around this problem, organize structure initialization into a series of DUP directives, as shown below. If necessary, MASM processes the structure into several LIDATA records.

STATUS

Microsoft has confirmed this to be a problem in MASM versions 6.0, 6.0a, 6.0b, 6.1, and 6.1a. This problem was corrected in MASM for MS-DOS version 6.11.

MORE INFORMATION

The code example below demonstrates this problem. Even though MASM is designed to create multiple LIDATA records for a data structure larger than 512 bytes, the assembler creates one LIDATA record for the entire data structure. When this occurs, the L1101 error occurs as indicated above.

See «The MS-DOS Encyclopedia» (Microsoft Press) for more information on the LIDATA record or other aspects of the object module format.

Sample Code

Additional query words: 6.00 6.00a 6.00b 6.10 6.10a buglist6.00a buglist6.00b buglist6.10 buglist6.10a fixlist6.11

Keywords: kbfix KB95121

© Microsoft Corporation. All rights reserved.

Источник

Вадим77

1 / 1 / 0

Регистрация: 21.04.2016

Сообщений: 161

1

16.09.2018, 19:24. Показов 1197. Ответов 4

Метки нет (Все метки)


Привет всем! Продолжаю читать книгу Магда С.Ю. стр. 59 При компилировании примера с книги выскочила неустранимая ошибка. Пробовал гуглить, ничего про эту ошибку не нашел. Ругается линковщик — fatal error L1101: invalid object module
Object file offset: f0 Record type: 9d
неустранимая ошибка L1101: недопустимый модуль объекта
Смещение объектного файла: f0 тип записи: 9d
Как понять?
Программа:

Assembler
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
.586
.model flat
option casemap:none
data1 segment
    src db "Test STRING To Copy"
    len equ $-src
data1 ends
data2 segment public
    dst db len+1 DUP('+')
data2 ends
code segment
_seg_ex proc
assume cs:flat, ds:flat, ss:flat, es:flat, fs:error, gs:error
mov esi, offset data1
mov edi, offset data2
cld ; сброс флага направления, установка DF = 0
mov cx, len
rep movsb
mov eax, offset data2
ret
_seg_ex endp
code ends
end

__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь



0



ФедосеевПавел

Модератор

Эксперт по электронике

8279 / 4183 / 1595

Регистрация: 01.02.2015

Сообщений: 13,004

Записей в блоге: 3

16.09.2018, 20:06

2

В последней строке добавьте «точку входа» — метку, с которой должна начать выполняться программа

Assembler
23
end _seg_ex

Добавлено через 9 минут
Вадим77, я сейчас прочитал страницы 59-60. Там написано, что _seg_ex — это не программа, а всего лишь процедура на ассемблере, а программа написана на C++ и вызывает эту процедуру.

Поэтому, ошибки в исходнике нет. Это вы используете неправильно предоставленный исходник.

Добавлено через 3 минуты
Исправление первого, но неверного ответа



1



1 / 1 / 0

Регистрация: 21.04.2016

Сообщений: 161

16.09.2018, 20:08

 [ТС]

3

Понятно



0



Модератор

Эксперт по электронике

8279 / 4183 / 1595

Регистрация: 01.02.2015

Сообщений: 13,004

Записей в блоге: 3

16.09.2018, 20:32

4

Но на будущее, вы уже запомните, что в исходнике с основной программой после end указывается точка входа.
И наоборот, возле end указана точка входа, а не набор символов или любая процедура из исходника.

У всего есть положительные моменты!



1



6681 / 2664 / 366

Регистрация: 17.02.2013

Сообщений: 3,906

17.09.2018, 05:26

5

Цитата
Сообщение от ФедосеевПавел
Посмотреть сообщение

Поэтому, ошибки в исходнике нет.

Ошибка в исходнике из книги таки есть.

Цитата
Сообщение от Вадим77
Посмотреть сообщение

mov cx, len
rep movsb

Тут по смыслу должно быть не cx , а ecx

Добавлено через 9 минут
З.Ы. У этого Магда какой-то зуд написания книг. Вот-что он пишет об этом 32-разрядном коде :
Группа следующих команд выполняет копирование строки src в dst, при этом регистр CX содержит количество копируемых байтов:

cld
mov CX, len
rep movsb


Так-что ошибка не случайна. Не может быть опечатки сразу в трех местах. Он действительно заблуждается. Ну или может заредактировался копипастом.

Добавлено через 11 минут

Цитата
Сообщение от Вадим77
Посмотреть сообщение

Ругается линковщик — fatal error L1101: invalid object module
Object file offset: f0 Record type: 9d

Чтобы понять что это надо знать — какая версия MASM, как компилировал, как компоновал. Только в книге имелось ввиду полученный из этого файла объектник включить в проект Visual C++. Если уже Visual C++ начнет ругаться, только тогда уже надо разбираться указывать при компиляции ключик /coff , не указывать или что еще.



1



KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub


Article: Q95121
Product(s): Microsoft Macro Assembler
Version(s): 6.0,6.0a,6.0b,6.1,6.11,6.1a
Operating System(s): 
Keyword(s): 
Last Modified: 06-MAY-2001

-------------------------------------------------------------------------------
The information in this article applies to:

- Microsoft Macro Assembler (MASM), versions 6.0, 6.0a, 6.0b, 6.1, 6.1a, 6.11 
-------------------------------------------------------------------------------

SYMPTOMS
========

An attempt to link an application assembled with the Microsoft Macro Assembler
(MASM) fails and the Microsoft Link utility (LINK) generates the following
message:

  fatal error L1101: invalid object module

CAUSE
=====

MASM generates an incorrect LIDATA record when the source code declares large
data structures.


RESOLUTION
==========

To work around this problem, organize structure initialization into a series of
DUP directives, as shown below. If necessary, MASM processes the structure into
several LIDATA records.

  msg_str STRUCT
  msg     BYTE 44 DUP(120), 10, 13
  BYTE 44 DUP(111), 10, 13
  BYTE 44 DUP(120), 10, 13
  BYTE 44 DUP(111), 10, 13
  BYTE 44 DUP(120), 10, 13
  BYTE 44 DUP(111), 10, 13
  BYTE 44 DUP(120), 10, 13
  BYTE 44 DUP(111), 10, 13
  BYTE 44 DUP(120), 10, 13
  BYTE '$'
  msg_str ENDS

STATUS
======

Microsoft has confirmed this to be a problem in MASM versions 6.0, 6.0a, 6.0b,
6.1, and 6.1a. This problem was corrected in MASM for MS-DOS version 6.11.

MORE INFORMATION
================

The code example below demonstrates this problem. Even though MASM is designed
to create multiple LIDATA records for a data structure larger than 512 bytes,
the assembler creates one LIDATA record for the entire data structure. When this
occurs, the L1101 error occurs as indicated above.

See "The MS-DOS Encyclopedia" (Microsoft Press) for more information on the
LIDATA record or other aspects of the object module format.

Sample Code
-----------

  ; Assemble options needed: none

  .MODEL small
  .STACK 4096

  .DATA
  msg_str STRUCT
  msg     BYTE "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", 10, 13
          BYTE "oooooooooooooooooooooooooooooooooooooooooooo", 10, 13
          BYTE "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", 10, 13
          BYTE "oooooooooooooooooooooooooooooooooooooooooooo", 10, 13
          BYTE "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", 10, 13
          BYTE "oooooooooooooooooooooooooooooooooooooooooooo", 10, 13
          BYTE "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", 10, 13
          BYTE "oooooooooooooooooooooooooooooooooooooooooooo", 10, 13
          BYTE "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", 10, 13
          BYTE '$'
  msg_str ENDS

  struct_str msg_str 2 DUP (<>)

  .CODE
  main PROC
     mov ax, @DATA
     mov ds, ax

     mov ah, 9h                    ; Request DOS Function 9.
     mov dx, OFFSET struct_str.msg ; Load DX with offset
                                   ; (segment already in DS).
     int 21h                       ; Display String.

     mov ax, 4c00h
     int 21h
  main ENDP
  END main

Additional query words: 6.00 6.00a 6.00b 6.10 6.10a buglist6.00a buglist6.00b buglist6.10 buglist6.10a fixlist6.11

======================================================================
Keywords          :  
Technology        : kbMASMsearch kbAudDeveloper kbMASM600 kbMASM610 kbMASM611 kbMASM610a kbMASM600a kbMASM600b
Version           : :6.0,6.0a,6.0b,6.1,6.11,6.1a
Solution Type     : kbfix

=============================================================================

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS
PROVIDED «AS IS» WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS
ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO
EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR
ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL,
CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF
MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION
OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES
SO THE FOREGOING LIMITATION MAY NOT APPLY.

Copyright Microsoft Corporation 1986-2002.


  1. Yura_A

    Yura_A

    New Member

    Публикаций:

    0

    Регистрация:
    27 ноя 2005
    Сообщения:
    4
    Адрес:
    Russia

    Привет всем! У меня возникла проблемка. Немного выучил ассемблер под дос, начал изучать под винду, но никак не получается скомпилировать файл. пробовал по разным учебникам — результат один. Команда ml /c /coff *.asm проходит нормально, а при линковании(link *.obj /subsystem:windows) вылазят ошибки:

    1) «LINK : warning L4017: /subsystem:unrecognized option name; option ignored»

    2) «*.obj : fatal error L1101: invalid object module

    Object file offset: 1 Record type: 4c»

    у меня установлен masm 6.11, windows Me


  2. IgorV

    IgorV

    New Member

    Публикаций:

    0

    Регистрация:
    3 дек 2005
    Сообщения:
    2
    Адрес:
    Russia

    Скачай лучше masm 8.2 отсюда: movsd.com

    В чем проблема не знаю, возможно нужно писать в верхнем регистре — «link *.obj /SUBSYSTEM:WINDOWS»


  3. q_q

    q_q

    New Member

    Публикаций:

    0

    Регистрация:
    5 окт 2003
    Сообщения:
    1.706


  4. Yura_A

    Yura_A

    New Member

    Публикаций:

    0

    Регистрация:
    27 ноя 2005
    Сообщения:
    4
    Адрес:
    Russia

    спасибо, уже качаю. попробую может получится.

    линкер v5.31.009


  5. Yura_A

    Yura_A

    New Member

    Публикаций:

    0

    Регистрация:
    27 ноя 2005
    Сообщения:
    4
    Адрес:
    Russia

    Спасибо огромное еще раз! C этим масмом все работает. только теперь возник ещё один вопрос — он не находит файлы библиотек (user32.lib, итд) хотя они находятся в папке lib. А если эти библиотеки копировать в папку с исходным файлом *.asm тогда компилируется без проблем. Неужели приходится всегда необходмые библиотеки и файлы *.inc копировать в ту же папку, или можно указать на путь до них в какихнибудь настройках?


  6. IgorV

    IgorV

    New Member

    Публикаций:

    0

    Регистрация:
    3 дек 2005
    Сообщения:
    2
    Адрес:
    Russia

    Пожалуйста! ))

    Тут есть, как минимум, 2 решения:

    1. Прописать полный путь в includelib (напр. «includelib masm32libuser32.lib»), с include почти также,(include masm32includewindows.inc);

    2. Указать линкеру папку с lib’ми с помощью «/LIBPATH». Например «link *.obj /SUBSYSTEM:WINDOWS /LIBPATH:c:masm32lib»;

    1-й способ мне кажется наиболее удобным.

    Еще, по-моему, можно установить переменной окружения «MASMLIB» путь к lib файлам…


  7. Yura_A

    Yura_A

    New Member

    Публикаций:

    0

    Регистрация:
    27 ноя 2005
    Сообщения:
    4
    Адрес:
    Russia

    Понял. : только не пойму как сам до этого не додумался…


  8. q_q

    q_q

    New Member

    Публикаций:

    0

    Регистрация:
    5 окт 2003
    Сообщения:
    1.706

    IgorV

    1-й способ мне кажется наиболее удобным.

    Imho — плохой способ.

    Гибчее использовать переменную среды окружения LIB.


WASM

Понравилась статья? Поделить с друзьями:

Читайте также:

  • Fatal error jni h file not found
  • Fatal error iostream нет такого файла или каталога
  • Fatal error iostream no such file or directory что делать
  • Fatal error invalid table size allocation failed javascript heap out of memory
  • Fatal error invalid array length allocation failed javascript heap out of memory

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии