Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

i need help woth flowchart. the 6 cases are a-f IS SUITPI PIOJU. 3) Sketch the flowcharts of the 6 cases (See page-4 and page-5)

i need help woth flowchart.
image text in transcribed
the 6 cases are a-f
image text in transcribed
image text in transcribed
IS SUITPI PIOJU. 3) Sketch the flowcharts of the 6 cases (See page-4 and page-5) which are described in Lab assignment. U 1 : Pro DC Da Da DUI Your program should, in an infinite loop, do the following depending on the user input: It should begin by printing the prompt string: "Make a selection: V, W, A, D, 4, 2:" --Also, the following actions are performed in response to menu item selection: (a) User presses V The main program calls a subroutine to handle this action The subroutine prompts the user to enter an input from the keyboard (use getchar subroutine). The value entered is stored in a memory location named OP1. The main program prints the value stored in OP1 in hexadecimal to the terminal. e.g. if the user enters 'E', value in OPI is $45 it should print: OPI = $45 (b) User presses W The main program calls a subroutine to handle this action The subroutine prompts the user to enter an input from the keyboard (use getchar subroutine). The value entered is stored in a memory location named OP2. The main program prints the value stored in OP2 in hexadecimal to the terminal. e.g. if the user enters 'F', value in OP2 is $46 it should print: OP2 = $46 (c) User presses A The main program calls a subroutine to handle this action. The subroutine adds the current value of OP1 to the current value of OP2. The subroutine prints a line showing the addition result. e.g. $2A + $52 - $7C If the addition result is invalid assuming unsigned operands it also prints "invalid unsigned". If the addition result is invalid assuming signed operands it also prints "invalid signed". (d) User presses D: The main program calls a subroutine to handle this action. The subroutine obtains the current value in OP1 converts it to decimal and displays it on screen. The function should print the original value followed by the decimal value on the same line and return. If the value in OP1 is $1B, then the output should be, $1B = 27 (e) User presses 4 The main program calls a subroutine to handle this action. The subroutine prints the current value of the four hex digits in memory beginning at the address of OP1 to the terminal e.g. If OP1 is $2A and OP2 is $3B it prints $2A3B (f) User presses 2 The main program calls a subroutine to handle this action. The subroutine assumes that the address of the memory location that it modifies is passed in X register. The value is modified by doubling it. In this case the main program will pass the address of OPI in X register to the subroutine. In this way the contents of OP1 will be replaced by double the value. [Note: The memory address must be passed using X register.] IS SUITPI PIOJU. 3) Sketch the flowcharts of the 6 cases (See page-4 and page-5) which are described in Lab assignment. U 1 : Pro DC Da Da DUI Your program should, in an infinite loop, do the following depending on the user input: It should begin by printing the prompt string: "Make a selection: V, W, A, D, 4, 2:" --Also, the following actions are performed in response to menu item selection: (a) User presses V The main program calls a subroutine to handle this action The subroutine prompts the user to enter an input from the keyboard (use getchar subroutine). The value entered is stored in a memory location named OP1. The main program prints the value stored in OP1 in hexadecimal to the terminal. e.g. if the user enters 'E', value in OPI is $45 it should print: OPI = $45 (b) User presses W The main program calls a subroutine to handle this action The subroutine prompts the user to enter an input from the keyboard (use getchar subroutine). The value entered is stored in a memory location named OP2. The main program prints the value stored in OP2 in hexadecimal to the terminal. e.g. if the user enters 'F', value in OP2 is $46 it should print: OP2 = $46 (c) User presses A The main program calls a subroutine to handle this action. The subroutine adds the current value of OP1 to the current value of OP2. The subroutine prints a line showing the addition result. e.g. $2A + $52 - $7C If the addition result is invalid assuming unsigned operands it also prints "invalid unsigned". If the addition result is invalid assuming signed operands it also prints "invalid signed". (d) User presses D: The main program calls a subroutine to handle this action. The subroutine obtains the current value in OP1 converts it to decimal and displays it on screen. The function should print the original value followed by the decimal value on the same line and return. If the value in OP1 is $1B, then the output should be, $1B = 27 (e) User presses 4 The main program calls a subroutine to handle this action. The subroutine prints the current value of the four hex digits in memory beginning at the address of OP1 to the terminal e.g. If OP1 is $2A and OP2 is $3B it prints $2A3B (f) User presses 2 The main program calls a subroutine to handle this action. The subroutine assumes that the address of the memory location that it modifies is passed in X register. The value is modified by doubling it. In this case the main program will pass the address of OPI in X register to the subroutine. In this way the contents of OP1 will be replaced by double the value. [Note: The memory address must be passed using X register.]

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

More Books

Students also viewed these Databases questions

Question

Discuss the goals of financial management.

Answered: 1 week ago