none
How much C++ changed over years since dos days? RRS feed

  • Question

  • Hello, im currently programming in c# however im planing on changing the main language i use. I'm really fascinated in dos era programming and bringing life to the old things so i was thinking on getting into c++. However when i learn it i both want to learn the old ways and the new ways (not the visual part ofc). Of course it would be really tough two c++'es that are completely different from each other, would be awesome to port whatever i made in one of the systems to other easily, is the modern c++ suitable for that or should i try C instead? And since we are on the topic how much has C changed over years (talking about the latest versions of C that runs on dos ofc)?
    Wednesday, January 16, 2019 5:11 PM

Answers

  • Content Removed
    • Marked as answer by xanrer Wednesday, January 16, 2019 8:03 PM
    • Unmarked as answer by xanrer Wednesday, January 16, 2019 8:04 PM
    • Marked as answer by xanrer Wednesday, January 16, 2019 8:06 PM
    • Edited by Andrew B. Painter Friday, January 18, 2019 2:29 AM
    Wednesday, January 16, 2019 7:25 PM

All replies

  • Well, if you have an antique machine that really has a version of dos as it's operating system you can try Antique Software: Turbo C version 2.01


    Wednesday, January 16, 2019 5:49 PM
  • The thing is, even though there are lots of people who claim you can't, you can use C++ for embedded programming, so it isn't as if C++ can't be used for these constrained environments.

    The problem with using modern C++ for DOS is getting a toolset to do it. As far as I'm aware, there is no toolset that is capable of compiling modern C++ that can generate executables for 16 bit DOS. DJGPP seems like it uses a DOS extender to allow it to generate 32 bit protected mode executables, so this means if you are planning on getting a DOS program written to run on an 80286 or older, then you cannot use a modern compiler.

    The last Microsoft compiler that I know of that was able to target 16 bit DOS was Visual C++ 1.52. This was released in 1993 and so this means it was before C++ was even standardised. This also means that standards wise, this only supports C89/90 too.

    But a lot has changed architecture wise too. The x86 processor has gone from real mode in DOS, to protected mode in Windows. This makes accessing memory and hardware a lot different so you couldn't use the same application for both DOS and Windows easily.


    This is a signature. Any samples given are not meant to have error checking or show best practices. They are meant to just illustrate a point. I may also give inefficient code or introduce some problems to discourage copy/paste coding. This is because the major point of my posts is to aid in the learning process.

    Wednesday, January 16, 2019 6:31 PM
  • Back in the day, Borland also released a DPMI DOS extender -- If memory serves, it was included in the Borland C++ Powerpack.

    Fond memories...

    Wednesday, January 16, 2019 6:41 PM
  • Content Removed
    • Marked as answer by xanrer Wednesday, January 16, 2019 8:03 PM
    • Unmarked as answer by xanrer Wednesday, January 16, 2019 8:04 PM
    • Marked as answer by xanrer Wednesday, January 16, 2019 8:06 PM
    • Edited by Andrew B. Painter Friday, January 18, 2019 2:29 AM
    Wednesday, January 16, 2019 7:25 PM
  • Hello, im currently programming in c# however im planing on changing the main language i use. I'm really fascinated in dos era programming and bringing life to the old things so i was thinking on getting into c++. However when i learn it i both want to learn the old ways and the new ways (not the visual part ofc). Of course it would be really tough two c++'es that are completely different from each other, would be awesome to port whatever i made in one of the systems to other easily, is the modern c++ suitable for that or should i try C instead? And since we are on the topic how much has C changed over years (talking about the latest versions of C that runs on dos ofc)?

    Edit:  Actually it looks like the original DJGPP site is still active?!  http://www.delorie.com/djgpp/
    waitwaitwait! where you the one who wrote the long info? Please don't delete that that was very informative regardless.
    • Marked as answer by xanrer Wednesday, January 16, 2019 8:06 PM
    • Unmarked as answer by xanrer Wednesday, January 16, 2019 8:06 PM
    Wednesday, January 16, 2019 8:06 PM
  • I want to point out here, like I did in my own post, DJGPP clearly states that it is a 32 bit environment. This means that the applications it generates use a 32 bit extender to start up and enables it to use a flat model. This requires a 80386 processor or newer.

    If you wish to target an 80286 or older, DJGPP is not an option.

    I mention this because the OP mentioned a fascination with DOS era programming, but never mentioned the target. For example, if they wanted to go after an IBM XT or AT, then these have either an 8088 or an 80286 processor. DJGPP would not be able to generate executables that could run on these.

    Retro computers are becoming more popular these days after all.


    This is a signature. Any samples given are not meant to have error checking or show best practices. They are meant to just illustrate a point. I may also give inefficient code or introduce some problems to discourage copy/paste coding. This is because the major point of my posts is to aid in the learning process.

    Wednesday, January 16, 2019 9:46 PM
  • Thank you again Andrew, i don't mind info being longer than usual, in fact it saves me the time of looking at several other sites to have a grip on the topic. I think you should start a blog, some of the people doesn't like long answers and that's totally fine with me too yet i don't mind any long answer either.
    I don't want to touch on the moderator topic in fact i think you should delete what you wrote too, that would just give that certain somebody the right to punish you even more. And i think you are a person that this community needs.
    Thank you for all the info again.
    • Edited by xanrer Wednesday, January 16, 2019 9:55 PM
    Wednesday, January 16, 2019 9:55 PM
  • I want to point out here, like I did in my own post, DJGPP clearly states that it is a 32 bit environment. This means that the applications it generates use a 32 bit extender to start up and enables it to use a flat model. This requires a 80386 processor or newer.

    If you wish to target an 80286 or older, DJGPP is not an option.

    I mention this because the OP mentioned a fascination with DOS era programming, but never mentioned the target. For example, if they wanted to go after an IBM XT or AT, then these have either an 8088 or an 80286 processor. DJGPP would not be able to generate executables that could run on these.

    Retro computers are becoming more popular these days after all.


    This is a signature. Any samples given are not meant to have error checking or show best practices. They are meant to just illustrate a point. I may also give inefficient code or introduce some problems to discourage copy/paste coding. This is because the major point of my posts is to aid in the learning process.

    I know its 32 bit only but i just didn't wanted to push my luck to be honest, something like DJGPP even existing is a big deal for me, i do like to program with 16bit yet it seems it will take alot more effort to learn both the modern and the old (i do need the modern c++ too for other things). And in the end i have to get along with nASM so i said its fine for at least some practice on dos programming, i haven't even got to c++ yet im trying to switch languages at the moment.
    But thank you for pointing it out regardless.
    Wednesday, January 16, 2019 10:57 PM
  • I actually completely missed that.  I only ever programmed for DOS with Borland compilers or in Assembly.  I'm honestly even drawing a blank as to what Assembler I ever used before nASM.

    As a Borland guy you probably used TASM and Turbo Debugger. :)

    So it seems like you're down to finding a downloadable version of Borland's Turbo C for DOS, if you can find one on something like a trustworthy site.

    I previously posted a link for Turbo C 2.01 (freely downloadable) from Embarcadero.


    • Edited by RLWA32 Thursday, January 17, 2019 1:13 AM
    Thursday, January 17, 2019 1:12 AM
  • I believe pretty fully that no compiler that was ever written would compile a COM, and I'm pretty sure that's what you'd need on the versions of DOS that would be compatible with a 286

    Borland C++ 2 was able to produce COM files, and yes, I've used this for an "embedded system" made of a 286 PC motherboard and custom ISA card, with this COM file burned in a ROM, and bootstrapped directly by the BIOS :~\

    That was my first paid job after leaving the Soviet Union in 1991.

    -- pa


    • Edited by Pavel A Thursday, January 17, 2019 1:48 AM
    • Proposed as answer by Andrew B. Painter Thursday, January 17, 2019 5:50 PM
    Thursday, January 17, 2019 1:48 AM
  • When I say "go full ASM" you should be hearing the chanting voices saying "JOOOOIIIIINNNNN USSSSSSSSSS" all around you.  You can decide for yourself whether they're the voices of Angels or... 

    The whole comment put a great smile to my face yet im completely terrified of ASM, even though sometimes i feel like i shouldn't give my 5-10 years to c++ and instead of that just go full ASM which will be a journey that will never end for entirety of my life. The main problem is there is no complete and decent source of education i know and for something that great i don't think i'd find anything.
    Thursday, January 17, 2019 2:54 PM

  • I recall that in my original post content (later deleted to make way for the DJGPP link) I had found/included a link to Turbo C on something like Embarcadero.com - actually getting a download would require a login account with that site, and I had commented in the post that I couldn't vouch for the site in quality or trust.  

    The "edn" in the link to Turbo C stands for "Embarcadero Developers Network".

    When it comes to the former Borland/Turbo lines of development tools
    Embarcadero is about as trustworthy a source as you can find, given that
    they own those tools. They acquired them from Borland/Inprise when that
    company divested itself of its developer tools business. They have 
    continued to develop and release C++Builder and Delphi, and recently
    followed Microsoft's example and released a full free Community version
    of C++Builder:

    C++Builder® - Community Edition
    https://www.embarcadero.com/products/cbuilder/starter

    "Full-Featured Free C++ IDE for Creating Native Cross-Platform Apps"

    You can also get the C++ command line compiler for free:

    C++ Compiler - FREE TOOL
    https://www.embarcadero.com/free-tools/ccompiler

    "The BCC32C/BCC32X Compiler is the high performance foundation and core 
    technology of Embarcadero's award-winning C++Builder product line."

    C++Builder® - Overview
    https://www.embarcadero.com/products/cbuilder

    - Wayne

    Thursday, January 17, 2019 4:44 PM