Example of input a single digit, Computer Engineering

Assignment Help:

Q. Example of Input a Single Digit?

Input a Single Digit for example (0,1, 2, 3, 4, 5, 6, 7, 8, 9)

 CODE SEGMENT

  ...

; Read a single digit in BL register with echo. No error check in the Program 

  MOV AH,  01H

                         INT 21H

; Assuming that the value entered is digit, then its ASCII will be stored in AL. 

; Suppose the key pressed is 1 then ASCII '31' is stored in the AL. To get the 

; Digit 1 in AL subtract the ASCII value '0' from the AL register.

; Here it store 0 as ASCII 30, 

; 1 as 31, 2 as 32.......9 as 39

; To store 1 in memory subtract 30 to get 31 - 30 = 1  

MOV BL, AL

SUB   BL, '0'; '0' is digit 0 ASCII

           ; OR

SUB BL, 30H

; Now BL contain the single digit 0 to 9

; The only code missing here is to check whether the input is in the specific

; Range.

...

CODE ENDS.


Related Discussions:- Example of input a single digit

Find out the correction to be applied in decimal adder, The correction to b...

The correction to be applied in decimal adder to the generated sum is ? Ans. 00110 is the generated sum when the correction to be applied in decimal adder. While the 4 bit su

Dbms, Disadvantages of file processing system

Disadvantages of file processing system

Describe clusters in cellular systems, Question: a) With the help of a...

Question: a) With the help of a diagram, describe clusters in cellular systems. b) Describe the role of the following components in the GSM architecture Radio Sub-Sy

Learn synchronization principles, Q. Learn synchronization principles? ...

Q. Learn synchronization principles? To learn synchronization subsequent dependencies are recognized:  i)  Data Dependency: These are RAW, WAW and WAR dependency.  ii) Co

What are the input devices, What are the Input devices Various devices ...

What are the Input devices Various devices are available for data input on graphics workstations. Most systems have a keyboard and one or more additional devices specially desi

Explain about distributed shared memory systems, Explain about Distributed ...

Explain about Distributed Shared Memory Systems? Distributed Shared Memory (DSM) systems emulate a shared memory abstraction on loosely coupled architectures in order to allow

State disadvantages of object oriented analysis design, State Disadvantages...

State Disadvantages of object oriented analysis design You know that OO methods only create functional models within objects. There is no place in methodology to design a compl

Advantage of booth and restoring division algorithm, Describe the advantage...

Describe the advantage of using Booth algorithm? Ans:  a) It achieves efficiency in the number of additions needed when the multiplier has a few large blocks of 1's. b) It

Explain top-down parsing, Explain Top down parsing. Top down parsing...

Explain Top down parsing. Top down parsing: Specified an input string, top down parsing tries to derive a string identical to this by successive application of grammar rule

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd