Computers and Technology

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-

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 10:20, vuqepete4528
Shown below is the start of a coding region within the fist exon of a gene. 5'--3' 3'--5' how many cas9 pam sequences are present?
Answers: 1
image
Computers and Technology, 22.06.2019 11:30, KrishnaBalaram1235
To hide gridline when you display or print a worksheet
Answers: 1
image
Computers and Technology, 22.06.2019 16:20, kimmmmmmy333
Octothorpe is another name for what common computer keyboard symbol?
Answers: 1
image
Computers and Technology, 22.06.2019 21:00, daniella0123
Simon says is a memory game where "simon" outputs a sequence of 10 characters (r, g, b, y) and the user must repeat the sequence. create a for loop that compares the two strings starting from index 0. for each match, add one point to userscore. upon a mismatch, exit the loop using a break statement. assume simonpattern and userpattern are always the same length. ex: the following patterns yield a userscore of 4: simonpattern: rrgbryybgy userpattern: rrgbbrybgy
Answers: 2
Do you know the correct answer?
The objective of this exercise is to write a program that will read a decimal digit d from the keybo...

Questions in other subjects:

Konu
Mathematics, 17.12.2020 21:50
Konu
Mathematics, 17.12.2020 21:50