Question: I need help coding this in assembly. The instructions are in the picture below and then the code that I have so far is also
I need help coding this in assembly. The instructions are in the picture below and then the code that I have so far is also in a separate picture. I have it working to where I can read out the entires for numbers that are in hex of 0-9 but I have yet to make it work for A-F. Please help me figure out how to implement this.

Programming Exercise 4 (20 points): (Implementing ReadHexByte) The objective is to write the procedure ReadHexByte to input from the keyboard a byte b (i.e., two digits) and store b in the register AL. In order to achieve this, you must read consecutively two hexadecimal digits from the keyboard (use ReadChar for each digit). We assume that the user will enter only TWO hexadecimal digits (i.e. ? to 'F'). 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. Examples I) Suppose the user enters the digit 9' followed by the digit 4'. This means that the user means the byte 94h. The procedure ReadHexByte must ultimately store in AL the value 94h (1001 0100)2 The digit 9' produced the most significant nibble (I001)2 and the digit '4' 'produced the least significant nibble (0100) 2) Suppose the user enters the digit 'B' followed by the digit '8'. This means that the user means the byte B8h. The procedure ReadHexByte must ultimately store in AL the value B8h (10 1000)2 The digit 'B 'produced the most significant nibble 0) and the digit '8' 'produced the least significant nibble (1000)- Programming Exercise 4 (20 points): (Implementing ReadHexByte) The objective is to write the procedure ReadHexByte to input from the keyboard a byte b (i.e., two digits) and store b in the register AL. In order to achieve this, you must read consecutively two hexadecimal digits from the keyboard (use ReadChar for each digit). We assume that the user will enter only TWO hexadecimal digits (i.e. ? to 'F'). 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. Examples I) Suppose the user enters the digit 9' followed by the digit 4'. This means that the user means the byte 94h. The procedure ReadHexByte must ultimately store in AL the value 94h (1001 0100)2 The digit 9' produced the most significant nibble (I001)2 and the digit '4' 'produced the least significant nibble (0100) 2) Suppose the user enters the digit 'B' followed by the digit '8'. This means that the user means the byte B8h. The procedure ReadHexByte must ultimately store in AL the value B8h (10 1000)2 The digit 'B 'produced the most significant nibble 0) and the digit '8' 'produced the least significant nibble (1000)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
