You are using 'simplified' directives and declare two segments, 'DATA'
and 'code'. 'code' is not one of the pre-declared segment names
provided with simplified directives. You have not defined the class
of that segment so it will not be bundled in with the default defined
ones. It therefore needs to be defined somewhere, either in the
source file or in a module definition file.
Change this:
code segment use32 public
To this:
code segment use32 public 'CODE'
To cause it to be grouped into the CODE class of segments.
While you are at it, read up on assembly and investigate the use of
the proc and endp directives.
Quote
... what is a DEF file ?
A module definition file is an accompanying text file in which items
such as export and import names, DLL's used, segments and their
attributes, stack size and heap size can be defined. The module
definition file has an extension of '.DEF' and is often referred to as
a 'def file'. The help has a section on module definition files.
--------------------------------------
Quote
type ques068.asm
.386p
.model flat,stdCall;
Locals
jumps
mb_ok equ 0
hWnd equ 0
lpText equ offset text
lpCaption equ offset caption
extrn ExitProcess :proc
extrn MessageBoxA :proc
DATA segment use32 public
text db "Happy new academic year",13,10
caption db "Hello Students",0,'$'
DATA ends
code segment use32 public 'CODE'
start:
push mb_ok
push lpCaption
push lpText
push hWnd
call MessageBoxA
CALL ExitProcess
code ends
End start
C:\Documents and Settings\Administrator\My Documents\Lookat\q068
Quote
tasm32 -ml -zi ques068
Turbo Assembler Version 5.3 Copyright (c) 1988, 2000 Inprise
Corporation
Assembling file: ques068.ASM
Error messages: None
Warning messages: None
Passes: 1
C:\Documents and Settings\Administrator\My Documents\Lookat\q068
Quote
ilink32 /Tpe/ap/c/v ques068,,,import32
Turbo Incremental Link 5.66 Copyright (c) 1997-2002 Borland
C:\Documents and Settings\Administrator\My Documents\Lookat\q068
Quote
ques068
C:\Documents and Settings\Administrator\My Documents\Lookat\q068
--------------------------------------
. Ed
Quote
borland.public.tasm wrote in message
news:418399bf$ XXXX@XXXXX.COM ...
Please,look at the following program:
.386
Locals
jumps
.model flat,stdCall;
mb_ok equ 0
hWnd equ 0
lpText equ offset text
lpCaption equ offset caption
extrn ExitProcess :proc
extrn MessageBoxA :proc
DATA segment use32 public
text db "Happy new academic year",13,10
caption db "Hello Students",0,'$'
DATA ends
code segment use32 public
start:
push mb_ok
push lpCaption
push lpText
push hWnd
call MessageBoxA
CALL ExitProcess
code ends
End start
Assembling this program with tasm32 is ok, but the linker,
ilink32, displays the following fatal error: "...additional
segment need to be defined in a .DEF file" Who can
explain and solve this error, especially, what is a DEF file ?
I found,that including the class 'code' in only one segment's
declaration,will solve the problem.
Please, explain me the reason.
I know that in 16-bit programs,the class directive is an option.
I see that in 32-bits it is a must.I would like to understand
the diffrence between these two meanings of class.