Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Programming Exercise : [call it Ass4.asm] Write a procedure called HexOutput that displays the content of register EBX as a hexadecimal string. See the algorithms

Programming Exercise : [call it Ass4.asm]

Write a procedure called HexOutput that displays the content of register EBX as a hexadecimal string. See the algorithms pseudocode in Slide-51 of Chap_06 (Lecture-9). A full solution for the binary case (BinOutput) also appears in Slide-48 and Slide-49 of Lecture-9 (I have explained and traced this solution in classroom).

For example: If EBX contains 1111 1110 0000 0001 1100 1000 0011 0111, then the procedure HexOutput should display the hexadecimal stringFE01C837h; note: make sure that character h is displayed at the end.

Write a procedure called HexInput that loads the register EAX with the numerical value of the hexadecimal string entered at the keyboard. See the algorithms pseudocode in Slide-52 of Chap_06 (Lecture-9). A full solution for the binary case (BinInput) also appears in Slide-50 of Lecture-9 (I have explained and traced this solution in classroom).

For example: EAX is loaded with 1111 1110 0000 0001 1100 1000 0011 0111, when the procedure HexInput reads the hexadecimal stringFE01C837h; note: make sure that character h is the last character read from keyboard.

To test these two procedures, above, your main program should first ask you What do you want to do?.

If you type the letter W (or w) then the main program reads an unsigned 32-bit decimal number from the keyboard, and loads the number into EBX, and then calls the procedure HexOutput (which displays a hexadecimal string).

If you type the letter R (or r) then the main program calls the procedure HexInput (which reads a string from the keyboard, then loads it into EAX), and then displays the binary content of register EAX.

. In a and b, above, the main program exits with Thank you Sweetey Honey Bun.JIt exits with the message Get Lost Sweetey Honey Bun if you type anything else

ASSEMBLY LANGUAGE

COMPUTER ARCHITECTURE

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

Students also viewed these Databases questions