tutorbin

assembly programming homework help

Boost your journey with 24/7 access to skilled experts, offering unmatched assembly programming homework help

tutorbin

Trusted by 1.1 M+ Happy Students

Place An Orderand save time
man
phone
  • United States+1
  • United Kingdom+44
  • Afghanistan (‫افغانستان‬‎)+93
  • Albania (Shqipëri)+355
  • Algeria (‫الجزائر‬‎)+213
  • American Samoa+1
  • Andorra+376
  • Angola+244
  • Anguilla+1
  • Antigua and Barbuda+1
  • Argentina+54
  • Armenia (Հայաստան)+374
  • Aruba+297
  • Ascension Island+247
  • Australia+61
  • Austria (Österreich)+43
  • Azerbaijan (Azərbaycan)+994
  • Bahamas+1
  • Bahrain (‫البحرين‬‎)+973
  • Barbados+1
  • Belarus (Беларусь)+375
  • Belgium (België)+32
  • Belize+501
  • Benin (Bénin)+229
  • Bermuda+1
  • Bhutan (འབྲུག)+975
  • Bolivia+591
  • Bosnia and Herzegovina (Босна и Херцеговина)+387
  • Botswana+267
  • Brazil (Brasil)+55
  • British Indian Ocean Territory+246
  • British Virgin Islands+1
  • Brunei+673
  • Bulgaria (България)+359
  • Burkina Faso+226
  • Burundi (Uburundi)+257
  • Cambodia (កម្ពុជា)+855
  • Cameroon (Cameroun)+237
  • Canada+1
  • Cape Verde (Kabu Verdi)+238
  • Caribbean Netherlands+599
  • Cayman Islands+1
  • Central African Republic (République centrafricaine)+236
  • Chad (Tchad)+235
  • Chile+56
  • China (中国)+86
  • Christmas Island+61
  • Cocos (Keeling) Islands+61
  • Colombia+57
  • Comoros (‫جزر القمر‬‎)+269
  • Congo (DRC) (Jamhuri ya Kidemokrasia ya Kongo)+243
  • Congo (Republic) (Congo-Brazzaville)+242
  • Cook Islands+682
  • Costa Rica+506
  • Côte d’Ivoire+225
  • Croatia (Hrvatska)+385
  • Cuba+53
  • Curaçao+599
  • Cyprus (Κύπρος)+357
  • Czech Republic (Česká republika)+420
  • Denmark (Danmark)+45
  • Djibouti+253
  • Dominica+1
  • Dominican Republic (República Dominicana)+1
  • Ecuador+593
  • Egypt (‫مصر‬‎)+20
  • El Salvador+503
  • Equatorial Guinea (Guinea Ecuatorial)+240
  • Eritrea+291
  • Estonia (Eesti)+372
  • Eswatini+268
  • Ethiopia+251
  • Falkland Islands (Islas Malvinas)+500
  • Faroe Islands (Føroyar)+298
  • Fiji+679
  • Finland (Suomi)+358
  • France+33
  • French Guiana (Guyane française)+594
  • French Polynesia (Polynésie française)+689
  • Gabon+241
  • Gambia+220
  • Georgia (საქართველო)+995
  • Germany (Deutschland)+49
  • Ghana (Gaana)+233
  • Gibraltar+350
  • Greece (Ελλάδα)+30
  • Greenland (Kalaallit Nunaat)+299
  • Grenada+1
  • Guadeloupe+590
  • Guam+1
  • Guatemala+502
  • Guernsey+44
  • Guinea (Guinée)+224
  • Guinea-Bissau (Guiné Bissau)+245
  • Guyana+592
  • Haiti+509
  • Honduras+504
  • Hong Kong (香港)+852
  • Hungary (Magyarország)+36
  • Iceland (Ísland)+354
  • Indonesia+62
  • Iran (‫ایران‬‎)+98
  • Iraq (‫العراق‬‎)+964
  • Ireland+353
  • Isle of Man+44
  • Israel (‫ישראל‬‎)+972
  • Italy (Italia)+39
  • Jamaica+1
  • Japan (日本)+81
  • Jersey+44
  • Jordan (‫الأردن‬‎)+962
  • Kazakhstan (Казахстан)+7
  • Kenya+254
  • Kiribati+686
  • Kosovo+383
  • Kuwait (‫الكويت‬‎)+965
  • Kyrgyzstan (Кыргызстан)+996
  • Laos (ລາວ)+856
  • Latvia (Latvija)+371
  • Lebanon (‫لبنان‬‎)+961
  • Lesotho+266
  • Liberia+231
  • Libya (‫ليبيا‬‎)+218
  • Liechtenstein+423
  • Lithuania (Lietuva)+370
  • Luxembourg+352
  • Macau (澳門)+853
  • North Macedonia (Македонија)+389
  • Madagascar (Madagasikara)+261
  • Malawi+265
  • Malaysia+60
  • Maldives+960
  • Mali+223
  • Malta+356
  • Marshall Islands+692
  • Martinique+596
  • Mauritania (‫موريتانيا‬‎)+222
  • Mauritius (Moris)+230
  • Mayotte+262
  • Mexico (México)+52
  • Micronesia+691
  • Moldova (Republica Moldova)+373
  • Monaco+377
  • Mongolia (Монгол)+976
  • Montenegro (Crna Gora)+382
  • Montserrat+1
  • Morocco (‫المغرب‬‎)+212
  • Mozambique (Moçambique)+258
  • Myanmar (Burma) (မြန်မာ)+95
  • Namibia (Namibië)+264
  • Nauru+674
  • Nepal (नेपाल)+977
  • Netherlands (Nederland)+31
  • New Caledonia (Nouvelle-Calédonie)+687
  • New Zealand+64
  • Nicaragua+505
  • Niger (Nijar)+227
  • Nigeria+234
  • Niue+683
  • Norfolk Island+672
  • North Korea (조선 민주주의 인민 공화국)+850
  • Northern Mariana Islands+1
  • Norway (Norge)+47
  • Oman (‫عُمان‬‎)+968
  • Palau+680
  • Palestine (‫فلسطين‬‎)+970
  • Panama (Panamá)+507
  • Papua New Guinea+675
  • Paraguay+595
  • Peru (Perú)+51
  • Philippines+63
  • Poland (Polska)+48
  • Portugal+351
  • Puerto Rico+1
  • Qatar (‫قطر‬‎)+974
  • Réunion (La Réunion)+262
  • Romania (România)+40
  • Russia (Россия)+7
  • Rwanda+250
  • Saint Barthélemy+590
  • Saint Helena+290
  • Saint Kitts and Nevis+1
  • Saint Lucia+1
  • Saint Martin (Saint-Martin (partie française))+590
  • Saint Pierre and Miquelon (Saint-Pierre-et-Miquelon)+508
  • Saint Vincent and the Grenadines+1
  • Samoa+685
  • San Marino+378
  • São Tomé and Príncipe (São Tomé e Príncipe)+239
  • Saudi Arabia (‫المملكة العربية السعودية‬‎)+966
  • Senegal (Sénégal)+221
  • Serbia (Србија)+381
  • Seychelles+248
  • Sierra Leone+232
  • Singapore+65
  • Sint Maarten+1
  • Slovakia (Slovensko)+421
  • Slovenia (Slovenija)+386
  • Solomon Islands+677
  • Somalia (Soomaaliya)+252
  • South Africa+27
  • South Korea (대한민국)+82
  • South Sudan (‫جنوب السودان‬‎)+211
  • Spain (España)+34
  • Sri Lanka (ශ්‍රී ලංකාව)+94
  • Sudan (‫السودان‬‎)+249
  • Suriname+597
  • Svalbard and Jan Mayen+47
  • Sweden (Sverige)+46
  • Switzerland (Schweiz)+41
  • Syria (‫سوريا‬‎)+963
  • Taiwan (台灣)+886
  • Tajikistan+992
  • Tanzania+255
  • Thailand (ไทย)+66
  • Timor-Leste+670
  • Togo+228
  • Tokelau+690
  • Tonga+676
  • Trinidad and Tobago+1
  • Tunisia (‫تونس‬‎)+216
  • Turkey (Türkiye)+90
  • Turkmenistan+993
  • Turks and Caicos Islands+1
  • Tuvalu+688
  • U.S. Virgin Islands+1
  • Uganda+256
  • Ukraine (Україна)+380
  • United Arab Emirates (‫الإمارات العربية المتحدة‬‎)+971
  • United Kingdom+44
  • United States+1
  • Uruguay+598
  • Uzbekistan (Oʻzbekiston)+998
  • Vanuatu+678
  • Vatican City (Città del Vaticano)+39
  • Venezuela+58
  • Vietnam (Việt Nam)+84
  • Wallis and Futuna (Wallis-et-Futuna)+681
  • Western Sahara (‫الصحراء الغربية‬‎)+212
  • Yemen (‫اليمن‬‎)+967
  • Zambia+260
  • Zimbabwe+263
  • Åland Islands+358
