PROGRAM 7: Movie Box Office Write an HLA Assembly language program that calculates the cost of various movie tickets. Th

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

PROGRAM 7: Movie Box Office Write an HLA Assembly language program that calculates the cost of various movie tickets. Th

Post by answerhappygod »

Program 7 Movie Box Office Write An Hla Assembly Language Program That Calculates The Cost Of Various Movie Tickets Th 1
Program 7 Movie Box Office Write An Hla Assembly Language Program That Calculates The Cost Of Various Movie Tickets Th 1 (73.94 KiB) Viewed 35 times
PROGRAM 7: Movie Box Office Write an HLA Assembly language program that calculates the cost of various movie tickets. 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 adult, senior citizen and children tickets. In addition, there might be matinee discount for each ticket sold. There might be a blockbuster premium applied to each ticket sold. The format of this bit field is diagrammed below: Block Senior Buster Citizen Premium Tickets ↓ Matinee Discount? Adults Tickets Children Tickets Three bits are being used to specify the number of child tickets, each costing $5. Three bits are being used to specify the number of adult tickets, each costing $10. Three bits are being used to specify the number of senior citizen tickets, each costing $7. Once all the costs are totaled, the matinee discount should save $2 per ticket. Once all the costs are totaled, add $1 per ticket for blockbuster premium. 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 4 hex digits: 0001 1 Children. Ⓒ Adult e Senior Citizen No Matinee Discount No Blockbuster Premium Total: $5 Feed me 4 hex digits: 0049 1 Children 1 Adult 1 Senior Citizen No Matinee Discount No Blockbuster Premium Total: $22 Feed me 4 hex digits: 025C 4 Children 3 Adult 1 Senior Citizen Matinee Discount No Blockbuster Premium Total: $41 Feed me 4 hex digits: 045D 5 Children 3 Adult 1 Senior Citizen No Matinee Discount Blockbuster Premium Total: $71
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply