D
D
Dartess2014-05-29 14:36:46
assembler
Dartess, 2014-05-29 14:36:46

TASM, moving procedures to a separate file for COM format

It is required to place the procedures in a separate file. I used to do this only with exe-shniks, I couldn’t draw an analogy with com, I didn’t google anything. Need a working example or error indication. Here is a part of the code:
the main file, l3.asm

extrn ZaprosChisla:near, VyvodVBIN:near, VyvodVHEX:near
code segment public
assume cs:code
org 100h
start: 

; тут код

code ends 
end start

procedure file, l3p.asm
public ZaprosChisla, VyvodVBIN, VyvodVHEX
code segment public 
assume cs:code

ZaprosChisla proc near 
;
ZaprosChisla endp 

VyvodVBIN proc near 
;
VyvodVBIN endp 

VyvodVHEX proc near 
;
VyvodVHEX endp 
code ends 
end

batch file:
tasm\bin\tasm.exe l3.asm /l
tasm\bin\tasm.exe l3p.asm /l
tasm\bin\tlink.exe l3.obj+L3P.OBJ /t

Result: on link
Fatal: Cannot generate COM file: invalid initial point address

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrew, 2014-05-29
@Dartess

I would assume that when linking, the l3p.obj file gets up before l3.obj and therefore the entry point is not at position 100h. Why the linker changes the explicitly specified order of the object modules and how to force it not to do so - I do not know.
My TLINK "with a bang" collects a COM-file from your sources according to your BAT-file.
And if I swap obj for my TLINK, I get an error:

C:\tasm>tlink.exe l3p.obj+L3.OBJ /t
Turbo Link  Version 2.0  Copyright (c) 1987, 1988 Borland International
Cannot generate COM file : data below initial CS:IP defined

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question