Archive for the ‘Turbo Pascal’ Category
Posted by jpluimers on 2019/07/31
Patching code at debug-time: [WayBack] It’s a blong, blong, blong road…: ‘What if?’ scenario analysis in the CPU window.
Remember:
- There are dragons
- Patching too many bytes will kill a kitten and likely your application.
- Bytes in memory might not be what they seem, especially when having breakpoints (and the debugger frantically trying to set/remove $CC bytes for the INT 3 instruction)
I’ve done this for 20+ years and usually use the $90 byte (NOP instruction) though your experience may be different.
–jeroen
Posted in Debugging, Delphi, Development, Pascal, Software Development, Turbo Pascal | Leave a Comment »
Posted by jpluimers on 2019/05/01
Eric Grange:
Actually it is not that assignments of function return values can happen “when the function raises an exception” but rather than they can happen before the function returns.
Note that this is not limited to large return types, it can also happen on reference counted types (string, dynamic array, variant and interface), though this is contextual as well…
Got bit by the interface thing a few months ago, an interface release was triggering an exception when the result was assigned, the call stack looked way out of synch with the code, so various compilation and and map file mismatch issues got investigated, before I dropped in asm view in the debugger, which made it all obvious.
I’ve quoted it in full as I’ve been bitten by this a few times as well, but never got to making a proper blog post on it.
Thanks Eric for phrasing this and David for bringing it up.
It actually has been the case since somewhere toward the end of the Turbo Pascal era.
Source: [WayBack] This program: {$APPTYPE CONSOLE} uses System.SysUtils; type TRec1 = r…
–jeroen
Posted in Delphi, Development, History, Pascal, Software Development, Turbo Pascal | Leave a Comment »
Posted by jpluimers on 2019/04/05
Back in my school days, this was the best Pascal book you could get: “Advanced Pascal Programming Techniques” – Google Search.
This is Apple Pasca, USD Pascal, first Turbo Pascal era.
Sadly, getting English books in The Netherlands was hard. So I had to do with books from Academic Press which not as good.
Via:
–jeroen
Posted in Apple Pascal, Borland Pascal, Development, History, Pascal, Software Development, Turbo Pascal, UCSD Pascal | 1 Comment »
Posted by jpluimers on 2018/01/10
As a by-effect, this article seems to one of the few that shows where Delphi uses the .dres file extension introduced around Delphi XE.
Recently I had to play some notification sounds in a Windows Delphi application where the application deployment should be as easy as possible: preferable copying the EXE around.
Playing a sound file seems easy, especially if it is a [WayBack] WAV file: just use the [WayBack] PlaySound or the (older) [WayBack] sndPlaySound API functions.
But if you start searching on the internet, you see lots of curious implementations for playing WAV resources through sndPlaySound.
The actual implementation is really really easy though, just make sure you follow the steps right and nothing can go wrong.
[WayBack] The full source code is on my BeSharp.net repository, here is how to to it step by step:
The steps depend on the MMSystem unit, so most of the code translates back to [WayBack] Turbo Pascal for Windows (yes, the 16-bit Pascal days when the MMSystem unit was introduced) with the exception of the SND_SENTRY flag.
The thing that more recent Delphi versions made a lot easier is embedding WAV files as WAVE resources, more on that further on. Read the rest of this entry »
Posted in Borland Pascal, Delphi, Delphi 2, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 3, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Development, Pascal, Software Development, Turbo Pascal | Leave a Comment »
Posted by jpluimers on 2017/10/26
I did find my Borland Pascal 7.0.1 ISO which showed that https://github.com/romiras/turbo-pascal-archive/blob/master/Files/Dos%20Navigator/FORMAT.ASM is identical to ./BP/RTL/TV/FORMAT.ASM which is used from ./BP/RTL/TV/DRIVERS.PAS to provide this:
{ String formatting routines }
{$L FORMAT.OBJ}
procedure FormatStr(var Result: String; const Format: String; var Params);external {FORMAT};
There are various examples like in ./BP/EXAMPLES/DOS/TVDEMO/ASCIITAB.PAS at line 143:
FormatStr(TempStr, ' Char: %c Decimal: %0# Hex: %0#x ', ASCIIChar);
So it was in the Drivers unit, but also easy to incorporate in your own unit by linking the .OBJ file and providing the external declaration in any unit.
The Drivers unit is very independent of the rest of Turbo Vision: it uses the Objects unit (which most projects use as the System unit at ~500 lines of code provided very little functionality by itself).
For the diskette based install, the .TPU files were on the standard disks and the sources for both RTL and Turbo Vision on separate disks, but anyone would install them as they provided a lot of insight. The CD-ROM has them all on the same medium (both as installers and unpacked in the BP directory).
I just checked Turbo Pascal 6.0 (that I did have a VM for) which has them in the same way.
Source: [WayBack] We’re discussing with the collegues: anybody knows when Format function was introduced in Delphi? – Klaus Edelmann – Google+
–jeroen
Posted in Borland Pascal, Delphi, Development, History, Pascal, Software Development, Turbo Pascal | Leave a Comment »
Posted by jpluimers on 2017/02/16
I recently found some old magazine issues of my early programming escapades. It reminded me of the really old days where – as a school kid – I tried to buy Nibble magazine at a regular base. It was expensive (I think it was around 8 Dutch Guilders (or NLG) – close to EUR 4 – which was a lot for me, though less expensive than diskettes that were like NLG 10 each).
But it was fun as the magazine focussed at computer programs and programming transitioned my life. From Integer Basic via AppleSoft Basic (and various smaller attempts in FORTH, MuSimp, LISA Assembler and LOGO) to Turbo Pascal on CP/M.
Recently I learned that all issues (16k pages total!) have been scanned and OCR-ed and can be obtained on DVD for a modest price. Even better: all their software is available for free.
Just follow these links:
For some history:
–jeroen
Posted in //e, 6502, Apple, Apple ][, Development, History, Pascal, Power User, Software Development, Turbo Pascal | Leave a Comment »
Posted by jpluimers on 2016/11/23
Apple fanboys all know about 1 Infinite Loop. Turbo Pascal adepts about the index entries “infinite loop See loop, infinite” and “loop, infinite See infinite loop”.


