Question: Dollar ValueMenu How can i do this without multiplying Write an HLA Assembly language program that calculates the cost of an order at a local

Dollar ValueMenu
How can i do this without multiplying
Write an HLA Assembly language program that calculates the cost of an order at a local fast food restaurant from its dollar value menu of items.. The cost will be based on a single 16-bit value entered by the value. The value will be used to specify a number of $5 items, $4 items, $3 items, $2 items and $1 items. The format of this bit field is diagrammed below:
Dollar Menu Item data string
Three bits are being used to specify the number of order items. Total the cost of the order and print this amount.
Since 16 bits are being entered here, your program should expect to read 4 hexadecimal digits.
Below are some sample program dialogues that demonstrate these ideas.
(Hint: Do this in small steps, bit-by-bit. There's alot to it...)
(Another Hint: HLA read in hex format when you read directly into a register. So do that...)
(Further Hint: The most important part of this assignment is to worked with the packed data field entered by the user to extract the sub-parts out of it. The overlapping design of the Intel registers helps you parse this kind of data field and you can shift the bits around to get the right part into BH or BL, for example... )
(Final Hint: Since we haven't learned how to do multiplication yet, although it's kinda painful, I was expecting that you would perform the multiplication by a looping set of addition instructions)
Feed me your order as 4 hex digits: 1000
1 $1 item
0 $2 item
0 $3 item
0 $4 item
0 $5 item
Total Order Costs: $1
Feed me 4 hex digits: 1240
1 $1 item
1 $2 item
1 $3 item
0 $4 item
0 $5 item
Total Order Costs: $6
Feed me 4 hex digits: 76C9
7 $1 item
3 $2 item
3 $3 item
1 $4 item
1 $5 item
Total Order Costs: $31
Feed me 4 hex digits: 0009
0 $1 item
0 $2 item
0 $3 item
1 $4 item
1 $5 item
Total: $9

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!