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

Explain about the term business-to-customer, Explain about the term busines...

Explain about the term business-to-customer. B2C (business-to-customer): "Electronic commerce" is usually understood mostly as selling goods or services to people ("last

Performance equation of computer system, Performance Equation of computer s...

Performance Equation of computer system: Following equation is frequently used for expressing a computer's performance ability: The CISC approach tries to minimize the

What is ''LRU'' page replacement policy, 'LRU' page replacement policy is ?...

'LRU' page replacement policy is ? Ans. Least Recently Used.

Visual basic applications in general context, Describe some general uses fo...

Describe some general uses for Visual basic applications in general context? Ans) Visual basic can be used within almost all Microsoft products such as Map point, Visio, Auto ca

What do you mean by program counter, Q. What do you mean by Program Counter...

Q. What do you mean by Program Counter? Program Counter (PC): It determines the instruction that is to be executed next which means after the execution of an on-going instructi

Illustration of a demon program, Q. Illustration of a demon program? Wh...

Q. Illustration of a demon program? When the PVM initialize it inspects the virtual machine in that it's to operate and creates a process known as PVM demon or simply pvmd on e

Path & Path Production, Take the following flow graph and use the procedure...

Take the following flow graph and use the procedure in chapter 8 to derive an equivalent regular expression. Show all intermediate graphs (to ensure that you follow the procedure,

Determine the return loss and round trip delay for echo, In a national tran...

In a national transmission system, the characteristic impedances of the 4-wire circuit and the 2-wire circuit are 1200 ? and 1000 ? respectively. The average phase velocity of the

Kirchoff''s laws, i want to make an assignment about kirchoff''s law

i want to make an assignment about kirchoff''s law

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