Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Assembly Language Programming (ALP) Forum (http://www.go4expert.com/forums/assembly-language-programming-forum/)
-   -   Help with 8085 entering in a number > 9 (http://www.go4expert.com/forums/help-8085-entering-9-t14250/)

mikep395 29Sep2008 00:55

Help with 8085 entering in a number > 9
 
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...

xpi0t0s 22Oct2008 22:02

Re: Help with 8085 entering in a number > 9
 
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.


All times are GMT +5.5. The time now is 20:42.