subject

The objective of this exercise is to write a program that will read a decimal digit d from the keyboard convert the ascii code of a digit d into the value v of d, and store v in the register d you must use the function readchar to input a decimal digit d from the keyboard. as described above, the function readchar will return in the register al the ascil code of the decimal digit d. we assume that the user will input only decimal digits ('0' to ). therefore, the register al will contain the ascii code of a decimal digit'0' to '9. i. e., 30h to 39h. you do not have to test al. your program must store in the register dl the value of the digit. example: if the user enters the digit ‘4', al will contain the ascii code 34h. your program must store in dl the value of the digit 4, ie., the value 04h. ultimately, dl 04h. programming exercise 4 (24 points): the objective is to write a program that implements the function readhexbyte to input from the keyboard a byte (i. e., two digits) and store it in the register al. you must write the program to implement the function readhexbyte. in order to achieve this, you must read consecutively two decimal digits from the keyboard (use readchar for each digit). we assume that the user will enter only two decimal digits (i. e. '0' to 9) the first digit entered will be set as the most significant nibble of al and the second digit entered will be set as the least significant nibble of al. process appropriately the two characters and store in al the value meant by the user. example: suppose the user enters the digit 9' followed by the digit '4'. this means that the user means the byte 94h. your program must ultimately store in al the value 94h (1001 0100)2. the digit '9 "produced the most significant nibble (1001)2 and the digit '4' produced the least significant nibble (01002-

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 18:30
Given the following code: if (n == 2) { k -= 2; } else if (n == 3) { k -= 3; } can be rewritten as: if (< condition > ) { < assignment statement > ; } assume that evaluating < condition > does not change the values stored in n and k. which of the following could be used as < assignment statement > ? k -= n; k -= 1; k -= 2; k += n; k = n - k;
Answers: 2
question
Computers and Technology, 22.06.2019 10:30
How can a user open a blank presentation? 1.on the file menu, click new, and then click recent templates 2.on the file menu, click new, and then click blank presentation 3. on the view menu, click templates, and then click recent templates 4. on the view menu, click samples, and then click blank presentation
Answers: 1
question
Computers and Technology, 23.06.2019 06:40
How many nibbles can be stored in a 16-bit word?
Answers: 1
question
Computers and Technology, 23.06.2019 18:00
Ramona enjoys her job because she is able to kids in an after school program. the work value ramona feels strongest about is a. leadership b. risk c. independence d. work with people select the best answer from the choices provided a b c d
Answers: 1
You know the right answer?
The objective of this exercise is to write a program that will read a decimal digit d from the keybo...
Questions
question
English, 11.09.2021 14:00
question
Mathematics, 11.09.2021 14:00
question
Mathematics, 11.09.2021 14:00
question
Mathematics, 11.09.2021 14:00
question
Mathematics, 11.09.2021 14:00
question
Computers and Technology, 11.09.2021 14:00
question
Mathematics, 11.09.2021 14:00
question
English, 11.09.2021 14:00
Questions on the website: 13722359