Questions from an assembly language programmer trying to convert a Pascal like program. 
Author Message
 Questions from an assembly language programmer trying to convert a Pascal like program.



Thu, 1 May 2003 18:53:56 :-

Quote:
>I'm converting a program that was written in some version of Pascal or
>Pascal like language.  The EXE of the program is a standalone program and
>has no explicit copyright notices or other stuff to indicate what compiler
>was used.

What do you mean by Explicit?  Borland EXEs need not display copyright
info, but do contain it.  If not already tried, text-search the EXE for
"opyright" - use something better than DOS find, MiniTrue for example.
If found, "Borland" and dates indicative of version should be nearby.
If the EXE has been zipped, these will not appear; in that case, the EXE
may be largely constant-length text lines, and otherwise it will not.

The program is, most probably, in Borland's Turbo Pascal or Borland
Pascal; those are the products which sold widely, etc. etc.; or
Microsoft Quick Pascal, which was much the same, but didn't.  The older
it is, back to the mid-eighties, the more likely that is to be true
(though extended was introduced in TP4, about 1987)

Quote:
>  It runs in plain ol' PC DOS.  I have the source code which is why
>I'm asking these questions as there are strangeness in the source code.
>The questions that I have are:
>Is Pascal a case sensitive language?

No.  There *could* be a version that is, but it would seem unlikely.

Quote:
>  The reason for this is that I have
>some variables in the subroutines that just don't seem to be properly used
>elsewhere and don't seem to be in the var list.

They could be provided by the system unit or other library units.  Their
names could be powerful clues to the supplier and version.

Quote:
>I assume that the :extended keyword after a variable means that the variable
>is a double or other extended length variable.

Double, in Borland and others, is IEEE 8-byte float.  Extended, in
Borland, is 10-byte float.  See my pas-real.htm & pas-type.htm, via sig.

Quote:
>Would I be correct in assuming that the following is a coment:

No, but it *is* a comment.

Quote:
>  (*some
>text*) (***) and that the comments can run to multiple lines in the first
>example?

In Pascal, newline has no more significance than space, in general but
not in strings.  (* and { open comment.  Borland require a matching
closure; others treat them as equivalent.  // comment is Delphi, if it
otherwise looks Pascal.

I've read that in c.l.p.a-i; you should have IMHO asked in c.l.p.misc
*instead*.  In c.l.p.a-i, they greatly dislike admitting knowing
anything useful about non-a-i Pascal.

*** DO NOT MULTIPOST ***

XP, FU set.  If it *is* Borland, transfer to c.l.p.borland.

--

  <URL: http://www.*-*-*.com/ ; TP/BP/Delphi/&c., FAQqy topics & links;
  <URL: http://www.*-*-*.com/ ;   RAH Prins : c.l.p.b mFAQ;
  <URL:ftp://garbo.uwasa.fi/pc/link/tsfaqp.zip> Timo Salmi's Turbo Pascal FAQ.



Tue, 18 Oct 2005 20:40:06 GMT  
 Questions from an assembly language programmer trying to convert a Pascal like program.

Quote:

> I've read that in c.l.p.a-i; you should have IMHO asked in c.l.p.misc
> *instead*.  In c.l.p.a-i, they greatly dislike admitting knowing
> anything useful about non-a-i Pascal.

You were perhaps being a bit sarcastic, but, I would like to point out that
this is not the case. The specific charter of this group is Pascal with emphasis
on the original standard language. So, for example, differences between
non ISO Pascals and ISO Pascals is germane here, as well as any other standards
related issues.

In addition, when a user comes here with an entirely non-standard and implementation
specific issue, I try to first guess what Pascal they are using, give what
little I know about the other Pascal, and direct them to the proper newsgroup
for that.

I like to think that we represent Pascal the language in general here, and not just
a particular version of Pascal. Several people pointed out that comp.lang.pascal.misc
served that purpose when this group was created, but I felt, then as well as now,
that Pascal had become associated in most peoples minds with being a Borland
product by default, which made general Pascal discussions difficult there.

The only change I would make is to term this group .iso or .std now, being as the
ANSI has disavowed their standard for Pascal.

--
Warning: poster of this email may be under the influence of
sleep inducing documents !



Wed, 19 Oct 2005 12:07:48 GMT  
 Questions from an assembly language programmer trying to convert a Pascal like program.

Quote:


> > I've read that in c.l.p.a-i; you should have IMHO asked in c.l.p.misc
> > *instead*.  In c.l.p.a-i, they greatly dislike admitting knowing
> > anything useful about non-a-i Pascal.

> You were perhaps being a bit sarcastic, but, I would like to point out that
> this is not the case. The specific charter of this group is Pascal with emphasis
> on the original standard language. So, for example, differences between
> non ISO Pascals and ISO Pascals is germane here, as well as any other standards
> related issues.

> In addition, when a user comes here with an entirely non-standard and implementation
> specific issue, I try to first guess what Pascal they are using, give what
> little I know about the other Pascal, and direct them to the proper newsgroup
> for that.

> I like to think that we represent Pascal the language in general here, and not just
> a particular version of Pascal. Several people pointed out that comp.lang.pascal.misc
> served that purpose when this group was created, but I felt, then as well as now,
> that Pascal had become associated in most peoples minds with being a Borland
> product by default, which made general Pascal discussions difficult there.

> The only change I would make is to term this group .iso or .std now, being as the
> ANSI has disavowed their standard for Pascal.

As someone will no doubt notice, I lost track of what group I was posting in.
Apologies. The comments are still valid.

--
Warning: poster of this email may be under the influence of
sleep inducing documents !



Wed, 19 Oct 2005 14:20:27 GMT  
 Questions from an assembly language programmer trying to convert a Pascal like program.
Many compilers make EXE programs that jump from the starting area and put
the copyright notice of the code there or put it later in the data segment
of an EXE program.  I am quite familiar with using Debug for finding things
and have often done "cute" things with programs from using Debug.
I'll also note that there are no BGI files (display type files) so it ain't
Borland.
Been a programmer for 30 years now as a side adjunct ot my engineering
carrier.  I prefer hardware but am quite comfortable in a number of
assemblers for different processors and even some higher language tools.  It
has been probably 15 years at least since I last looked at a Pascal program
and had to do anything with it.

--
Bob May
Why is there an Ozone Hole at the South Pole but Not at the North Pole?
Somebody's been lying to you!



Thu, 20 Oct 2005 07:14:27 GMT  
 Questions from an assembly language programmer trying to convert a Pascal like program.

Quote:

> Many compilers make EXE programs that jump from the starting area and put
> the copyright notice of the code there or put it later in the data segment
> of an EXE program.  I am quite familiar with using Debug for finding things
> and have often done "cute" things with programs from using Debug.
> I'll also note that there are no BGI files (display type files) so it ain't
> Borland.

No, that means it doesn't use graph. It could still use a different graphics unit.
(like one of the many vesa units)

Quote:
> Been a programmer for 30 years now as a side adjunct ot my engineering
> carrier.  I prefer hardware but am quite comfortable in a number of
> assemblers for different processors and even some higher language tools.  It
> has been probably 15 years at least since I last looked at a Pascal program
> and had to do anything with it.

First, try to determine the type of the file (16-bit, extender, Windows,
OS/2, other?), and then look for runtime library identifier strings, symbol info,
dll imports  etc.

I usually use the unix (or cygwin under windows) file and strings commands
as a quick start for that.



Thu, 20 Oct 2005 07:22:13 GMT  
 Questions from an assembly language programmer trying to convert a Pascal like program.
The program runs under PC's DOS and there is only one file, the EXE file.  I
haven't seen this with what Pascal like programs that I've seen that have
been compiled.
You are right in that there is no graphics put out by the program, only text
that is very simply formatted by spaces with a newline for each output.  The
other part is that the program sends its results out to the printer which is
a bad thing when the printer isn't fired up and running under Windoz doesn't
allow it to send the output to a file (a windoz ability) instead of the
printer, indicating some nastiness in how it sends data to the printer.  The
odd thing is that the printer isn't setup by the program code so I would
assume that the windoz is having some strange problems with the way that the
default sending to the printer exists with the compiler code production.

--
Bob May
Why is there an Ozone Hole at the South Pole but Not at the North Pole?
Somebody's been lying to you!



Fri, 21 Oct 2005 03:51:09 GMT  
 Questions from an assembly language programmer trying to convert a Pascal like program.

Quote:

> The program runs under PC's DOS and there is only one file, the EXE file.  I
> haven't seen this with what Pascal like programs that I've seen that have
> been compiled.

Ok (not that I assume you mean _pure_ dos, not some windows dosbox)

Quote:
> You are right in that there is no graphics put out by the program, only text
> that is very simply formatted by spaces with a newline for each output.

Then it doesn't need graph or .bgi's.

Quote:
> The other part is that the program sends its results out to the printer
> which is a bad thing when the printer isn't fired up and running under
> Windoz doesn't allow it to send the output to a file (a windoz ability)
> instead of the printer, indicating some nastiness in how it sends data to
> the printer.
> The odd thing is that the printer isn't setup by the program
> code so I would assume that the windoz is having some strange problems
> with the way that the default sending to the printer exists with the
> compiler code production.

This paragraph is a bit vague.

First,

let's do some definitions.
- dos : a state without windows. (windows booted to dos-mode is good enough tho)
- Windows : something that describes application compability, similar look and some
        other common characteristiscs. However
        also confusing because it can also mean Win 3.x or so. Win32 is already a much
        better term for this.
- Windows 9x  : win95,98 and ME.  Same family.
- Windows NT (family)  : NT4, 2000 and XP. There are older ones but those are arcane.

9x and NT family are that different that it would be correct to treat them
as separate operating systems in a lot of ways.

Why is this important? For this issue, mainly because Windows 9x is much
more dos-compatible than Windows NT.

Second, printing.  (from memory, can have small omissions etc)

In (both types of) Windows printing goes via a device driver, and then goes
to the (driver of the) hardware port. The driver is from the vendor, and it
(and the printer vendor) alone knows the protocol of the printer. If the
protocol isn't a common one (postscript, PCL), the printer is useless with
your next OS unless the printer provides a driver.

Under Dos it is more difficult, because there are three ways:

1 output directly to the hardware port (mosttimes the paralel port), but
        even that can happen in several ways.  
        1-1 as pure ascii text.
        1-2 via a reasonably standard protocol called "epson escape codes", which
           are like html tags in the ascii code, to set fonts etc.
        1-3 directly speaking the protocol of the printer, whatever that is. WordPerfect
          is a typical
2 via "dos" device driver. This is a pretty much rudimentary device driver that can be
        replaced, and simply throws the data to the hardware port, without much printing.
        there is a program standard delivered with dos called graphics.com which should allow
        some form of dumping the current screen graphically to a certain set of reasonably
        compatible printers.

The problem is that the average app can do all of these, and even combinations (install a driver,
        then print to the device driver etc)

A lot of printer drivers under win9x have some provision to tap of the
printer port, so check your windows printer driver for parts mentioning
dos-compability, and try to turn it on. Look for phrases like "capturing dos printer output" or
"capture lpt1" or so.

Also under w9x, the fully direct way still works. However nearly no contemporary printers can
interpret ascii or escape codes anymore.  



Fri, 21 Oct 2005 06:03:20 GMT  
 Questions from an assembly language programmer trying to convert a Pascal like program.
Generally, if I have a DOS program and I run it under windoz rather than the
computer running DOS, the printer will tend to work as the printer driver is
setup.  This program seems to mess with the windoz so that printing to a
file part doesn't work.
I'll note that the program is a pure old time DOS program that was
originally written back in the '80s and luckily for me, the source code came
with the package.
FWIW, the program determines the parameters of an optical test for a conic
surface.  OPD is short for Optical Path Difference, an indicator of how
accurate the test is going to be.
--
Bob May
Why is there an Ozone Hole at the South Pole but Not at the North Pole?
Somebody's been lying to you!


Sat, 22 Oct 2005 01:25:07 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Some basic questions from a assembly language programmer

2. Assembly language in Turbo Pascal

3. from Turbo Pascal to Assembly Language ??

4. CONVERT PASCAL TO ASSEMBLY

5. Advice for Pascal Programmers trying to read C/C++ code

6. Math functions in Assembly language.

7. Pascal question from non-Pascal programmer

8. Book recommendations for assembly language???

9. Assembly Language Book Recommendations???

10. asm9812h.zip x86 Assembly Language FAQ, html version, Raymond Moon

11. assembly language

12. Friday 13th, try it yourself (was Language Wars..)

 

 
Powered by phpBB® Forum Software