DOSes written in assembly (Developers)
> > > Can you explain why it is not appropriate for FreeDOS to be written in
> > C?
> >
> > I didn't say "appropriate", I just don't like C, no offense meant.
I find ANSI C89 reasonable, but I usually prefer ISO or TP Pascal (or derivatives).
> I tried to learn C by starting with Borland C but then my programs
> wouldn't compile under GCC nor CodeBlocks: each had its own complaints.
Code::Blocks is an IDE, not a compiler, but it supports several:
"GCC (MingW / GNU GCC), MSVC++, clang, Digital Mars, Borland C++ 5.5, Open Watcom, …and more"
> Sounds like you didn't write according to the actual C89/C90
> standard, which is ... a total joy to read.
tcc/bcc have -A to switch on ANSI. I think you also need "-ff-". It could be various hidden problems (memory model, total RAM limits, library bugs, undefined behavior, file system). Usually you want to also test with "gcc -ansi -pedantic -Wall -Wextra" and/or lint.
> Show me one single program that follows the C90 standard,
> and compiles on Borland C, but doesn't compile on GCC etc.
Most reasonable things are possible, but only with effort (and testing). There's a lot of gotchas in portability (and bugs in compilers).
> > Also I'm happy with
> > FreePascal/Lazarus. I'm trying to run UCSD Pascal under DOS and, if
> > possible again, even as a bootable version. But that is just dreaming
> > now.
UCSD's P system was its own OS and was offered as an alternative to PC-DOS or CP/M-86.
DOS has (or can use) many Pascal compilers (FPC, GPC, Irie, P5, Alice, p2c, TP, TMT, VP under HX).
> My question is more generic, but you appear to have
> answered it below, which would have been "what's
> wrong with Pascal for writing an OS?".
Pascal (with variations) has indeed been used for OSes. (GCC was originally based upon Pastel, "an off-color Pascal".) But the language itself didn't inherently have system-specific stuff. Modula-2 and Oberon were more commonly used for OSes and put the non-portable stuff in pseudo-module SYSTEM.
>> Programs written in assembly are smaller and faster than ones
>> written in C or Pascal.
Not necessarily. Sure, if you write every instruction by hand, you don't need calling conventions or stack frames, and you can hand-optimize better and not rely on bloated overly-generic libraries. Actually, bytecode can be MUCH smaller but usually slower. And strictly smaller doesn't always mean faster.
People willingly trade speed for convenience. As flawed as C and Pascal are for portability, they're much better for program maintainability.
Complete thread:
- DOSes written in assembly - Ruud, 31.03.2024, 08:48 (Developers)
- DOSes written in assembly - Rugxulo, 31.03.2024, 09:42
- DOSes written in assembly - ecm, 31.03.2024, 10:01
- DOSes written in assembly - Laaca, 31.03.2024, 17:09
- DOSes written in assembly - boeckmann, 31.03.2024, 18:52
- DOSes written in assembly - Ruud, 01.04.2024, 08:06
- DOSes written in assembly - RayeR, 01.04.2024, 20:24
- DOSes written in assembly - Ruud, 01.04.2024, 08:06
- DOSes written in assembly - tom, 31.03.2024, 20:00
- DOSes written in assembly - samwdpckr, 01.04.2024, 20:54
- DOSes written in assembly - kerravon, 04.04.2024, 15:11
- DOSes written in assembly - Ruud, 07.04.2024, 14:45
- DOSes written in assembly - kerravon, 07.04.2024, 16:55
- DOSes written in assembly - Rugxulo, 08.04.2024, 02:45
- Disassembly quality - ecm, 14.04.2024, 19:33
- DOSes written in assembly - kerravon, 07.04.2024, 16:55
- DOSes written in assembly - Ruud, 07.04.2024, 14:45
- DOSes written in assembly - rr, 07.04.2024, 17:24
- DOSes written in assembly - Ruud, 07.04.2024, 21:48
- DOSes written in assembly - Rugxulo, 31.03.2024, 09:42