Google as a more direct approach: www.google.com/search?q=recursion
Read the rest of this entry »
Posted in Algorithms, Apple, Borland Pascal, Design Patterns, Development, Google, Pascal, Power User, Software Development, Turbo Pascal | Leave a Comment »
Posted by jpluimers on 2016/04/06

Anders Live – Build 2016 – Channel 9 Stage C907 – Speakers: Anders Hejlsberg, Seth Juarez
Anders explaining about being a pragmatist ever since he started working on the Turbo Pascal predecessor in 1981. It’s been a long way to TypeScript and beyond (:
Lot’s of interesting tidbits about the future of TypeScript and how it relates to other languages.
Source: Anders Live | Build 2016 | Channel 9
Direct URLs:
–jeroen
PS:
The Turbo Pascal predecessors were called Blue Link Software Pascal, Compas Pascal and Poly Pascal as I learned last year while teaching a workshop for DAPUG in Denmark when I bumped into some people working with Anders while he still lived there a long time ago. Later I researched the above links.
Posted in .NET, C#, Delphi, Development, History, Pascal, Software Development, Turbo Pascal | 1 Comment »
Posted by jpluimers on 2015/12/02
A small video reference to the work that Peter Sollich did for the Pascal world is at around 38:20 in this video: https://www.youtube.com/watch?v=btGj-PocjeU#t=2298
It is where Allen Bauer talks about his early years at Borland. He talks about a German guy there without naming him. It is Peter Sollich (he names them a few time in the newsgroups though).
Peter Sollich came from Germany where he had written a Turbo Pascal compatible compiler for the Atari ST (it used a m68k Motorola 68000 CPU which is a 32-bit processor on the internal side with a 16-bit wide data bus (transporting 16-bit words) on the outside using a 24-bit address (so it can address 16 mebibytes of memory) – hence ST for Sixteen/Thirtytwo).
Borland bought the source code which formed the base for the current 32-bit x86 compiler implementations of both Delphi and C++ Builder (they hired him as a contractor to do the port).
Rumour goes that Peter wrote many parts of the x86 code emitter on the flight from Europe to the USA.
Before the ST era there was already a CP/M Modula-2 compiler written by Peter Sollich and Martin Odersky which Borland bought even earlier and was turned into Turbo Modula-2.
For people interested, here are some links with ore details – where possible I saved them in the WayBack machine as sites tend to Ditch historically important information:
–jeroen
Posted in .NET, Borland Pascal, Delphi, Development, Pascal, Software Development, Turbo Pascal | 4 Comments »