Re: [Freedos-devel] FreePascal near to far pointer conversion

2023-11-08 Thread Ralf Quint via Freedos-devel
On 11/8/2023 11:40 AM, Bernd Böckmann via Freedos-devel wrote: Hi all, has anyone recently played around with the FreePascal 8086 cross compiler to generate DOS executables? I try to convert a near pointer to a far pointer while working under the small memory model, but that is not as trivial

Re: [Freedos-devel] FreePascal near to far pointer conversion

2023-11-08 Thread Bernd Böckmann via Freedos-devel
Hi Ralf, the tests I did showed that FreePascal is perfectly capable of producing reasonably small binaries fitting the small memory model, if you do not require the full language feature set (stay away from ObjFpc / Delphi modes). SysUtils and exception handling pulls in a significant amount

Re: [Freedos-devel] FreePascal near to far pointer conversion

2023-11-08 Thread Rugxulo via Freedos-devel
Hi, On Wed, Nov 8, 2023 at 1:42 PM Bernd Böckmann via Freedos-devel wrote: > > has anyone recently played around with the FreePascal 8086 cross > compiler to generate DOS executables? I try to convert a near pointer to > a far pointer while working under the small memory model, but that is > not

Re: [Freedos-devel] FreePascal near to far pointer conversion

2023-11-08 Thread Rugxulo via Freedos-devel
Hi, On Wed, Nov 8, 2023 at 2:21 PM Bernd Böckmann via Freedos-devel wrote: > > the tests I did showed that FreePascal is perfectly capable of producing > reasonably small binaries fitting the small memory model, if you do not > require the full language feature set (stay away from ObjFpc / Delphi

Re: [Freedos-devel] FreePascal near to far pointer conversion

2023-11-09 Thread Aitor Santamaría via Freedos-devel
Hello, Could you please post the exact message you got from the compiler? I got mysefl problems with such convertions trying to compile FD-KEYB with FPC, but although I posted for help in the forums, I didn't get anything really useful and finally gave up. But I am curious if you get the same err

Re: [Freedos-devel] FreePascal near to far pointer conversion

2023-11-09 Thread Bernd Böckmann via Freedos-devel
Hello Aitor, > Could you please post the exact message you got from the compiler? For something like this "FarPointer(@Buffer)" I get the following error message: "Error: Illegal type conversion: "Pointer" to "FarPointer"" My opinion is that this should be supported by the compiler, because

Re: [Freedos-devel] FreePascal near to far pointer conversion

2023-11-09 Thread Bernd Böckmann via Freedos-devel
Btw, when compiling in large memory model via fpc -Wmlarge the pointer errors when compiling keyb are gone. There are some 20 remaining compile errors. Perhaps these can be solved. Bernd On 09.11.2023 23:38, Bernd Böckmann via Freedos-devel wrote: Hello Aitor, > Could you please post the e

Re: [Freedos-devel] FreePascal near to far pointer conversion

2023-11-09 Thread Danilo Pecher via Freedos-devel
As far as I know the earlier Turbo-Pascal compilers (I think 5.5 and earlier) have been freeware'd years ago. They can natively compile 16bit code on Freedos and might be worth a try. You can find even ancient versions of TP, like 3.0 on winworldpc, and I actually quite like to go down memory lane

Re: [Freedos-devel] FreePascal near to far pointer conversion

2023-11-10 Thread Bernd Böckmann via Freedos-devel
Hello Hippo, thanks for the hint. I have a copy of Borland Pascal 7 inherited from my father. In fact I think I have learned programming with it when I was a kid, or with a previous version. Fascinating piece of software. But I prefer to build open tools with open tools :-) Greetings, Bernd

Re: [Freedos-devel] FreePascal near to far pointer conversion

2023-11-10 Thread Bernd Böckmann via Freedos-devel
> > I believe int64 was originally from Delphi. (Isn't there also "long > long" support in OpenWatcom via "-za99“?) Hello Rugxulo, Yes, Watcom C supports 64-bit integer arithmetic, in contrast to Turbo C 3.1, which to my knowledge does not, but silently interprets „long long x“ as „long x“, yi

Re: [Freedos-devel] FreePascal near to far pointer conversion

2023-11-11 Thread Rugxulo via Freedos-devel
Hi, On Thu, Nov 9, 2023 at 4:39 PM Bernd Böckmann via Freedos-devel wrote: > > > Could you please post the exact message you got from the compiler? > > For something like this "FarPointer(@Buffer)" I get the following error > message: > > "Error: Illegal type conversion: "Pointer" to "FarPointer

Re: [Freedos-devel] FreePascal near to far pointer conversion

2023-11-11 Thread Rugxulo via Freedos-devel
Hi again, On Fri, Nov 10, 2023 at 7:56 AM Bernd Böckmann via Freedos-devel wrote: > > > > > I believe int64 was originally from Delphi. (Isn't there also "long > > long" support in OpenWatcom via "-za99“?) > > Yes, Watcom C supports 64-bit integer arithmetic, in contrast to Turbo C 3.1, > which

Re: [Freedos-devel] FreePascal near to far pointer conversion

2023-11-12 Thread Bernd Böckmann via Freedos-devel
On 12.11.2023 02:44, Rugxulo via Freedos-devel wrote: FarAddr internal function Thanks, that brings me further :-) I also changed my coding style from a more C oriented style to a more Pascal like. Unlike in C, one does not have to pass around (explicit) pointers that often. For example inst

Re: [Freedos-devel] FreePascal near to far pointer conversion

2023-11-12 Thread Rugxulo via Freedos-devel
Hi, On Sun, Nov 12, 2023 at 5:46 AM Bernd Böckmann via Freedos-devel wrote: > > On 12.11.2023 02:44, Rugxulo via Freedos-devel wrote: > > But I still have not found an elegant solution yet to do a widening > conversion of an untyped pointer from near to far. > Should be rarely needed though. For

Re: [Freedos-devel] FreePascal near to far pointer conversion

2024-01-01 Thread Aitor Santamaría via Freedos-devel
Hello there! Sorry for being late on the topic. The following link directs to the forum item that I opened when trying to re-compile FD-KEYB under FPC. Basically, KEYB needs to use different procedures to store a key in the buffer, depending on the parameters and system configuration. The problem

Re: [Freedos-devel] FreePascal near to far pointer conversion

2024-01-01 Thread Bernd Böckmann via Freedos-devel
Perhaps you may first try get it running with the large memory model, and if this runs, try to optimize it for a smaller memory model? The following least compiles for me, with A BUNCH of warnings, and the binary is 68k in size, comparing to 11k in the bin folder (did you UPX compress it or is