Thread: assembly in c++

  1. #1
    Registered User
    Join Date
    Aug 2001
    Posts
    47

    assembly in c++

    Does anyone knows how can I create and output to the screen something that is not a ASCII symbol.... for exemple a smile.....
    I belive you can do that in assembly and call that fuction latter on in C++, unfortunetly I forgot all assembly I learned 15 years ago...
    Can anyone also supply me some short examples or some good tutorials for that.... i've just looked on the web and I've got too many asm tutorials, can anyone tell me witch one might be the most sutable for my needs...

    Thanks
    I'm a person with a simple taste...
    I only like the best.

  2. #2
    Registered User foniks munkee's Avatar
    Join Date
    Nov 2001
    Posts
    343
    I am guessing this isn't what you are talking about.. (No asm to be seen!)
    Code:
    #include <iostream>
    
    using namespace std;
    
    int main()
    {
            cout << static_cast <char> (1) << endl;
    
            cin.get();
    
            return 0;
    }
    What exactly is it your trying to do? Do you mean you want to create a graphic that can be displayed to the console, but is not an ascii character. If so, you probably don't need ASM to do this.
    "Queen and huntress, chaste and fair,
    Now the sun is laid to sleep,
    Seated in thy silver chair,
    State in wonted manner keep."

  3. #3
    Registered User
    Join Date
    Aug 2001
    Posts
    47
    Yes... thats what i'm trying to do.... but unfortunetly, my knowledge on C++ is also a bit forgotten... is there a way i can do it without asm ??? how, please tell me...

    thanks
    I'm a person with a simple taste...
    I only like the best.

  4. #4
    Registered User
    Join Date
    Aug 2001
    Posts
    47
    What I would like is to draw a snake to use o my snake game, for example, i've been looking on the net and it seams that i can do that trhu VGA mode ???? were ca i get a good tutorial of VGA and will this solve my problem or am I going complitely in the wrong direction ???
    I'm a person with a simple taste...
    I only like the best.

  5. #5
    Pursuing knowledge confuted's Avatar
    Join Date
    Jun 2002
    Posts
    1,916
    Try Allegro or SDL....
    Away.

  6. #6
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    Man, you are way off. It has nothing to do with assembly. It has to do with how your OS translates numerical values into a visual symbol. To illustrate, I will give you a peek into my world of 'subsystem assembly programming'. Note that the code *is* copywrite protected.

    Code:
    int main()
    {
       for(int i = 0; i < 256; ++i)
      {
       printf("%c", i);
      }
     system("pause");
    }
    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;
    }

  7. #7
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398

    Talking Right! ...Copyright!

    Note that the code *is* copywrite protected.
    Sebastiani, I hope you're not serious.

    1- I don't think you are the first person to "create" this code snippit. In order for a copyright to be valid, the material has to be unique... I could copyright a poem (if I were a poet), but I cannot copyright the phrase "Hello, how are you?"

    2- If you don't want anybody using your code, don't post it on the Internet! (You don't loose your legal copyright by publishing on the net, but you do loose practical control.)

  8. #8
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    I was trying (although perhaps not well enough) to be sarcastic.

    What a goober.

    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;
    }

  9. #9
    Grammar Police HybridM's Avatar
    Join Date
    Jan 2003
    Posts
    355
    Sebastiani, I hope you're not serious.
    Wow.


    dhrodrigues, ASCII isn't just letters, punctuation and numbers.
    There are some other symbols in there too, including a couple smiley faces and shaded blocks.
    I suspect you're not writing windows programs here, so have a look at the ASCII characters and use them. Use sebastiani's code to see them all.
    Thor's self help tip:
    Maybe a neighbor is tossing leaf clippings on your lawn, looking at your woman, or harboring desires regarding your longboat. You enslave his children, set his house on fire. He shall not bother you again.

    OS: Windows XP
    Compiler: MSVC

  10. #10
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398

    Extended ASCII characters are not standard.

    including a couple smiley faces and shaded blocks.
    Note that these special "characters" are system-dependent. The ASCII standard goes from 0 to 127. 128 - 255 will vary. Here's an ASCII chart.

    Thank's for confirming you were joking, Sebastiani. I was worried that you might be an SCO employee!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Learning Assembly
    By mrafcho001 in forum Tech Board
    Replies: 5
    Last Post: 03-12-2006, 05:00 PM
  2. C to assembly interface
    By Roaring_Tiger in forum C Programming
    Replies: 4
    Last Post: 02-04-2005, 03:51 PM
  3. assembly language...the best tool for game programming?
    By silk.odyssey in forum Game Programming
    Replies: 50
    Last Post: 06-22-2004, 01:11 PM
  4. True ASM vs. Fake ASM ????
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 7
    Last Post: 04-02-2003, 04:28 AM
  5. C,C++,Perl,Java
    By brusli in forum C Programming
    Replies: 9
    Last Post: 12-31-2001, 03:35 AM