4/9/2021 start the game already! https://sjsu.instructure.com/courses/1413171/assignments/ XXXXXXXXXX/4 start the game already! Due Sunday by 11:59pm Points 100 Submitting a file upload File Types asm...

I need help with my X86-64 assembly language. I am struggling to understand the concept


4/9/2021 start the game already! https://sjsu.instructure.com/courses/1413171/assignments/5727079 1/4 start the game already! Due Sunday by 11:59pm Points 100 Submitting a file upload File Types asm Available until Apr 13 at 11:59pm Start Assignment as an avid age of empire's player, you love the taunts that you can put in the chat. for example, if you type the number 14 in the chat, everyone will hear "Start the game already!". there are 25 different taunts and you feel bad that you can only remember two: 1 ("Yes.") and 14. you have decided to practice your x86_64 assembly skills by creating a program to help you with the taunts. this program does two things. first, if you just run the program by itself: ./aoe_taunt you will get the list of taunts, one on each line proceeded by the taunt number: 1 Yes. 2 No. 3 I need food. 4 Somebody pass the wood. 5 Gold please. 6 Gimme some stone. 7 *Whimper* 8 Your attempts are futile. 9 *Group cheer* 10 Hey, I'm in your town. 11 *Group groan* 12 Join me! 13 I don't think so. 14 Start the game already! 15 Who's the man? 16 Attack them now! 17 *Low laugh* 18 I am weak, please don't kill me! 19 *High pitched laugh* 20 I just got some... satisfaction! 21 Hey, nice town! 22 We will NOT tolerate this behavior. 23 Get out! 24 Dad gum! 25 Aw, yeah! if you pass taunt numbers as arguments, it will print out the corresponding taunts. for example, running it like this: 4/9/2021 start the game already! https://sjsu.instructure.com/courses/1413171/assignments/5727079 2/4 ./aoe_taunt 5 22 8 will produce Gold please. We will NOT tolerate this behavior. Your attempts are futile. your instructor has provided you an object file that contains all the taunts and handles all the parsing of the command line. you simply need to write two functions: show_taunt and list_taunts. show_taunt will receive a single parameter, the taunt number (64-bit integer), and print out the corresponding taunt. list_taunts take no parameters and prints the list of taunts with their numbers. both show_taunt and list_taunts should be declared global much like main was. you will not need to write a main since that will be in the provided object file. global show_taunt global list_taunts implementing show_taunt and list_taunts to implement your functions, you will use two external resources: taunt_array and printf (_printf on OSX). you will declare these resources at the top of your file: extern taunt_array extern printf on OSX it will be: extern taunt_array extern _printf taunt_array will contain the address of the list of taunt strings. the last element of the list will be a null (0) address. when printing the list of taunts, do not hard code the number of taunts but instead look for a null at the end of the list. on windows/linux you will call printf using: call printf wrt ..plt on OSX you will use call _printf you will want to use the following two format strings for calling printf. they go in your .data section. 4/9/2021 start the game already! https://sjsu.instructure.com/courses/1413171/assignments/5727079 3/4 start the game already     num_fmt db `%d %s\n\0`     fmt db `%s\n\0` when using num_fmt, you should pass an integer as the 2nd parameter and a string address as the 3rd parameter. when using fmt, you should pass a string as the 2nd parameter. instructions and registers you will use the same instructions and registers as what's that number. the one difference is that in the link step you will use the following for windows/linux: gcc -o aoe_taunt aoe_taunt-lin.o (https://sjsu.instructure.com/courses/1413171/files/62709325/download?download_frd=1) prog5.o on OSX you will use: ld -o aoe_taunt -L /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib -lSystem aoe_taunt-os x.o (https://sjsu.instructure.com/courses/1413171/files/62709336/download?download_frd=1) prog5.o NOTE: the .o files are downloadable links! submit you will just submit your prog5.asm file that contains the two functions. main code here is the aoe_taunt code that will be calling your functions: aoe_taunt-lin.asm (https://sjsu.instructure.com/courses/1413171/files/62904023/download?download_frd=1) . do not copy anything from this code. it is for information only. https://sjsu.instructure.com/courses/1413171/assignments/5720039 https://sjsu.instructure.com/courses/1413171/files/62709325?wrap=1 https://sjsu.instructure.com/courses/1413171/files/62709325/download?download_frd=1 https://sjsu.instructure.com/courses/1413171/files/62709336?wrap=1 https://sjsu.instructure.com/courses/1413171/files/62709336/download?download_frd=1 https://sjsu.instructure.com/courses/1413171/files/62904023?wrap=1 https://sjsu.instructure.com/courses/1413171/files/62904023/download?download_frd=1 4/9/2021 start the game already! https://sjsu.instructure.com/courses/1413171/assignments/5727079 4/4 Total Points: 100 Criteria Ratings Pts 20 pts 20 pts 10 pts 20 pts 10 pts 20 pts prints a properly formatted output with no arguments 20 to >0.0 pts Full Marks 0 pts No Marks prints individual taunts properly when show_taunt is called. 20 to >0.0 pts Full Marks 0 pts No Marks code is commented and readable 10 to >0.0 pts Full Marks 0 pts No Marks only the specified instructions are used students will receive 0 points if instructions or registers are used that are not allowed in the assignment description. the points may go below 0 if completely unrelated instructions are used. 20 to >0.0 pts Full Marks 0 pts No Marks in list_taunts the number of taunts is not hardcoded. a check for a null address is used to find the end of the list. 10 pts Full Marks 0 pts No Marks printf is used properly. syscall cannot be used. 20 pts Full Marks 0 pts No Marks
Apr 09, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here