1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

assembl language c++ help

Discussion in 'C++' started by Jedson3614, Nov 2, 2010.

  1. Jedson3614

    Jedson3614 New Member

    Nov 2, 2010
    Likes Received:
    Trophy Points:
    I need help with writing a program, im really frustrated. i am trying to write a program that check a large string for vowels aeiou and AEIOU also i have another part of the assingment that asks me to write a program that searches for 0123456789, have no idea how to search for numbers, and the first part of the assignment i understood and it is working right, i was asked to scan an entire string for periods ".". Can anyone help me here is an example of my code.
    your properly formatted assembly language data here
        char refstr[] = "In 1987 I received my first teddy bear.I took him everywhere with me.There wasn’t a thing me and teddy wouldn’t tell each other.Teddy had 10 buttons, 02 eyes"
                         ", and money wise was priceless to me. It's 2010, what shall I do with this old friend of mine? He now has 03 buttons 01 eye, and no nose!I’ve got it!" 
                         "I will give it a new home. Perhaps you could use a teddy bear?";
        unsigned short int ans = 0;
         __asm {
    //  your syntatically correct assembly language code here 
    //  column alignment markers below (to guide you)
    //      |       |                          |
            cld                                ;
            lea     edi,refstr                 ;
            mov     cx,379                     ;
            mov     al,'a'                     ;
            repne scasb
            cmp     cx,0                       ;
            je      skip1                      ;
            inc     ans                        ;
            cmp     cx,0                       ;
            ja      more1                      ;
         cout << "The number of vowels = " << ans;
    Last edited by a moderator: Nov 3, 2010

Share This Page