Help with 8085 entering in a number > 9

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

  1. mikep395

    mikep395 New Member

    Joined:
    Sep 28, 2008
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Im trying to enter in a digit between 0 and 255 and store it in a register. I understand how to use BDOS to put a keyboard value into the A register but i cant figure out how to get the right value for a 2 or 3 digit number...
     
  2. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,009
    Likes Received:
    203
    Trophy Points:
    63
    Occupation:
    Senior Support Engineer
    Location:
    England
    Initialise some other register X to zero
    1: Read the keyboard into A
    Calculate the value represented (subtract the ASCII value of 0, probably, and range check it)
    Error handling
    X=X*10+A
    Repeat from 1 until the input suggests the user has finished inputting data.
     

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