代做CMP-5013A作业、代写C/C++程序语言作业、代做Operating Systems作业、C/C++课程设计作业代写
School of Computing SciencesModule: CMP-5013A Architectures and Operating SystemsAssignment: Simple cipher in ARMv-7 assesmbly language.Set by: Michal Mackiewicz M.Mackiewicz@uea.ac.ukDate set: 12th October 2018Value: 25%Date due: 14th November 2018 3pm week 8Returned by: 12th December 2018Submission: BlackboardLearning outcomesTo become familiar with the basic ARMv7-A instruction set architecture. Improved low-levelprogramming skills with a focus on creating efficient solutions.SpecificationOverviewIn this assignment you will implement a simple cipher in the ARMv7-A assembly language.DescriptionThe algorithm you will implement is based on letier transpositions according to the schemeillustrated in Table 1.The cipher requires a secret private key, which needs to be known to both parties to encryptand decrypt any messages. The key can be represented by a string of characters.Table 1: A table containing the private key and the message.d r a g o na t t a c ka t f i v ep a s t f ou r t o m or r o w x xLet’s assume that we want to encrypt the string attack at five past four tomorrow with theprivate key string dragon. First, you enter the message into a table, row by row as shown in Table1. If there is any space let in the last row, we fill it with one of the rare le?ers e.g. x. In orderto encrypt the message, we need to change the order of the columns in the table according tothe alphabe?c order of the le?ers in the private key as shown in Table 2. Then, the enciphered1Table 2: A table with the reordered columns. Cipher text can be read columnwise.a d g n o rt a a k c tf a i e v ts p t o f at u o o m ro r w x x rmessage is read columnwise. In this case, it would be ?stoaapuraitowkeooxcvfmxtiarr. Note,to make the deciphering opera?on harder, you need to strip any message from all white spacesand punctuation and convert any upper case letters to lower case.Message decryption is a reverse process utlising the same table. The cipher text is writteninto the columns of Table 2 and later read according to the private key letter order.Your ARM assembly program, which you must name cw1, must accept two command linearguments. First argument must be 0 or 1 denoting encrypt/decrypt. The second argumentmust be a string representing the private key. The actual text to be encrypted/decrypted mustbe passed to the program using standard input. Your program must first convert the upper caseletters to lower case before encryption. Further, it must strip the input text from any charactersand whitespaces other than the 26 lower case English alphabet letters. The program mustreturn its output i.e. depending on the first argument encrypted/decrypted text using standardoutput. You should test your program with the following syntax:cat textfile.txt | ./cw1 0 privatekeystring | ./cw1 1 privatekeystringThis should return the original text from textfile.txt, albeit lower case and withoutwhite spaces and punctuation.You are allowed to assume that the program input will not be longer than 1000 letter characters.Relationship to formative assessmentThe formative tests, which are available on Blackboard, should be helpful in learning the ARMv7ISA. You should complete labsheets 5-7 before atempting this coursework.DeliverablesThis is an exercise that can be done in pairs. If you choose to work in a pair you must notifyme about your pair members by email by Wed 24th Oct 5pm. If you don’t, you must completeyour work individually.The source code must be zipped into a file with the name containing Student IDs of bothmembers of the group or your student ID if you worked individually. Bothmembers of the groupmust then submit this (same) file to the digital dropbox located on the module Blackboard page.Make sure you test your solu?ons on a PiCluster machine BEFORE you submit.Late submissions need to follow the appropriate late hand-in procedure. You can find outthis information from the Hub.If you have medical or other problems you can seek extensions to coursework deadlines.However, it is essential you obtain proper documentation in such cases (i.e. a medical certifi-cate).2If one of the pair members is granted an extension, the other member of the pair alsoreceives an extension. However, remember that this will apply only to those pairs who notifiedme that they will work in pairs, as explained above.If you choose to work in a pair, both members of the pair are equally responsible for the jointwork. In case of any breakdown of co-operation, you should complete your work individuallyand notify me by email. You will not receive any extra marks in such a case or for the fact thatyou chose or had to work individually. To make this very clear, you should treat this courseworkas an individual exercise, which you are allowed to do in pairs.If you cannot find your pair and would like me to help you find one, then please send mean email with your details by Monday 22nd Oct 6pm and I will try to pair you with anotherstudent. I strongly encourage everyone to engage in pair work.ResourcesYou should do the Labsheets 5-7 which are available on BB. Labsheet 7 will contain exerciseswhich will be particularly relevant from the point of view of this coursework. You should alsoconsult the lecture notes on ARMv7 ISA.Please also note the list of references below. In par?cular, I would encourage you to gothrough the relevant chapters in references [2] and [3].You should attend all the lab sessions and discuss your progress with the teaching staff whowill be able to provide you formative feedback.My general advice on atempting this exercise as well as any other exercise in any assemblylanguage would be to break the problem into small tasks and tackle them one by one. Foreach of these tasks, write a pseudo-code or the C code before you start writing in the assemblylanguage.Marking SchemeThis coursework carries 25% of the module weight so you will receive up to 25 marks.We will use the following marking scheme to award marks: All functionality implemented as requested. (up to 13 marks) Code quality. (up to 6 marks). Quality of the code comments. (up to 6 marks).We will judge the code quality based on the following criteria. You should follow the AAPCSProcedure Call Standard. The use of stack as well as frequent load/store instructions shouldbe avoided if possible. Try to keep your variables in registers to make your program more effi-cient. Use ARM advanced addressing modes in cases when this can reduce the number of instructions.Moreover, try to avoid short branches by using conditional execution of non-branchinstructions.The comments need to be extensive and they might take more space than the assemblycode. The cw1.s you will need to submit should have a header with the usual informationyou find in the file headers such as the authors, dates and short descriptions. All variable toregister mappings should be made clear. For each section you could a ach a commented-outpseudo-code or C code. You should have both section and line comments.Finally, you must not atempt to be ‘clever’ and submit the code that was produced by theC compiler. The requested program is simple enough to be written in assembly language fromscratch. Any suspicious code will be thoroughly investigated and may result in 0 (zero) marks3awarded for this assignment. We also reserve the right to quiz both members of the pair aboutany part of the code.You should supplement your code with a brief commentary describing the individual contributionsof both members of the pair.References[1] ARM, The ARMv7AR reference manual, https://sta?c.docs.arm.com/ddi0406/c/DDI0406C C arm architecture reference manual.pdfLast Accessed, Oct 2018.[2] Roger Ferrer Ibanez, Think in geek - ARM assembler in Rasberry Pi, http://thinkingeek.com/armassembler-raspberry-pi/Last Accessed, Oct 2018.[3] Robert G. Plantz, Introduction to Computer Organization: ARM Assembly Language Usingthe Raspberry Pi, http://bob.cs.sonoma.edu/IntroCompOrg-RPi/intro-co-rpi.htmlLast Accessed, Oct 2018.[4] ARM, Procedure call standard for the ARM architecture,http://infocenter.arm.com/help/topic/com.arm.doc.ihi0042f/IHI0042F aapcs.pdfLast Accessed, Oct 2018.[5] ARM, ARM and Thumb-2 Instruction Set Quick Reference Card,http://infocenter.arm.com/help/topic/com.arm.doc.qrc0001m/QRC0001 UAL.pdfLast Accessed, Oct 2018.因为专业,所以值得信赖。如有需要,请加QQ:99515681 或邮箱:
微信:codinghelp