Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using assembly language Programming Exercise 2 (8 points): (Implementing WriteHexByte) The objective of this exercise is to write the procedure WriteHexByte to display on the

Using assembly language image text in transcribed
Programming Exercise 2 (8 points): (Implementing WriteHexByte) The objective of this exercise is to write the procedure WriteHexByte to display on the console the byte contained in the register AL: AL is the parameter of the procedure WriteHexByte. This procedure must l) display the number stored in AL 2) display 'h' to indicate that the number is a hexadecimal number 3) Display' the 'line feed' character (ASCII code is 0Ah) to go to the next line 4) Display' the 'carriage' character (ASClI code is 0Dh) to go to the next line Displaying a line feed' and a carriage return' will produce a new line. Check what happens if you do not display line feed' and/or a 'carriage return'. Examples: If AL contains the number 94h, the procedure WriteHexByte must display the characters "9 4', 'h', line feed, and 'carriage return'. Recall that 'line feed is ONE character whose ASCI code is OAh and 'carriage return is ONE character whose ASCll code is 0Dh. If AL contains the number E7h, the procedure WriteHexByte must display the characters ' 7, 'h', 'line feed', and 'carriage return' 2) Programming Exercise 3 (4 points): (Implementing ASCII2Digitvalue) The objective of this exercise is to write a procedure that will convert the ASCll code of a digit d into the value v of d, and store v in the register DL. The procedure ASCII2DigitValue uses the register AL as a parameter. AL contains the ASCIl code of a hexadecimal digit d (O' to 'F): 30h, 31h,.38h, 39h, 4lh, 42h....45h. You do not have to test AL for than range. The procedure AScIT2DigitValue must store in the register DL the value of the digit. Examples: If AL contains the ASClIl code 34h (ASCII code of '4'), the procedure ASCII2Digitvalue must store in DL the value of the digit 4, i.e., the value 04h. Ultimately, DL 04h. If AL contains the AsSCII code 44h (ASCI code of 'D'), the procedure ASC112Digitvalue must store in DL the value of the digit D, i.e., the value 0Dh. Ultimately, DL 0Dh 2) Programming Exercise 2 (8 points): (Implementing WriteHexByte) The objective of this exercise is to write the procedure WriteHexByte to display on the console the byte contained in the register AL: AL is the parameter of the procedure WriteHexByte. This procedure must l) display the number stored in AL 2) display 'h' to indicate that the number is a hexadecimal number 3) Display' the 'line feed' character (ASCII code is 0Ah) to go to the next line 4) Display' the 'carriage' character (ASClI code is 0Dh) to go to the next line Displaying a line feed' and a carriage return' will produce a new line. Check what happens if you do not display line feed' and/or a 'carriage return'. Examples: If AL contains the number 94h, the procedure WriteHexByte must display the characters "9 4', 'h', line feed, and 'carriage return'. Recall that 'line feed is ONE character whose ASCI code is OAh and 'carriage return is ONE character whose ASCll code is 0Dh. If AL contains the number E7h, the procedure WriteHexByte must display the characters ' 7, 'h', 'line feed', and 'carriage return' 2) Programming Exercise 3 (4 points): (Implementing ASCII2Digitvalue) The objective of this exercise is to write a procedure that will convert the ASCll code of a digit d into the value v of d, and store v in the register DL. The procedure ASCII2DigitValue uses the register AL as a parameter. AL contains the ASCIl code of a hexadecimal digit d (O' to 'F): 30h, 31h,.38h, 39h, 4lh, 42h....45h. You do not have to test AL for than range. The procedure AScIT2DigitValue must store in the register DL the value of the digit. Examples: If AL contains the ASClIl code 34h (ASCII code of '4'), the procedure ASCII2Digitvalue must store in DL the value of the digit 4, i.e., the value 04h. Ultimately, DL 04h. If AL contains the AsSCII code 44h (ASCI code of 'D'), the procedure ASC112Digitvalue must store in DL the value of the digit D, i.e., the value 0Dh. Ultimately, DL 0Dh 2)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals, Design, and Implementation

Authors: David M. Kroenke, David J. Auer

14th edition

133876705, 9781292107639, 1292107634, 978-0133876703

More Books

Students also viewed these Databases questions