Question: MIPS Assembly - Decrypt the cipher text below in MIPS Cornelia wanted to send her husband Caeser a message but couldn't risk the text of

MIPS Assembly - Decrypt the cipher text below in MIPS

Cornelia wanted to send her husband Caeser a message but couldn't risk the text of the message falling into the wrong hands. She composed her message and rotated each of the alphabetic characters a certain amount. Her daughter Julia and her friends played a similar game. They viewed the alphabet as (A-Z,a-z) consistent with the characters ascii values. This would mean that z shifted one position would become A. The first eight bits of the message would serve as a key to decrypt the message. She only altered the characters (0-9 A-Z a-z) and the shifted characters would also stay in this range. The lines of the altered text were then put upside down, the last line was first and the first line was last. She then decided to also alter the numeric characters and used the least significant three bits of the key to determine the amount of the numeric shift. The numbers would only shift to another numeric character. Thus, a nine with a shift of one would become zero. She realized that the last line in the original text may not have a new line character and would need to insert the new line character in the cipher text if it wasn't present in the original text. This means that a cipher text will always end with the new line character. She then decided to shift the case of every other character. If a character number was odd it would switch case provided that character was an alphabetic character. The first character present in the cipher text would numbered zero and therefore wouldn't have its case changed. For example, if the text key was 1 and the original text was:

a bc z

123

ZXY A

The cipher text would become:

ayZ B

234

b cD a

a bc z

ciphers to b cd A

123

ciphers to 234

ZXY A

ciphers to aYZ B

b cd A

234

aYZ B

Now the text is placed upside down:

aYZ B

234

b cd A

Now every other character has its case changed. Newlines are characters and only alphabetic characters can change their case.

ayZ B

234

b cD a

The original text has one less character than the cipher text. Computers in ancient Rome were all UNIX based so line endings were always the line feed character and all characters were ascii encoded. Your program will print out the original text of the message without using SYSCALL or any other library routines. Write your program in MIPS assembly using MPLAB. Hand in the source code of your program. Put a comment at the top to indicate how well your program works. A sample data set is included. You should assume that the key will be positive and less than 26

---------cipher.s

#original data: # Lorem ipsum dolor sit amet, docendi eligendi et sit? Ex mei quod odio legendos, sed ut aeque ceteros verterem! Ad duo commune epicurei lobortis, est eu voluptua quaestio liberavisse,2 eos an quidam nonumes consequat. Accusam liberavisse ei vim, ea sea tacimates imperdiet ullamcorper? # Vis populo aperiam et, lorem torquatos no qui! Qui quas aperiam menandri cu. Te nulla expetendis pro, est saperet minimum albucius et! Dolore constituam ea eos? Has ut atqui persius! # Te sea nobis animal! Nec iisque theophrastus interpretaris an? Integre legimus eum no, te tale reprimique pro, id quod delicata indoctum eam. Pro no purto libris quaeque. Eu vix congue tincidunt, in albucius oporteat sit! # Scripta feugiat deleniti ea quo, singulis facilisis tincidunt ad eum? Ea nulla iusto signiferumque usu. Et usu corpora sapientem, habeo sonet assueverit ei, recusabo consetetur ut sit? Ex nemore commodo definitionem ius, ei enim percipit phaedrum, noster recteque nec ex. Has nostrum deserunt id. Enim quodsi ea pri, vidisse persius antiopam et ius? # Erant quodsi ei mei, cu prima atqui putent eam, et mollis cotidieque . Est no simul nihil, cu etiam ocurreret salutatus vel, in sea putant consetetur. Et est enim cibo dolorum, prima summo est cu, rebum singulis principes eam et. Vidit nominavi qui et? Ex nostrud saperet nec.

.data .global ciphertext .byte 12 ciphertext: .ascii "QdmZF CgAPEU Qu yQu, O" .ascii "G BduYm mfCgu BgFQzf Qm" .ascii "Y, qf YAXxUE oaFUpUqcGQ" .ascii " OGY. QeF za euYGX ZuTu" .ascii "X, og QFUmY aogDdqdqf e" .ascii "mXGfmfGe hqX, uZ eqM bG" .ascii "fmZF oazeqfqfGd. Qf QEf" .ascii " QzUy oUna PAXAdGY, Bdu" .ascii "Ym EgyYA qeF og, DQngy " .ascii "EUzSGXue bDUzOubqe QmY " .ascii "QF. HuPuf ZAYuZmhu Cgu " .ascii "qf? Qj ZAeFdGP embqdqf " .ascii "ZqO." .byte 10 .ascii "eODUBfm rQGSuMF pQxQzU" .ascii "FU Qm CgA, euZsgxUE rMo" .ascii "UxUEUE FUzOuPGZF mP QGY" .ascii "? QM ZGXxM UGeFa euSzUr" .ascii "QDgycGQ gEg. Qf gEg OAd" .ascii "BaDM embuQzfqY, tMnQA E" .ascii "azQF meEgqhqduf OGY Qu," .ascii " dqOGemNA oazeqfqfGd gF" .ascii " EUF? qJ zQyaDQ OAYyapa" .ascii " PqRuZufuazQy ugE, Qu o" .ascii "gy qZuY bqdoUBUF BTmQpd" .ascii "GY, zaEfqd dqOFQCgq zQo" .ascii " qj. TME zaEfDgy pQEQDg" .ascii "zf Up. qzUy CgAPEU Qm B" .ascii "du, huPueEQ bqdEUGe Mzf" .ascii "uaBMy qf UGe?" .byte 10 .ascii "fQ eqM ZANue MzUyMx! z" .ascii "qO UueCgq FTqaBTDMEfGe " .ascii "UzfqdBdqfmdue Mz? uzfqS" .ascii "DQ XqSuYGe QGY ZA, fq F" .ascii "MxQ dqbDUyUCgq BdA, Up " .ascii "CgAP PqXuOmfm uZpaofGY " .ascii "QmY. bdA za bGdFa XuNDU" .ascii "E CgmQCgq. qG HUJ oazSG" .ascii "Q fuZoUpgzf, uZ MxNGOug" .ascii "E AbAdFQmf euf!" .byte 10 .ascii "hUE BaBgxa MBQDUmY QF," .ascii " XAdqY fAdCgmfAe ZA Cgu" .ascii "! CGU cGME mbqduMy yQzM" .ascii "zPDU OG. Fq zgxXm qjBQF" .ascii "QzPue bDa, qeF EMBQDQF " .ascii "yUzUygy mXngoUGe QF! pA" .ascii "XAdq oazeFUFgmY Qm qaE?" .ascii " tme gF mfCgu BQDeugE!" .byte 10 .ascii "xAdqY UBeGY PAXAd euf " .ascii "MyQF, PAOqZpU QxUsQzPu " .ascii "qf euf? Qj YqU cGap APu" .ascii "a XqSqZpaE, eqP gF mQCg" .ascii "q oQFQDaE HQDfqdqY! MP " .ascii "PGa OAYygzQ QBUogDQu xa" .ascii "naDfue, qeF qg hAXGbFgm" .ascii " CgmQEfua XuNqdmhueEQ,6" .ascii " QAe Mz CguPmY ZAZGYqe " .ascii "OAZEQCgmf. MOogEMy xUnQ" .ascii "DMHUEeq qU huY, qM eqM " .ascii "fmOuYmfqe UybqdpUqf gxX" .ascii "mYoaDbqd?" .byte 10 #end of data

############### Please code in MIPS assembly########################

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 Databases Questions!