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, 22.06.2019 10:00
Create a word problem that involves calculating the volume and surface area of a three-dimensional object. cube: surface area 6 s2 , volume s3
Answers: 3
question
Computers and Technology, 22.06.2019 15:10
Consider a direct-mapped cache with 216 words in main memory. the cache has 16 blocks of 8 words each. it is a word-addressable computer (rather than a byte-addressable computer which we normally discuss). (a) how many blocks of main memory are there? (b) what is the format of a memory address as seen by the cache, that is, what are the sizes of the tag, cache block, and block offset fields (if they apply)? (c) to which cache block will the memory reference db6316 map?
Answers: 1
question
Computers and Technology, 22.06.2019 19:20
1)consider the following code snippet: #ifndef book_h#define book_hconst double max_cost = 1000.0; class book{public: book(); book(double new_cost); void set_cost(double new_cost); double get_cost() const; private: double cost; }; double calculate_terms(book bk); #endifwhich of the following is correct? a)the header file is correct as given.b)the definition of max_cost should be removed since header files should not contain constants.c)the definition of book should be removed since header files should not contain class definitions.d)the body of the calculate_terms function should be added to the header file.
Answers: 1
question
Computers and Technology, 23.06.2019 01:00
Complete the sentence about a presentation delivery method
Answers: 2
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
Mathematics, 03.08.2020 14:01
question
Computers and Technology, 03.08.2020 14:01
question
Mathematics, 03.08.2020 14:01
Questions on the website: 13722361