Hi all,
I would like to disassemble the final version of a self-written Turbo Pascal V3
program, i.e. a simple .COM file, and to that effect I've dug out my old (AD 2004) registered copy of IDA Pro (V4.7.0.831). Not having used it for more than
10 years, and no longer having access to their forum, I'm now stuck. The .COM file loads, IDA happily disassembles it, but it just creates one single segment,
and I have no (longer) a clue on how to create the data segment. There's a bit
of info in the TP3 Manual, and using David Lindauer's GRDB in DOXBox-X allows me
to single-step through the RTL initialisation code and that shows me it sets up
up DS and SS, but it doesn't help me in setting up these segments in IDA.
I've tried the "Create Segment" option, but I'm lost entering the required values for start address, end address and base, "class" is probably "DATA", the
once for the single "seg000" that IDA creates are CODE, start @ 0x0100, end @ 0xD623, which leads me to assume that a to-be-created "seg001" should start at
0x0000, end at 0xffff, and have a base of 0xd63 (paragraphs), but that results
in a "Bad segment base: segment would have bytes with a negative offset" pop-up.
Trying start @ 0xd630, end @ 0x1d630, with a base 0x0000 creates a segment, but
it looks like
seg000:D622
seg001:C8C00 ; --------------------------------------------------------------------------- seg001:C8C00
seg001:C8C00 ; Segment type: Regular
seg001:C8C00 seg001 segment byte public '' use16
seg001:C8C00 assume cs:seg001
seg001:C8C00 ;org 0C8C00h
seg001:C8C00 assume es:nothing, ss:nothing, ds:nothing, fs:nothing, gs:nothing
Which may be correct, but the "org 0c8c00" makes absolutely no sense to me.
If you can help me I would be grateful, and to help you, I've uploaded a RAR archive with the full sources, the resulting "lift.com" executable and the input
file to my Google drive @ <https://drive.google.com/drive/folders/0B0oygbfs7DsVVWNBZWpqaHRHX3c?usp=sharing>,
look for lift16bit.rar Please note that the code will not compile with anything
more advanced than Turbo Pascal 3, and in my case it was compiled with TP 3.01a.
Thanks,
Robert
Hi all,Hello,
I would like to disassemble the final version of a self-written Turbo...
Pascal V3 program, i.e. a simple .COM file,
On 17.04.2021 15:48, Robert Prins wrote:
Hi all,Hello,
I would like to disassemble the final version of a self-written Turbo Pascal >> V3 program, i.e. a simple .COM file,...
.com files haven't any segment-info.
you can try DOS-debug (if you have one) or the NASM disassembler.
DOS.COM-files are usually organized to start at cs:0x0100.
If you post a hex-dump of your code I could disassemble it.
Turbo Pascal V3 (and probably versions 1 & 2 too) created .COM files are
not run-of-the-mill .COM files.
On 04/17/2021 06:07 PM, Robert Prins wrote:
...
Turbo Pascal V3 (and probably versions 1 & 2 too) created .COM files are not >> run-of-the-mill .COM files.
As I recall, DOS doesn't care what the file is named. If the first two bytes are
"MZ", it's an exe. Perhaps we should not call it .COM?
On 2021-04-17 21:50, Frank Kotler wrote:
On 04/17/2021 06:07 PM, Robert Prins wrote:
...
Turbo Pascal V3 (and probably versions 1 & 2 too) created .COM files
are not run-of-the-mill .COM files.
As I recall, DOS doesn't care what the file is named. If the first two
bytes are "MZ", it's an exe. Perhaps we should not call it .COM?
They are not MZ files, they are real COM files, be it that they do
strange things once loaded.
Not that strange, given that "turbo.com", the original "IDE" did also
handle multiple segments (itself, and the image of the compiled program,
when set to run from memory) Anders Hejlsberg, who originally wrote it,
was (and still is) pretty brilliant guy.
On 2021-04-17 21:50, Frank Kotler wrote:
On 04/17/2021 06:07 PM, Robert Prins wrote:
...
Turbo Pascal V3 (and probably versions 1 & 2 too) created .COM files
are not run-of-the-mill .COM files.
As I recall, DOS doesn't care what the file is named. If the first two
bytes are "MZ", it's an exe. Perhaps we should not call it .COM?
They are not MZ files, they are real COM files, be it that they do
strange things once loaded.
Not that strange, given that "turbo.com", the original "IDE" did also
handle multiple segments (itself, and the image of the compiled program,
when set to run from memory) Anders Hejlsberg, who originally wrote it,
was (and still is) pretty brilliant guy.
On 18.04.2021 11:09, Robert Prins wrote:
On 2021-04-17 21:50, Frank Kotler wrote:
On 04/17/2021 06:07 PM, Robert Prins wrote:
...
Turbo Pascal V3 (and probably versions 1 & 2 too) created .COM files are not
run-of-the-mill .COM files.
As I recall, DOS doesn't care what the file is named. If the first two bytes
are "MZ", it's an exe. Perhaps we should not call it .COM?
They are not MZ files, they are real COM files, be it that they do strange >> things once loaded.
Not that strange, given that "turbo.com", the original "IDE" did also handle >> multiple segments (itself, and the image of the compiled program, when set to
run from memory) Anders Hejlsberg, who originally wrote it, was (and still is)
pretty brilliant guy.
if they are real COM files then the segment info is found in the code.
often seen start in com-files:
org 0100h ;to override DOS default segment setting
push CS ;the COM-loader grant a few bytes stack
pop SS
mov SP.xxxx ;wherever it's wanted to be
push CS
pop DS
push 0
pop ES
....
Hi all,V3 program, i.e. a simple .COM file, and to that effect I've dug out my old (AD 2004) registered copy of IDA Pro (V4.7.0.831). Not having used it for more than 10 years, and no longer having access to their forum, I'm now stuck. The .COM file loads, IDA happily disassembles it, but it just creates one single segment,
I would like to disassemble the final version of a self-written Turbo Pascal
I've tried the "Create Segment" option, but I'm lost entering the requiredvalues for start address, end address and base, "class" is probably "DATA", the once for the single "seg000" that IDA creates are CODE, start @ 0x0100, end @ 0xD623, which leads me to assume that a to-be-created "seg001" should start at 0x0000, end at 0xffff, and have a base of 0xd63 (paragraphs), but that results in a "Bad segment base: segment would have bytes with a negative offset" pop-up.
Trying start @ 0xd630, end @ 0x1d630, with a base 0x0000 creates a segment,but it looks like
seg000:D622---------------------------------------------------------------------------
seg001:C8C00 ;
seg001:C8C00fs:nothing, gs:nothing
seg001:C8C00 ; Segment type: Regular
seg001:C8C00 seg001 segment byte public '' use16
seg001:C8C00 assume cs:seg001
seg001:C8C00 ;org 0C8C00h
seg001:C8C00 assume es:nothing, ss:nothing, ds:nothing,
Which may be correct, but the "org 0c8c00" makes absolutely no sense to me.
Hi all,V3 program, i.e. a simple .COM file, and to that effect I've dug out my old (AD 2004) registered copy of IDA Pro (V4.7.0.831). Not having used it for more than 10 years, and no longer having access to their forum, I'm now stuck. The .COM file loads, IDA happily disassembles it, but it just creates one single segment,
I would like to disassemble the final version of a self-written Turbo Pascal
I've tried the "Create Segment" option, but I'm lost entering the requiredvalues for start address, end address and base, "class" is probably "DATA", the once for the single "seg000" that IDA creates are CODE, start @ 0x0100, end @ 0xD623, which leads me to assume that a to-be-created "seg001" should start at 0x0000, end at 0xffff, and have a base of 0xd63 (paragraphs), but that results in a "Bad segment base: segment would have bytes with a negative offset" pop-up.
Trying start @ 0xd630, end @ 0x1d630, with a base 0x0000 creates a segment,but it looks like
seg000:D622---------------------------------------------------------------------------
seg001:C8C00 ;
seg001:C8C00fs:nothing, gs:nothing
seg001:C8C00 ; Segment type: Regular
seg001:C8C00 seg001 segment byte public '' use16
seg001:C8C00 assume cs:seg001
seg001:C8C00 ;org 0C8C00h
seg001:C8C00 assume es:nothing, ss:nothing, ds:nothing,
Which may be correct, but the "org 0c8c00" makes absolutely no sense to me.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 296 |
Nodes: | 16 (2 / 14) |
Uptime: | 72:16:33 |
Calls: | 6,657 |
Calls today: | 3 |
Files: | 12,203 |
Messages: | 5,332,304 |
Posted today: | 1 |