Everybody! This is important. In a few days, these forums will be moving over to using the totally sweet Discourse platform. To ensure this migration happens smoothly with no loss of content, these forums are currently in a read-only mode. I do apologize for the inconvenience.

There is never a good time to turn the forums off for an extended period of time, but I promise the new forums will be a billion times better. I'm pretty sure of it.

See you all on the other side in a few days, and if you have any (non-technical) questions, please e-mail me at kirupa@kirupa.com. For technical questions, try to find a tutorial that corresponds to what you are looking for and post in the comments section of that page.

Cheers,
Kirupa

Results 1 to 6 of 6

Thread: need help with assembly languange using MASM615 32bit

  1. #1

    need help with assembly languange using MASM615 32bit

    Okay I just need help and some shed on light how to overcomes this I mean from start..since I'm beginner with assembly...maybe expertise here can help me out by point me the rite path on how to dig it...

    ok here's the scenario I have to solve

    Code:
    A predetermine number is stored in an array named ANS.The number will be a 4-digit number, like 1234.Only numbers 0 to 9 is permitted.The player will be prompted to guess the number in the correct sequences.Clues will be given to help the player make the next guess.The clues are as follows
    
    *  -->  right number and right place
    +  --> right number but wrong place
    &  --> wrong number and wrong place
    
    sample:
    
    Say the right answers is 1245.
    User inputs:  1234
    output      :  **&+
    
    Player are given 9 try to get the right answers
    So I'm really help from expertise on how to start it I mean after define the array and get the input from user here's are my code currently....hope someone will give me some shed light on how to solve it.... really need help..any help are appreciated..

    here's the code just for my starting..

    Code:
    TITLE masterclassgame       <masterclassgame.asm>
    
    
    
    INCLUDE Irvine32.inc
    
    .data
    
    ANS SWORD 1,2,3,4
    RESTRICTED SWORD 0,5,6,7,8,9
    
    inputUser BYTE "Please Enter Your Answers :",0
    
    .code
    
    main PROC
    
        mov edx,OFFSET inputUser
        call WriteString
        call Crlf
        call ReadInt
        ;how to assign input user into my variable???
    
        mov ebx,OFFSET ANS              ;point to array
        mov ecx,LENGTHOF ANS            ;loop counter
    
        call Crlf
        exit
    
    main ENDP
    
    End main
    Hope will get help from expertise...tq in advanced
    Last edited by pixeldude; April 15th, 2008 at 05:15 AM.
    from mars..

  2. #2
    Were you provided the WriteString, Crlf and ReadInt functions? I only really know how to read single key presses in assembler using the interrupt controller, but reading it from the console is not something I'm familiar with. I've also never before seen those OFFSET and LENGTHOF keywords and main PROC and main ENDP syntax, probably because I've never used the MASM compiler. Not sure if I can help you.
    Wait, what?

  3. #3
    Quote Originally Posted by Voetsjoeba View Post
    Were you provided the WriteString, Crlf and ReadInt functions? I only really know how to read single key presses in assembler using the interrupt controller, but reading it from the console is not something I'm familiar with. I've also never before seen those OFFSET and LENGTHOF keywords and main PROC and main ENDP syntax, probably because I've never used the MASM compiler. Not sure if I can help you.
    Yeahh coz I'm using TextPAd for the IDE and using MASM615 32bit for windows....and anyway thanks for the reply and concern Voetsjoeba...tq for ur times..
    from mars..

  4. #4
    Well if you were given the ReadInt routine then it shouldn't be a huge problem to figure out where it stores its result value. I'm guessing it would likely be stored in a register for fast and easy passing. Of course, if you were not given the ReadInt routine then you'd need to write it yourself, and that may get tricky. I think I could whip something up, but I don't think it would be very flexible.
    Wait, what?

  5. #5
    Quote Originally Posted by Voetsjoeba View Post
    Well if you were given the ReadInt routine then it shouldn't be a huge problem to figure out where it stores its result value. I'm guessing it would likely be stored in a register for fast and easy passing. Of course, if you were not given the ReadInt routine then you'd need to write it yourself, and that may get tricky. I think I could whip something up, but I don't think it would be very flexible.

    Erm..kind of interested of what will u come up with Voets..since I'm struggling myself here...try to rectifying the logic here...what I can imagine now is...comparing the user input with each array value by looping...the rest still lost ....


    like to see what's u can come up with maybe from there I will get the idea..hope so...

    tq again
    from mars..

  6. #6

    Robot1

    bump ...


    anyone?
    from mars..

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012