*Get instant homework help from top tutors—just a WhatsApp message away. 24/7 support for all your academic needs!

Recently Asked assembly programming Questions

Expert help when you need it
  • Q1:Instructions translate the "cppFunction" into "asmFunction" and enter your assembler code in "AssemblerFunction.asm", do not change the Main.cpp. You can use the newest Visual Studio project, then you upload the whole project, but you still cannot change the Main.cpp file. This is an easy Leetcode problem (#121), without any complicated data structures, so it should not be a problem. Everything is set up; you only enter the assembler code.See Answer
  • Q2:Task 6.2: Pipeline Simulate the flow of the following code if it passes through a pipeline as in the The lecture is on! To do this, expand the diagram below, which indicates which Stage each command in which beat goes through: The pipeline consists (as discussed in the lecture) of the 5 stages of Instruction Fetch (IF), Instruction Decode (ID), Execute (EX), Memory Access (MA) and Write Back (WB), Values calculated in the EX phase are only calculated at the end of the WB phase written back to the register. When a subsequent command is in its EX-phase this value is required for the calculation, the pipeline must therefore be delayed for so long (stalled) until the corresponding value has been written back to the register. Also Iw and sw can only start execution when all source registers for Are available. As can be seen in the diagram, register r2 is set to clock 6 (WB of the second command) written back. Since the add command requires this register, the pipeline must be be delayed for a long time until r2 is available for execution (EX) in clock 7. In contrast to the lecture, it is assumed here that a written register value is only available for reading in the next bar. 1 lw r1.0x1000 (ro) 2 lw r2.0x1004 (ro) 3 add r3, rl, r2 4 sub r4, rl, r2 5 sw r4, 0x100c (ro) 6 sw r3.0x1008 (ro) 7 addi r5, ro, 0x10 8 sub r6, r0, r5 9 sw r5, 0x2000 (1) 10 sw r6.0x2000 (2) 1. Expand the diagram by the required delay! 2. How many cycles does the pipeline have to be delayed for? 3. What acceleration was achieved with the pipeline for this code? Go You assume that 200 hp are required for one cycle with pipelining. Without Pipelining takes one cycle and thus an instruction of 800 hp. 4. Rearrange the instructions so that when processing in the pipeline no delays are needed! The semantics of the program should be stay the same! This means in concrete terms. At the end of the execution, the registers should contain the same values and the same values should be written to the memory have been. What acceleration is being achieved now? 6 Points 1 Point 2 Points 6 PointsSee Answer
  • Q3:Submit your assembly language source code (.asm file) and screen shots that display your program's successful execution (the output screen). Do not submit screenshots of your code./nCOSC 2425 - Project 3 Write an assembly language program that asks the user to enter an integer dollar amount between 1 and 3,000. Your program should display the corresponding class description using the following table. Donation Amount (dollars) $2,000 and above $1,500 to $1,999 $1,000 to $1,499 $500 to $999 $1 to $499 Class of Donation Platinum Gold Silver Bronze Brass Write the program so that it executes (loops!) until the user inputs some value that you determine to be the "sentinel value". Your program must guard against and provide user messages for input values that are outside the valid range.See Answer
  • Q4:You are asked to implement a MIPS procedure named string_insert. The procedure will take two null-terminated ASCII strings: strl and str2 and an integer position value pos as input parameters. When invoked, the string_insert procedure will insert a copy of str2 into str1 right before the index location indicated by pos. For example, if str1 contains the string "ABCDEFG" and str2 contains "123", then a procedure call string_insert with the pos parameter value of 5 would update str1 into "ABCDE123FG"; since the letter F had the index location of 5. If the pos value exceeds the lengths of str1, then str2 should be concatenated at the end of str1. Of the pos value equals to 0; then str2 will be prepended to str1. The string_insert procedure will not return any value. Furthermore, you also need to implement a second MIPS procedure named strlen. Like the C library function of the same name, strlen will take a string as input parameter, and return the number of characters in that string, excluding the null character. The return value of strlen will be available at the $v0 register for the caller procedure to read. You should try to implement strlen first, and then focus on string_insert because the implementation of substring_count can be greatly simplified when it can invoke the strlen procedure. The main function of the program is given in the following. You may define any additional number of helper procedures as necessary. However, the data segment as well as the body of the main function should be used exactly as given. If you need space to temporarily hold bulks of data, you can and should utilize the stack segment of the process./n.data #Static arrays used to store the two string inputs stri: .space 200 # reserve a 200-byte memory block str2: .space 200 # reserve a 200-byte memory block #String literals printstri: asciiz "Enter the first string: printstr2: .asciiz "Enter the second substring: " printstr3: .asciiz "Enter the insertion position: printstr4: .asciiz "After insertion, updated first string is: " -text .globl main main: 11, $v0, 4 #to print prompt #1 la $a0, printstri syscall li, $v0, 8 #input the first string la $a0, stri li $al, 200 syscall 11, $v0, 4 #print prompt #2 la $a0, printstr2 syscall li, $v0, 8 #input the second string la $a0, str2 li $al, 200 syscall 11, $v0, 4 #to print prompt #3 la $a0, printstr3 syscall " li, $v0, 5 #input the position value (integer) syscall #pos stored in $v0 la $a0, stri la Sal, str2 add $a2, $0, SVO jal string_insert #load the address of strl to $a0 #load the address of substri to Sal #load the position value to $a2¹ #procedure call from main/n11, $v0, 4 la $a0, printstr4 syscall la $a0, strl syscall 11, $v0, 10 syscall string_insert: #print string mode #Literal part of Output #load address of strl for output #clean exit #definition of string_insert goes below # Any additional function definition (s), including strlren To get full credit for your work, your MIPS code must be sufficiently documented with single- line comments explaining the purpose of the key parts of the program. Save your MIPS program in a single plaintext file and submit it to Moodle. Good Luck!See Answer
  • Q5:1. (15 pts) Convert the following numbers to binary numbers (List calculation steps) a. Oxefcdab b. 205 c. 121See Answer
  • Q6:2. (15 pts) Convert the following numbers to hexadecimal numbers (List calculation steps) a. 0101 0011 1011 1111 b. 243 c. 155See Answer
  • Q7:3. (15 pts) Convert the following numbers to decimal numbers (List calculation steps). a. 1100 1011 b. 0x77 c. OxffSee Answer
  • Q8:5. (9 pts) An Integer has been stored in the following memory space within a little-endian computer. 0x100 0x101 0x102 0x103 12 CD EF 90 A. Which address stores the most significant byte? B. Which address stores the least significant byte? C. What's the integer value in hex format?See Answer
  • Q9:9. (8 pts) If the rax register is set to Ox9ABCDEF012345678, what are the contents of the following registers in hex? A. al B. ax C. eax D. raxSee Answer
  • Q10:Objective Write an ARM program that takes two integers as input, x and y, and calculates x*y using only addition. Convert the following C code into ARM: int main() { int x, y, result=0; //read x printf("Please enter x: "); scanf("%d", &Xx); //read y printf("Please enter y: "); scanf("%d", &y); if (y<0) { } x=0-X; y=0-y;/nif (y<0) { } x=0-X; y=0-y; for (int counter=0; counterSee Answer
  • Q11:Your assignment is to replace the portion in HA4-main.s that is within hyphened comments (i.e. everything between lines 40 and 64) by a mainline program. Your program will compute: 1+2+3+4+5+........ ....+n. You could prompt the user for n and display the sum. You might want to use Gauss formula: n(n+1)/2. Create your own sensible prompts and output messages. An example execution of your program could be: Please enter the number of terms in your series: 20 The sum of your series is 210.See Answer
  • Q12:3. We add 14 new operations to MARIE. This will require a larger op code. We decide, as we do not want to lengthen instructions to prevent the changes you [should have] discussed in 2c, we reduce memory size. Answer the following. a. How many bits would an address have to now be? b. What would be the maximum addressable memory size? c. What hardware changes would we have to make to accommodate the changes from parts a and b of this question?See Answer
  • Q13:4. Assume a CPU with a fixed 36-bit instruction length has the following instruction format: opcode [num-operands] [model operand1] [mode2 operand2] [mode3 operand3] The opcode is the instruction. num-operands is 0-3 depending on the number of operands and each operand has its own addressing mode specifier. Assume there are 150 instructions and 7 addressing modes. Answer the following questions. a. If an instruction uses three registers, how many registers can be referenced? b. If an instruction uses two registers and one immediate datum (in two's complement), what is the largest immediate datum that can be referenced assuming there are 16 registers? c. If an instruction has two operands, a register and a direct memory address, what is the largest address (which is an unsigned binary number) if there are 64 registers? d. If an instruction has two operands, both of which are memory addresses using base- displacement mode where the base is a base register and there are 8 base registers, and the displacement is an unsigned binary number, how long can the displacement be? Remember, there are two separate base registers and two separate displacements.See Answer
  • Q14:5. Assume the following values are in memory as shown below to the right, and register R1 is the index register and is storing 5000. What is loaded into the accumulator with the instruction "Load 10000" given each of the following addressing modes? Datum 5000 a. Immediate b. Direct c. Indirect d. Indexed Address 5000 10000 15000 *** 20000 25000 20000 25000 ... 5000 10000See Answer
  • Q15:6. We are comparing two processors' performances where both have an 8-stage fetch-execute cycle, one processor is pipelined and the other is not. Assume tp = 1.25 and we run a program of 100,000 instructions on both processors. To compute how much faster the pipelined machine is, use cycles of slower machine / cycles of faster machine. a. How much faster is the pipelined processor assuming no stalls arise? b. How much faster is the pipelined processor assuming there is 1 stall every 4 instructions? c. How much faster is the pipelined processor assuming there is 2.2 stalls every instruction? d. Bonus question: How many stalls per instruction would be required so that the two processors had equal performance?See Answer
  • Q16:7. Two processors have 12-stage fetch-execute cycles where branches are determined in stage 8. One processor is not pipelined, and the other is pipelined. Assuming that tp = 1, answer the following questions when running a program with 100,000 instructions where 5,000 of the instructions are conditional branches and each branch, if taken, skips over 8 instructions. a. How much faster is the pipelined machine over the non-pipelined machine assuming that no branches are taken. b. How much faster is the pipelined machine over the non-pipelined machine assuming that all branches are taken. c. Bonus question: Instead of the program having 5,000 branches, how many branches would the program have to have assuming every branch is taken (and every branch skips over 8 instructions) for the non-pipelined machine to execute the program in the same time as the pipelined machine?See Answer
  • Q17:Two Integer Data Operations Write an ARM Assembly Language (I will not accept Intel Assembly code - if you are not clear on this requirement, ask!) program to prompt the user to enter two signed integers. Have your program output to the screen a report to the user the two integers that were entered at the keyboard, along with the following: sum of the two integers, product of the two integers, logical AND of the two integers, and the logical OR of the two integers. You must utilize the scanf function for reading in the user input (have scanf read all three integers in one scanf function call) and the printf function for outputting the user input and operations on the two user entered values. Hint: to use scanf with 2 or more variables, check out: https://github.com/PaulConrad RCC/CSC_11_BASE/blob/master/scanf_demo/scanf_2_values.s . as it demonstrates working with two variables. Sample output of your program (note: user input is in bold - you do not need your user input to be bold, this is just showing what is user input and what is program output): Please enter two signed integers: 123 345 You entered 123 and 345 from the keyboard, now some operations on those values! Sum of 123 and 345 is 468 Product of 123 and 345 is 42435 Logical AND of 123 and 345 is 89 Logical OR of 123 and 345 is 369See Answer
  • Q18:3. Recall that the CodeWarrior generates an S19 Hex File which will be uploaded into your board when you debug your programs. To read this file, navigate to the bin folder in your project directory, and open the *.S19 file using your editor. You should have a successful build for your project to find this file (you can use lab4_part1 for example as it has been built successfully) For example, the first $1 Record in the S19 Hex File of lab4_part1 reads as follow: S123C000FEC03DFDC03B270E35ED31EC3169700434FB310326F2FEC03FEC31270BED3118AA This S1 record has a 1's complement checksum = 0xAA which is the last byte To calculate this checksum, you must add all the hex bytes (excluding S1) as: Val=0x23 + 0xC0+.......+0x18 = 0x55 Then, the 1's complement checksum = 0xFF - Val = 0xAA in this example. Review Chapter 8 section 8.3 of your textbook for more details Download and extract lab4_part3. This program will calculate the 1's complement checksum of one S1 record and display the result on the 8 LEDs. The program defines an array S1 as char S1[ ] = "05FFFEC029"; If you build this project, you will get a link error because the function checksum is not defined. Define this function in the util.asm file. Note: The bytes are encoded as ASCII characters inside $1 array. For example, the first byte 0x05 in the S1 Record is stored as 0x30 followed by 0x35 in the S1 array. In this example, the checksum subroutine must somehow extract and add the following bytes 0x05, 0xFF, 0xFE, 0xC0, and 0x29 To confirm your work, change S1 array to have other S1 Records values and re-run your program.See Answer
  • Q19: Faculty of Technology, Design & Environment Assessment cover STUDENTS, PLEASE COPY THIS PAGE AND USE AS THE COVER PAGE FOR YOUR SUBMISSION Module No: COMP7023 Module title: Malware Analysis Assessment title : Due date and time: Estimated total time to be spent on assignment: Coursework 1 M1 LEARNING OUTCOMES On successful completion of this module, students will be able to achieve the module following learning outcomes (LOs): LO numbers and text copied and pasted from the module descriptor. M2 OXFORD BROOKES UNIVERSITY 1. Design and create assembly language programmes, with an awareness of how assembly programming differs from conventional programming. M3 20 hours per student Engineering Council AHEP4 LOs assessed (from S1 2022-23): Apply a comprehensive knowledge of mathematics, statistics, natural science and engineering principles to the solution of complex problems. Much of the knowledge will be at the forefront of the particular subject of study and informed by a critical awareness of new developments and the wider context of engineering Formulate and analyse complex problems to reach substantiated conclusions. This will involve evaluating available data using first principles of mathematics, statistics, natural science and engineering principles, and using engineering judgment to work with information that may be uncertain or incomplete, discussing the limitations of the techniques employed Select and apply appropriate computational and analytical techniques to model complex problems, discussing the limitations of the techniques employed School of Engineering, Computing & Mathematics Statement of Compliance I declare that the work submitted is my own and that the work I submit is fully in accordance with the University regulations regarding assessments (www.brookes.ac.uk/uniregulations/current) FORMATIVE FEEDBACK OPPORTUNITIES You will make regular uploads of asm code to the GitHub repository you have been given, starting in week 3, and you will be given formative feedback in the practical sessions of weeks 4, 5 and 6. In addition, the practical exercises of weeks 1, 2 and 3 (if you do them) will ensure that you are familiar with the basics of assembler programming before you start on the coursework. SUMMATIVE FEEDBACK DELIVERABLES Deliverable description and instructions - Upload your report to Moodle by the deadline stated and make regular uploads to GitHub starting from two weeks before the deadline; tardy or insufficient uploads will be penalised as the rubric indicates. Your report will have all of your code (screenshots may not be used) in an appendix plus extra documentation, as detailed below, in order given below: Definition of records and array data structures: Explain your definitions and illustrate them with examples, stating every assumption you have made beyond those explicitly listed in this specification. Documented Code for adding badgers and staff: Explain your code, reproducing the relevant part from the appendix, and include both comments and design. Your GitHub repository should have both the final version of the code and at least one preliminary version. Design should include details of conditional jumps, unconditional jumps, the use of registers and memory locations. Documented Code for deleting badgers and staff: As above Documented Code for displaying all staff and all badgers: As above Documented Code for searching for and displaying staff or badgers: As above Screenshots showing results of testing: Show all working success and failure cases for all operations you have implemented Reflection: Explain what challenges you encountered whilst doing this coursework, how you overcome them and what you would do differently next time. ,-;71 1 =^Kkm / hjm ,ndDMHHMM/\b /MM (,,. YQMML ///H|wnWWdMKKK#""-; . `"0\ ` " "Qkmmmmmn WMMM\" "WHMKKMM III 1 This coursework is worth 40% of the module and is an individual piece of work - group work is not allowed and the university rules concerning plagiarism, collusion and contract cheating apply. Harvard referencing must be used where applicable. You will receive marks and feedback within three weeks of the submission deadline. WHMb, . "QMM` ASSIGNMENT IN DETAIL - INTRODUCTION Jonny's Nocturnal Zoo is a wildlife park at the far end of the county of Brookeshire. Currently the only residents at the zoo are roughly a dozen badgers, who live in a complex of setts underneath the ground. ,-=¹== `>>> Weighting out of 100% | \>\ `-<@) 20 School of Engineering, Computing & Mathematics 20 20 10 10 10 10 The park is overseen by Jonny Zookeeper who knows every badger by name. However, Jonny has been asked to rehome two hundred extra badgers next month. He is worried that he will not be able to keep track of all the new badgers and extra staff he will need in addition to the badgers he already has. Jonny has bought a fancy new computer to keep track of the new badgers and staff in his zoo. You have been called in to create some new software to help Jonny organise the residents and staff in his wildlife park. You will need to write a record keeping system to store information about all the badgers and people in Jonny's Zoo. Unfortunately, there is a by-law in Brookeshire which makes all compilers and high-level languages illegal. You will therefore have to write the system in assembly language. ASSIGNMENT IN DETAIL - SYSTEM REQUIREMENTS Write a simple archive system to keep track of the badgers and staff in the zoo. The system must be written in 64-bit x86 assembly language. This coursework is designed to assess assembly language programming, thus submissions written in other languages will be awarded zero marks. 1. You must store the following information with each badger: Badger ID (a unique identifier of the form bXXXXXX where XXXXXX is a 6 digit number) Name (a NUL-terminated string of maximum size 64 characters) Home sett (can be any one of Settfield, Badgerton, or Stripeville) Mass in kg (to the nearest whole kg) Number of stripes (in the range from 0 to 255) Sex (M or F) ● ● ● 2. You must store the following information with each staff: Surname (a NUL-terminated string of maximum size 64 characters) ● First Name (a NUL-terminated string of maximum size 64 characters) Staff ID (a unique identifer of the form pXXXXXXX where XXXXXXX is a 7 digit number) Department (can be any one of Park Keeper, Gift Shop or Cafe) Starting annual salary in £ (whole £ only) Year of joining (a whole number e.g. 2017) ● Email address (a NUL-terminated string of maximum size 64 characters of the form <name>@jnz.co.uk) ● ● Month of birth (a whole number in the range 1 to 12 e.g. 1-January and 12-December etc.) Year of birth (a whole number e.g. 2017) Staff ID of assigned park keeper (which must be of the form pXXXXXXX as mentioned below but it need not match a staff record) ● 3. Your system must allow the following operations: Add staff Add badger Delete staff Delete badger Display all staff, showing for each staff: O years of service, calculated by: ● yearOfJoining yearsOfService = currentYear annual salary, which increases by £200 for each year of service Display all badgers, showing for each badger: O age, calculated by: if (currentMonth birthMonth) >= 0 age = currentYear yearOfBirth else - age = currentYear yearOfBirth - School of Engineering, Computing & Mathematics - 1 stripiness, calculated by: stripiness = mass * numberOfStripes Search for and display (as explained above) a badger, given a badger ID Search for and display (as explained above) a staff member, given a Staff ID 4. Your system must satisfy the following memory requirements: It should be able to store a maximum of 100 staff members and 500 badgers It should not used dynamic memory allocation; static memory allocation at build-time should be adequate for your purposes. Deletion It should not be wasteful of memory. HINT: Think how much storage you need for each of the pieces of information in the staff and badger records and allocate only enough memory for that. Remember that the NUL terminator requires an extra byte in memory 5. All input and output should be to and from the terminal console. All data is held only in memory and should be saved to or loaded from disk. 6. The user should be asked to input value currentYear when the program starts. Display Searching In particular, it should not store in the badger record and staff records the result of the calculations mentioned above; these calculations must be made on the fly Fail Data Structures Major flaws Insertion/Adding with records and arrays which cannot be used by operations or no explanations Some recognisable attempt but clearly not working. GitHub respository may or may not contain code. No comments. Pass Records and arrays can be used only by some operations or poor explanations or evident redunancy Correct implementation of success case but no error cases handled. Neither the design nor the preliminary version uploaded to GitHub two weeks before the deadline. Only occasional comments or obvious comments. School of Engineering, Computing & Mathematics Distinction Records and arrays can be used by all operations without modification but there are minor flaws in representation or explanation or use of magic numbers. Correct implementation of success case but not all error cases handled correctly. Either the design or the preliminary version not uploaded to GitHub at least two weeks before the deadline. Mostly sensible comments. Ideal Records have all appropriate fields with no flaws, explained perfectly in report with illuminating examples. Equally perfectly implementation of arrays. Correct implementation of success case. Full validation and informative error handling for all error cases. Design and preliminary version of operation uploaded to GitHub at least two weeks before the deadline. Sensible but not verbose comments. Screenshots Reflection Severe lack of understanding of testing but tests relate to the program Very little attempt has been made at reflection. Only some operations or cases shown or student has somewhat misunderstood nature of testing Some response to some of the questions though mostly with thoughts that are self-evident. School of Engineering, Computing & Mathematics Most cases for most operations are documented or documentation could be clearer Thoughtful response to at least one question but not the others All success cases and all failure cases for each operations, outlined with exceptional clarity Thoughtful response to all questions with original insights.See Answer
  • Q20: PROJECT 1: BOMB PROJECT - CS261 Disclaimer: this project is an adaptation of the bomblab from Bryant & O'hallaron, Computer Systems: A programmer's perspective. Third Edition. 1 Logistics This is an individual project. All submissions are electronic. Clarifications and corrections will be posted on Piazza. Points Breakdown Phase 1 to 5: 20 Pts each phase. Phase 6 and Secret Phase (Phase 7): 5 Extra Pts each phase Maximum points: 100 points (+ 10 extra points). Phases 1 through 5 are required. Phases 6 and 7 are for extra credit (EC), and there is no penalty for skipping them. You may still get credit for phases completed late, but only up to 24 hours after the deadline. You can only receive 85 percent of the points for a phase you submitted late. There is no partial credit for phases beyond this. If after the late submission period, you have still not solved a phase you can request the phase solution by posting a private post to all the instructors on Piazza with the bomb number and phase you would like the solution for. Each time your bomb explodes you lose 1/2 point (up to a max of 20 points) in the final score for the project. Read the entire PDF before start the project 2 Introduction The nefarious Dr. Evil has planted a slew of "binary bombs" on our class machines. A binary bomb is a program that consists of a sequence of phases. Each phase expects you to type a particular string on stdin. 1 If you type the correct string, then the phase is defused and the bomb proceeds to the next phase. Otherwise, the bomb explodes by printing BOOM!!!" and then terminating. The bomb is defused when every phase has been defused. There are too many bombs for us to deal with, so we are giving each student a bomb to defuse. Your mission, which you have no choice but to accept, is to defuse your bomb before the due date. Good luck, and welcome to the bomb squad! Step 1: Get Your Bomb (This is not Phase 1) The first step is to download your binary bomb from the course server (systems#). To download the bomb, we published a website accessible only from the University network. To reach this website, you have two options: 1. Connect to UIC's wifi if you are on campus. 2. Connect to the UIC's Virtual Private Network (VPN). If you have not ever used the UIC VPN, please view the instructions here. The VPN is a secure connection that allows your computer to access the University network when you are off campus. Once in the network, paste the following link into your browser : http://cs261.cs.uic.edu: 15213/. If you can't view the page, first try viewing without your browser plugins in incognito mode, and finally, try using another browser. This will display a binary bomb request form for you to fill in. Enter your NetID and email address carefully (your grade will be reported based on the NetID you typed) and hit the Submit button. The server will build your bomb and return it to your browser in a tarball file called bombk.tar, where k is the unique number of your bomb. Note: Try this if you are having trouble connecting to the VPN or downloading the bomb in general • SSH into cs261.cs.uic.edu • Go to this Piazza post which contains a command to download a bomb, copy the command and paste the entire command into your terminal. • Follow the instructions given to you on the terminal. The second step is to send the bombk.tar file to one of the CS server via sftp (cs261.cs.uic.edu) and save the bombk.tar file into a (protected) directory in which you plan to do your work on. The third step is to extract the files from the tarball. For this, type the following command on the terminal from the folder that contains the tarball: 1tar -xvf bombk.tar This will create a directory called ./bombk with the following files (Read these files): • README: Identifies the bomb and its owners. 2 bomb: The executable binary bomb. • bomb.c: Source file with the bomb's main routine and a friendly greeting from Dr. Evil. ● Associated Sites: ● To setup 2-Factor Authentication: https://it.uic.edu/services/faculty-staff/uic-network/duo-2-factor- authentication-2/ • To download UIC's VPN (required): https://accc.uic.edu/services/infrastructure/network/virtual-private- network/ • To download a bomb: http://cs261.cs.uic.edu:15213 To view the scoreboard (it updates every ten minutes): http://cs261.cs.uic.edu: 15213/scoreboard. You must check that your score is updated after you solve a phase. If your score does not update after 10 minutes, it means you did not solve the phase. • If you experience any technical difficulties with the VPN, request help here https://accc.uic.edu/forms/contact- us/ Additional notes You must use your UIC NetID when downloading a bomb to receive credit when graded! • The project must be completed on cs261.cs.uic.edu and you might need to give permission to your bomb for execution (chmod +x bomb) • You can download multiple bombs. However, your grade will be based on your bomb with the overall highest score. This can be helpful when getting started; however, say you're working on phase 4 and have a handful of explosions, downloading a new bomb may not be a wise idea, as your scores for phases 1, 2, and 3 will not carry over to the new bomb, and you will not be able to earn those points on the new bomb because the deadlines for those phases have passed. Basically, once you have the hang of things, you should complete phase 1 with a bomb you plan to finish all phases with (you can continue to practice with other bombs with no penalty). Step 2: Learn how not to explode the bomb Your job for this project is to defuse your bombs before they explode. To avoid accidentally detonating the bomb, you will need to learn how to single-step through the assembly code and how to set breakpoints (see the Q&A at the end of this document). You can use many tools to help you defuse your bomb. Please look at the hints section for some tips and ideas. The best way is to use your favorite debugger to step through the disassembled binary. 3 Each time your bomb explodes it notifies the server, and you lose 1/2 point (up to a max of 20 points) in the final score for the project. So there are consequences to exploding the bomb. You must be careful! Students can download multiple bombs and each bomb is graded independently (the grade is computed per bomb, not per student). Your project grade is your bomb with the highest score. You might have exploded your bomb while you learn where to set the breakpoints. Once you know how to set the breakpoints, you can download a new bomb so you do not lose points for these first explosions. Step 3: Defuse Your Bomb Your job for this project is to defuse your bomb. Every time you defuse a phase you will see a printed message saying so. If you do not see the message, your phase has not been defused yet, even i you see in gdb that the next instruction will call the function defuse_bomb. You should also see the score updated on the scoreboard (it updates every ten minutes) http://cs261.cs.uic.edu: 15213/scoreboard You will need to learn how to inspect both the registers and the memory states using your favorite debugger. One of the nice side-effects of doing the project is that you will get very good at using a debugger. This is a crucial skill that will pay big dividends for the rest of your career. You must do the assignment on one of the class machines. In fact, there is a rumor that Dr. Evil really is evil, and the bomb will always blow up if run elsewhere. There are several other tamper-proofing devices built into the bomb as well, or so we hear. Although phases get progressively harder to defuse, the expertise you gain as you move from phase to phase should offset this difficulty. However, the last phase will challenge even the best students, so please don't wait until the last minute to start. The bomb ignores blank input lines. If you run your bomb with a command line argument, for example, ./bomb psol.txt then it will read the input lines from psol.txt until it reaches EOF (end of file), and then switch over to stdin. In a moment of weakness, Dr. Evil added this feature so you don't have to keep retyping the solutions to phases you have already defused. linux> Project Submissions There is no explicit submission. The bomb will record your progress as you work on it, assuming you entered your UIC email address when downloading the bomb. You can keep track of how you are doing by looking at the class scoreboard (while on the UIC network, or connected via the VPN): http://cs261.cs.uic.edu: 15213/scoreboard. This web page is updated every 2 minutes to show the progress of each bomb. You should check to make sure that your scores are recorded correctly on the server. The server has occasionally crashed, so checking that your scores were received is always a good idea. Hints (Please read this!) There are many ways of defusing your bomb. You can examine it in great detail without ever running the program, and figure out exactly what it does. This is a useful technique, but it is not always easy to do. You can also run it under a debugger, watch what it does step by step, and use this information to defuse it. This is probably the fastest way of defusing it. We do make one request, please do not use brute force! You could write a program that will try every possible key to find the right one. But this is no good for several reasons: You lose 1/2 point (up to a max of 20 points) every time you guess incorrectly and the bomb explodes. Every time you guess wrong, a message is sent to the server. You could very quickly saturate the network with these messages, and cause the system administrators to revoke your computer access. • We haven't told you how long the strings are, nor have we told you what characters are in them. Even if you made the (incorrect) assumption that they all are less than 80 characters long and only contain letters, then you will have 2680 guesses for each phase. This will take a very long time to run, and you will not get the answer before the assignment is due. Many tools are designed to help you figure out both how programs work, and what is wrong when they don't work. Here is a list of some of the tools you may find useful in analyzing your bomb, and hints on how to use them. ● • gdb The GNU debugger is a command-line debugger tool available on virtually every platform. You can trace through a program line by line, examine memory and registers, look at both the source code and assembly code (we are not giving you the source code for most of your bomb), set breakpoints, set memory watchpoints, and write scripts. The CS:APP website http://csapp.cs.cmu.edu/public/students.html has a very handy single-page gdb summary that you can print out and use as some other tips for using gdb. reference. Here are To keep the bomb from blowing up every time you type in a wrong input, you'll want to learn how to set breakpoints. For online documentation, type "help" at the gdb command prompt, or type “man gdb", or "info gdb” at a Unix prompt. Some people also like to run gdb under gdb-mode in emacs. objdump -t This will print out the bomb's symbol table. The symbol table includes the names of all functions and global variables in the bomb, the names of all the functions the bomb calls, and their addresses. You may learn something by looking at the function names! 5See Answer

TutorBin Testimonials

I found TutorBin Assembly Programming homework help when I was struggling with complex concepts. Experts provided step-wise explanations and examples to help me understand concepts clearly.

Rick Jordon

5

TutorBin experts resolve your doubts without making you wait for long. Their experts are responsive & available 24/7 whenever you need Assembly Programming subject guidance.

Andrea Jacobs

5

I trust TutorBin for assisting me in completing Assembly Programming assignments with quality and 100% accuracy. Experts are polite, listen to my problems, and have extensive experience in their domain.

Lilian King

5

I got my Assembly Programming homework done on time. My assignment is proofread and edited by professionals. Got zero plagiarism as experts developed my assignment from scratch. Feel relieved and super excited.

Joey Dip

5

TutorBin helping students around the globe

TutorBin believes that distance should never be a barrier to learning. Over 500000+ orders and 100000+ happy customers explain TutorBin has become the name that keeps learning fun in the UK, USA, Canada, Australia, Singapore, and UAE.