Avioding Stacks

This is a discussion on Avioding Stacks within the C++ Programming forums, part of the General Programming Boards category; Is it possible to program a application and no use stacks? I need to do this because I am trying ...

  1. #1
    Registered User
    Join Date
    Dec 2004
    Posts
    6

    Avioding Stacks

    Is it possible to program a application and no use stacks?

    I need to do this because I am trying to convert my program to be a ".com" insted of ".exe", and when doing this, you cannot have a stack.

    If you know how to aviod stacks, or have a compiler/IDE that can make a program compile into ".com", I would be very greatfull.

    Thanks in advance.

  2. #2
    30 Helens Agree neandrake's Avatar
    Join Date
    Jan 2002
    Posts
    640
    .com executables are for the DOS system. You need to find out settings for your compiler (if the compiler supports it), that will output a .com instead of .exe. I don't remember the specifics on the subject though, you could try googling for more detailed answers.
    Environment: OS X, GCC / G++
    Codes: Java, C#, C/C++
    AOL IM: neandrake, Email: neandrake (at) gmail (dot) com

  3. #3
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    Even a .com is capable of using a stack. An x86 program cannot function without it. The thing is, there's VERY little of it.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  4. #4
    Registered User
    Join Date
    Dec 2004
    Posts
    6
    OK, thanks for your answers.

    Can someone point me to a link where I can find a compiler that supports .com?

  5. #5
    30 Helens Agree neandrake's Avatar
    Join Date
    Jan 2002
    Posts
    640
    Unfortunately, having com or .com in a search doesn't return much to what you're looking for. Maybe someone here knows another term/phrase to describe .com files so you can narrow your search.
    Environment: OS X, GCC / G++
    Codes: Java, C#, C/C++
    AOL IM: neandrake, Email: neandrake (at) gmail (dot) com

  6. #6
    Registered User
    Join Date
    Dec 2004
    Posts
    6
    Yea, I tried on a few different search engines, and a bunch of different word combos, and I got nothing either.

  7. #7
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    com files are just pure binary code - the very first byte of the file is executable. they can use the stack but just remember the entire program (stack and all) must fit into a single segment (64K). many compilers allow you to create binary output using a specific command-line switch. I can't remember off the top of my head, but I think GCC's is -fbin.
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  8. #8
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,546
    > Can someone point me to a link where I can find a compiler that supports .com?
    www.compilers.net
    Look for the ancient turbo c 2.01 from borland

  9. #9
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    You can still get it right from Borland themselves.

    Quzah.
    Hope is the first step on the road to disappointment.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Please Help Me With This Code Of Implementing Stacks
    By raghu_equinox in forum C Programming
    Replies: 3
    Last Post: 10-19-2006, 07:22 AM
  2. ...multiplication using stacks
    By iiwhitexb0iii in forum C Programming
    Replies: 1
    Last Post: 10-09-2006, 01:28 AM
  3. Stacks
    By Pressure in forum C Programming
    Replies: 9
    Last Post: 02-27-2005, 01:10 PM
  4. Dumping singly linked list into 2 stacks.
    By strotee76 in forum C++ Programming
    Replies: 5
    Last Post: 05-16-2004, 05:48 PM
  5. Stacks stacks stacks
    By Unregistered in forum C Programming
    Replies: 4
    Last Post: 06-06-2002, 02:01 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21