Thread: Converting MINI-BASIC in MASM over to C++?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Sure, here you go.

    That's the one that Soma uploaded to the Bitbucket. If that doesn't work, let us know what messages etc you get.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    I've just worked over the token_scanner code to make it "has-a" instead of "is-a". It makes the code much easier to read, I think.

    Expect more work in the tokenizer area, see the repo for more details.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Registered User
    Join Date
    Jun 2004
    Posts
    76
    Quote Originally Posted by matsp View Post
    Sure, here you go.

    That's the one that Soma uploaded to the Bitbucket. If that doesn't work, let us know what messages etc you get.

    --
    Mats
    Says "Program too big to fit into memory".

    Paul

  4. #4
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    It runs fine for me. What system are you running? I wonder if running strip.exe (a program to remove unnecessary information from the executable) had anything to do with it? I've included a the pre-stripped version here, just in case you want to try it out. Another option (though I'm not sure you're familiar with) is to build the program from the source with a C++ compiler.
    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;
    }

  5. #5
    Registered User
    Join Date
    Jun 2004
    Posts
    76
    Quote Originally Posted by Sebastiani View Post
    It runs fine for me. What system are you running? I wonder if running strip.exe (a program to remove unnecessary information from the executable) had anything to do with it? I've included a the pre-stripped version here, just in case you want to try it out. Another option (though I'm not sure you're familiar with) is to build the program from the source with a C++ compiler.
    I'm running Windows XP SP2.

    Paul

  6. #6
    Registered User
    Join Date
    Jun 2004
    Posts
    76

    Question

    Quote Originally Posted by Sebastiani View Post
    It runs fine for me. What system are you running? I wonder if running strip.exe (a program to remove unnecessary information from the executable) had anything to do with it? I've included a the pre-stripped version here, just in case you want to try it out. Another option (though I'm not sure you're familiar with) is to build the program from the source with a C++ compiler.
    Is this the latest release?

    Paul

  7. #7
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    When you load minibasic, or when you load a basic program into minibasic?

    If the latter, what program are you loading?

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  8. #8
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    I downloaded the zip-file onto my work-machine, and although I haven't got any basic file to load into it, it certainly works as far as getting a "Ready" prompt, and a 10 Print "Hello, World" works fine too.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  9. #9
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    >> I've just worked over the token_scanner code to make it "has-a" instead of "is-a". It makes the code much easier to read, I think.

    The more I think of, the more that makes sense. After all, half of the code was sprinkled with token_scanner:: qualifiers, to avoid potential confusion. So, yeah, good call.
    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;
    }

  10. #10
    Registered User
    Join Date
    Jun 2004
    Posts
    76
    Now it works.

    Paul

  11. #11
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    OK, good. Let us know if you find any bugs or have any problems with it.
    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;
    }

  12. #12
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    I've just updated the code quite dramatically. I'm not sure at this point if I've broken something - running pitman in game-mode seems to work correctly.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  13. #13
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    Alright. I'm tied up in a project at the moment, but as soon as I have a chance I'll check it out.
    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;
    }

  14. #14
    Registered User
    Join Date
    Jun 2004
    Posts
    76
    Looks good.

    Paul

  15. #15
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    >> How's the port coming along?

    I was actually waiting to see if you had found any bugs or missing features. If not, I suppose we can make a final release out of it, but I just wanted to make sure that everything was working properly before doing that.
    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;
    }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Converting textBox1->Text into a basic string.
    By azjherben in forum C++ Programming
    Replies: 5
    Last Post: 06-07-2009, 08:27 PM
  2. [ANN] New script engine (Basic sintax)
    By MKTMK in forum C++ Programming
    Replies: 1
    Last Post: 11-01-2005, 10:28 AM
  3. what are your thoughts on visual basic?
    By orion- in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 09-22-2005, 04:28 AM
  4. VC++ 6 & MASM (eek)
    By cboard_member in forum C++ Programming
    Replies: 2
    Last Post: 07-16-2005, 10:00 AM