how to convert ascii to binary(vice versa)help please

Discussion in 'Assembly Language Programming (ALP) Forum' started by valley_07, Sep 23, 2008.

  1. valley_07

    valley_07 New Member

    Joined:
    Sep 23, 2008
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    hello..
    i have a problem on how to convert ascii to binary using codes in assembly language.
    please post the code so i caN study it..
    thanks.
     
  2. oogabooga

    oogabooga New Member

    Joined:
    Jan 9, 2008
    Messages:
    115
    Likes Received:
    11
    Trophy Points:
    0
    In which assembly language?
    What exactly is the problem?
     
  3. valley_07

    valley_07 New Member

    Joined:
    Sep 23, 2008
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0

    here is the code..

    mov ah,aL
    and aL,00FH
    ADD AL,009h
    DHA
    adc aL,040h
    DAA
    XCHG AH,AL
    SHR AL,1
    SHR AL,1
    SHR AL,1
    SHR AL,1
    ADD AL,090H
    DAA
    ADC AL,040H
    DAA
    ADC AL,040H
    DAA
    XCHG AH,AL

    IS THAT CODE CORRECT?

    what i'm asking for is the code on how you can convert acii characters to binary.
    i'm using notepad and when i'm testing the code i'm using the command prompt.
    hope you can give the code for my quarry,,

    i really need to know on how to convert ascii to binary in assembly
     
  4. valley_07

    valley_07 New Member

    Joined:
    Sep 23, 2008
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    up up..still need answers..
    thank you
     
  5. oogabooga

    oogabooga New Member

    Joined:
    Jan 9, 2008
    Messages:
    115
    Likes Received:
    11
    Trophy Points:
    0
    I still don't understand what you are trying to do.
    And I can't comprehend your code at all.
    Getting late here. (yawn) Goodnight.
     
  6. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,009
    Likes Received:
    203
    Trophy Points:
    63
    Occupation:
    Senior Support Engineer
    Location:
    England
    Not sure why you're asking if the code is correct. Does it perform the conversion you want? If it does then it's correct. If not then it isn't. If not, what isn't it doing; explain exactly what the problem is. Could you clarify what you mean by "convert ASCII to binary" with a couple of examples, for example A is 65 in ASCII, given input A would you want the program to display 0100 0001?

    Also there are lots of different microprocessors each with its own assembly language. Which processor are you using?
     
  7. misee10

    misee10 New Member

    Joined:
    Apr 6, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    hey, this is my problem to....
    @xpi0t0s the one that you were tellling was exactly my problem could you help?...
    ...please....
     
  8. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,009
    Likes Received:
    203
    Trophy Points:
    63
    Occupation:
    Senior Support Engineer
    Location:
    England
    What help do you need? valley_07 has already posted some code; can you adapt that to your needs?
     
  9. misee10

    misee10 New Member

    Joined:
    Apr 6, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    it didnt work here....i used what he used and it has errors
     
  10. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,009
    Likes Received:
    203
    Trophy Points:
    63
    Occupation:
    Senior Support Engineer
    Location:
    England
    Did the assembler just print "errors" or did it say something more helpful?
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice