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

Compare ss7 architecture with seven-layer osi architecture, Compare the arc...

Compare the architecture of SS7 with seven-layer OSI architecture The relationship among these levels and the layers of the OSI model is demonstrated in figure. The user part i

Estimate the circuit switched network, a) Total available bandwidth = 1 Mbp...

a) Total available bandwidth = 1 Mbps = 1000 Kbps Each user requires send data at the rate of = 500 kbps As it is circuit switched network we have to dedicate the bandwidth So the

Explain j2ee, With respect to security, which one is the better choice? ...

With respect to security, which one is the better choice? .Net or J2EE? Explain? As per majority programmers .NET is the best one which have single vendor compare to, the

Explain about theta notation, Q. Explain about Theta Notation? Theta Θ...

Q. Explain about Theta Notation? Theta Θ Notation : The set Θ (g(n)) comprises all functions f(n) for that there exist positive constants c1,c2 such that f(n) is squeezed in b

Explain the numbering plan for isdn address structure, Explain the numberin...

Explain the numbering plan for ISDN address structure. The numbering plan for ISDN is evolved with using the following guidelines: 1. This is based on, and is an improvemen

Is the basic list deleted when the new list is created, Is the basic list d...

Is the basic list deleted when the new list is created? No.  It is not removed and you can return back to it using one of the standard navigation functions like clicking on th

What is problem statement, What is problem statement The problem state...

What is problem statement The problem statement is crucial for any analysis. Problem statement is general description of the user's desires, and difficulties. The motive of pr

Characteristics of a pipeline, What are the main characteristics of a pipel...

What are the main characteristics of a pipeline? Ans: The main characteristics of a pipeline are: a) The speedup or efficiency gain by suing a pipeline depends on the numbe

Ease of learning - user friendliness, Ease of Learning - User Friendliness ...

Ease of Learning - User Friendliness Much has been made recently of increasing sophistication in technology with one of the major benefits advertised as an increase in somethi

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