News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

PowerBASIC and the Cambridge Test

Started by Gunther, March 01, 2022, 06:34:44 PM

Previous topic - Next topic

Gunther

Cambridge is an old, venerable university and has a whole series of famous graduates: Francis Bacon, Isaac Newton, James Clerk Maxwell or Ludwig Wittgenstein, to name but these. If you want
to study - lets say - Mathematics in Cambridge, you have to pass the Cambridge Test of Mathematics for University Admission (TMUA). It contains 20 different tasks. The time to solve is 75 minutes.
That means: For each problem 3 minutes and 45 seconds are available. That's not much time, because the questions are demanding.

I will present here one of the tasks and show how to solve it; it's about an exponential equation. This is demonstrated in detail in the file EXPO.PDF. I wrote this text with LaTex; the corresponding
source file EXPO.TEX is a portion of the archive. After the task is done, it must still be shown that we've really found the solutions of the exponential equation. That's not part of the Cambridge test
anymore, but we do it for completeness.

The program EXPO.EXE serves for this purpose. I used PowerBASIC for DOS to do that job. That's the little brother of the two 32 bit PB compilers. But this DOS compiler knows the data type REAL10
and can handle it correctly. The same cannot be said of MSVC, for example. Under PB the data type is called Extended. For the check, this is recommended; in both solutions the logarithm plays a role.
These values are usually irrational, if not transcendent. Therefore, the best available accuracy must be used for that calculation, to minimize rounding errors. The README.TXT file contains more details
about the sources and files of the archive.

The program itself is a real mode program and should run under quite all configurations. I have tested it under native DOS, the DOS emulations of 32 bit Windows, Linux, BSD and OS/2 Warp 4.
It also runs without problems under various virtual machines and inside DOSBox. That's tested, too.

A feedback from other members would be nice. I'm interested in: Were the text and the calculations comprehensible? Does the program run under other configurations?

Many thanks in advance.
You have to know the facts before you can distort them.

hutch--

Gunther,

It looks like nice clean code but with Win10 not having a 16 bit subsystem, I cannot run it. I have not had a 16 bit capable OS since XP that would still run DOS apps. Sorry I cannot be much use to you here.

Gunther

Thank you for the reply, Steve.

Quote from: hutch-- on March 01, 2022, 08:59:35 PM
It looks like nice clean code but with Win10 not having a 16 bit subsystem, I cannot run it. I have not had a 16 bit capable OS since XP that would still run DOS apps. Sorry I cannot be much use to you here.

DOSBox will do the job. Even poorly written DOS programs cannot do any harm in this sandbox. I have installed version 0.74-3 on my Win 10 machine. This runs without problems.

You have to know the facts before you can distort them.

FORTRANS

Quote from: Gunther on March 01, 2022, 06:34:44 PM
A feedback from other members would be nice. I'm interested in: Were the text and the calculations comprehensible? Does the program run under other configurations?

Hi Gunther,

   Text and calculations were quite clear and, for a quick read,
seemed comprehensible.  I may have to read it again with more
care for some of the logarithmic transforms.  And the program
runs with Windows 2000, but seems a bit spare compared to
the PDF.

Regards,

Steve N.

HSE

I Gunther!

Quote from: Gunther on March 01, 2022, 06:34:44 PM
I used PowerBASIC for DOS to do that job.

Fantastic, I was missing that piece of history. For sure Zale also worked in Turbo Pascal because is exactly same way to include assembly modules.

If you tested in DosBox then DosBox-X isn't working well.

Regards, HSE
Equations in Assembly: SmplMath

TimoVJL

Quote from: HSE on March 02, 2022, 01:52:13 AM
Fantastic, I don't know that piece of history. For sure Zale also worked in Turbo Pascal because is exactly same way to include assembly modules.
Anders Hejlsberg is behind Turbo Pascal, then Delphi, then C# and vb.Net
May the source be with you

HSE

#6
Quote from: TimoVJL on March 02, 2022, 02:43:10 AM
Anders Hejlsberg is behind Turbo Pascal
At same time that Zale was working in Turbo Basic?

Later:
  I found that Zale left Borland in 1989, and Hejlsberg enter to Borland that year. But Borland have a license of Hejlsberg's Pascal before 1983, and  worked together in direct or indirect way.
Equations in Assembly: SmplMath

Gunther

Quote from: HSE on March 02, 2022, 01:52:13 AM
Fantastic, I was missing that piece of history. For sure Zale also worked in Turbo Pascal because is exactly same way to include assembly modules.

I had known Bob Zale and Dave Navarro since the late 80's from the CompuServe forum. Bob was an excellent programmer. He wrote both the compilers for TurboBASIC
and PowerBASIC completely in assembler. If you want to know more historical details you can find them here or here. Another good source is Hutch, who worked
very closely with Bob at times. Asking him costs nothing.

I'm not entirely sure, but I think Bob had little to do with TurboPASCAL. The fact that OBJ files are included in TurboBASIC and TurboPASCAL in the same way is probably
related to Borland's design specifications. Casually, Bob Zale was a member here on the forum until the very end. 
You have to know the facts before you can distort them.

Gunther

Steve,

thank you for your answer.  :thumbsup:

Quote from: FORTRANS on March 02, 2022, 12:44:00 AM
...  And the program runs with Windows 2000 ...

Another configuration in which the program does its job. Windows 2000 was between Windows ME and Windows XP, if I remember correctly. That must be a pretty old machine running.

Quote from: FORTRANS on March 02, 2022, 12:44:00 AM
... but seems a bit spare compared to the PDF.

That is clear. In the PDF file the complete solution is explained in detail. The PowerBASIC program, on the other hand, only performs the following function: Once you have calculated the
solutions, they are substituted into the initial equation to verify that they are correct. This procedure is called inference or conclusion. The software does just that and only that.   
You have to know the facts before you can distort them.


Gunther

Quote from: TimoVJL on March 02, 2022, 06:00:08 PM
Memories of Turbo Pascal version 1.0 - Anders Hejlsberg, United States - Community Blogs - Embarcadero Community

Thank you for the link. This confirms what I already presumed in this post. However, this question is only a minor aspect. This thread is mainly about PowerBASIC and the
Cambridge Test - as it states in the title. TurboPASCAL doesn't play any role.
You have to know the facts before you can distort them.

HSE

#11
Thanks Timo and Gunther!

Quote from: Gunther on March 02, 2022, 10:12:00 PM
This thread is mainly about PowerBASIC and the Cambridge Test - as it states in the title. TurboPASCAL doesn't play any role.

:thumbsup:

Making the object with TASM or ML the binary is 1408 bytes bigger. That is with PB/DOS 3.5. I think you reported previously some size diferences using differents tools.
Equations in Assembly: SmplMath

FORTRANS

Hi Gunther,

Quote from: Gunther on March 02, 2022, 12:52:55 PM
Steve,

thank you for your answer.  :thumbsup:

   You are welcome.

Quote
Quote from: FORTRANS on March 02, 2022, 12:44:00 AM
...  And the program runs with Windows 2000 ...

Another configuration in which the program does its job. Windows 2000 was between Windows ME and Windows XP, if I remember correctly.

   IIRC; 95 => 98 => ME;  NT => 2000 => XP:

QuoteThat must be a pretty old machine running.

   Well yes, I suppose.  I got it in late December 2000.  P-III running
Windows 2000 and OS/2 Warp 4.  And your program runs with OS/2
as well.

Cheers,

Steve

Gunther

Quote from: HSE on March 03, 2022, 12:50:02 AM
Making the object with TASM or ML the binary is 1408 bytes bigger. That is with PB/DOS 3.5. I think you reported previously some size diferences using differents tools.

I have also used PB 3.5. The difference comes from the assembler. The OBJ file generated by JWASM has a size of 343 bytes. Other assemblers obviously insert a whole lot of junk.
No wonder that large binary clumps are then created. JWASM, on the other hand, is fast and produces small binaries. This is one of the reasons why this assembler is my first choice.
Japheth has really written an excellent program. It's a very good tool to work with.

You have to know the facts before you can distort them.

Gunther

Steve,

Quote from: FORTRANS on March 03, 2022, 01:18:49 AM
And your program runs with OS/2 as well.

Yes, I've tested that. It works with the DOS emulation of Warp 3 and Warp 4.

Quote from: FORTRANS on March 03, 2022, 01:18:49 AM
   IIRC; 95 => 98 => ME;  NT => 2000 => XP:

I was already sitting in front of a machine with NT 3.5 in 1994. NT 4.0 was released at the end of July 1996, ahead of Windows 98. I know this pretty well because the university spent vast sums
of money on equipping the labs with software back then.

Quote from: FORTRANS on March 03, 2022, 01:18:49 AM
Well yes, I suppose.  I got it in late December 2000.  P-III running Windows 2000 and OS/2 Warp 4.

So the machine has been running for over 20 years. :cool: :thumbsup:  That's impressive. At that time there were still floppy disk drives. Today's young people don't even know what that is anymore.
You have to know the facts before you can distort them.