Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

32-bit MSDOS (Announce)

posted by marcov, 03.07.2021, 19:06

> > I agree with mceric here. You risk having to rewrite minimize programs
> to
> > suit the minimal C functionality, reducing the compiler to some basic C
> > equivalent syntax and libraries only.
>
> Does ISO Pascal, standardized in 1990, same
> time as C90, have more functionality than
> it's C counterpart?

Pascal dialects are complex, and most used dialects do not confirm to standards. First, the most common dialect family, the Borland derived dialects are not ISO compliant. They derive from a pre standard bootstrap subset used for the important UCSD dialect. (the one that popularized bytecode)

Second there are three important standards. The 1983 Standard Pascal standard (ISO 7185) which has two levels, level zero and one. The difference is afaik most conformant arrays and schemata, things that are strangely modern (Safe constructs for static procedural programming, has echoes in Ada,Rust,Go syntax)

And the 1990 Extended Pascal standard. (Iso 10206:1990)

I'd say Standard Pascal is a bit larger than standard C, and less keen on not having constructs that require runtime support, but because it doesn't assume a linear memory model, it does not allow things like pointer arithmetic. Think of pointers like handles only. You can malloc and free them, but not manipulate them. So it is not a complete superset.

The level 1 extensions allow to define data types with variable sized arrays inside (e.g. for static char[] in structs), and for those variant parts (so called discriminants) to be only chosen at a new() call (a typed malloc call, like new in C++)

Extended Pascal adds modular programming.

Free Pascal however was not standard compliant and supported the much more popular Borland dialects (Turbo Pascal, Delphi). The latter in particular includes everything and the kitchen sink.

Most importantly for you this side of the dialects (and the default mode of FPC) adds among others pointer manipulation.

> Pascal programmers, of which I am now one, do
> not speak with one voice. Some of us see the
> value in supporting the only public domain
> operating system that supports Win32 executables.

Yeah, I get it, only for you. I was still reacting with a long view of resurrecting a Windows 95 port for public consumption, but it is clear it is not going that way.

> > Pascal can directly call C counterparts. Just do the
> > glue code in pascal and call the C function. Then you
> > don't need stubs or nothing.
>
> I don't know how to do that. I know (very) basic
> assembler though.

Pascal is mostly like C with different syntax. You can't assign anything in-expression like C can, and you don't have a ? operator, and some of the most complicated union definitions can't always get translated (though on x86 that is not important as the limitations have to do with architectures with complex forms of alignment)

But for the rest you can mostly convert C to Pascal 1:1 as soon as you know the base syntax. Doing as much as possible in HLL make the result more resilient. (to e.g. calling convention and name mangling changes)

 

Complete thread:

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