Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

FPC 16-bit (Announce)

posted by Rugxulo Homepage, Usono, 30.04.2013, 14:00

> > > FYI Initial 16-bit target support (small mm only for now) was merged
> into
> > FPC
> >
> > COOOOOOOOOOOOOOOOOOOOOOOL :-)
> >
> > Hadn't you dropped 16-bit support in favor of "GO32V2" cca 20 years ago
> ?
> > It's never too late to correct critical faults :-)
>
> I had nothing to do with this port :-)

IIRC, FPC (circa 1993) was originally compiled with TP (16-bit) and intended as 32-bit TP dialect replacement (since Borland defected to Windows) and eventually became self-hosted for 32-bit DOS (GO32v1) target only. Then everybody went cuckoo for Cocoa Puffs for Delphi (1997?).

> I left 16-bit for new projects +/- 1997

DEC brought out the Alpha in 1992, why didn't you jump ship earlier? They have a Pascal compiler. Heck, GPC might actually build there too. ;-)

> when I started with FPC, and ported all remaining stuff to it in 2000.

Almost funny considering how much the 1.x series is regarded as so weak in hindsight.

> (mostly because I started using Windows
> NT/2000 at work, and soon after at home too). I kept a 386 mobo for a while
> for minimalistic stuff, but as hardware started to pile up, I got rid of
> it.

Yes, admittedly, 2000 and XP were flawed but still somewhat serviceable for DOS stuff. But stuff after that ... not so much. It's kinda ugly having so many wars over competing tech.

> Note that it is all still very initial, and I haven't heard the exact plans
> (asked for rationale, Nikolay said "because I can"). E.g. how many TP
> idiosyncrasies (think inline($54) etc) are going to be implemented.

There are other 16-bit Pascal subset-ish compilers and VMs out there. Even P4/P5 is well-documented, but I've not delved enough to even pretend to port that (to 32-bit, much less 16-bit) as actual native compiler.

> Self hosting (16-bit compiler that generates 16-it programs) is probably
> out of the question. (at least if I my memory is correct and 286pm only
> does 16MB max) So probably it will always be (64/)32-bit -> 16-bit
> crosscompile.

You can use EMS on 8086 or XMS on 286. IIRC, Jason Burgon (GVFM dude) once said you can get about 128 MB from 16-bit Borland DPMI, maybe more with HDPMI16 or (which?) Windows or DPMIONE. And of course always swap to hard drive if needed.

You really don't need lots of RAM to make a compiler. You can either split off into several passes (like early Modula-2) or just don't try to support the full Delphi XE2 ten bazillion functions, operators, keywords, forms, IDE, smart linker, etc.

> Yesterday hello world (and thus the whole RTL startup) ran on a 80186
> (LX200 iirc)

I know people love those, but they're hard to find. My silly Android tablet has aDOSBox [sic], but it's dirt slow. I haven't bothered much with it. I assume eventually somebody could port something natively useful to FPC, which more or less claims to support Android and ARM in trunk (right?). Pascal-S is too wimpy, but P5 is (so far) too hard. Well, and people demand graphics, forms, whatever, so P5 is probably uninteresting to 99% of Pascal fans. (Though using GPC builds of P5 or even old TP55 under aDOSBox is probably possible, if desperate, but I've had no huge need.)

There's another (Delphi-compiled, HX friendly IIRC) DOS cross-compiler (.COM only) subset on SourceForge, public domain, though I don't know how useful or interesting it is.

http://sourceforge.net/projects/xdpascal/files/

I've intentionally tried not to cloud this thread, esp. since I'm no compiler expert. But suffice to say, it's complex. The two biggest issues seem to be trying to use all available memory (and peripherals) as well as interfacing with the outside world (libs, ABIs, linking).

Quite honestly, I know it's not quite the same, but I wonder if it would be equally worthwhile to port something simple like Pascal-S interpreter. (I'm not sure if it's been done reliably before. There are a lot of half-broken offshoots and maybe Ada- or Seed7-hosted versions floating around, dunno.) Though I know it already can compile quite easily (minimal changes) with FPC, but I'm thinking about translating into other languages (Modula-2? Oberon?), not necessarily C. Though it's fairly pointless except as an exercise. Heck, I've not even gotten a grip on ye olde PL/0 yet. (As cool as self-hosting is, I can't help but wonder if it'd be wiser to be more neutral. Knuth's original WEB and TeX were very Pascal subset-ish, meant to be easy to port to other languages. Though that's another ball of wax I've not delved into yet.)

 

Complete thread:

Back to the forum
Board view  Mix view
22632 Postings in 2109 Threads, 402 registered users, 356 users online (0 registered, 356 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum