|
INPUT A DECIMAL NUMBER FROM THE KEYBOARD
a) To input a decimal number from the keyboard, a call is made to the program DECIN16, which flashes on the monitor screen a request to input a decimal number from 0 to 65535 at the waiting prompt. If you make any kind of mistake and the keyboard input is wrong, the program will reject your input and request you to try again.
b) The decimal number input at the keyboard is converted to an equivalent hexadecimal number and stored in the register DX, for example:
a decimal input 255 will be stored in DX as FF h,
a decimal input 4095 will be stored in DX as FFF h,
a decimal input 65535 will be stored in DX as FFFF h.
The hexadecimal number stored in DX then needs to be moved to the address INPUT1 in the data segment. A second input is obtained in the same way, and stored at the address INPUT2 in the datat segment. The coding is shown below:
|