a6-2004-37957-pseudo-instructions

.pdf

School

University of Regina *

*We aren’t endorsed by this school

Course

201

Subject

Electrical Engineering

Date

Jan 9, 2024

Type

pdf

Pages

8

Uploaded by DrBook9814

Report
Studocu is not sponsored or endorsed by any college or university A6 2004 37957 - pseudo-instructions Introduction to Digital Systems (University of Regina) Studocu is not sponsored or endorsed by any college or university A6 2004 37957 - pseudo-instructions Introduction to Digital Systems (University of Regina) Downloaded by black pearl (bp6735254@gmail.com) lOMoARcPSD|21438098
NAME: KHUSHIBEN PIYUSHBHAI PATEL STUDENT ID: 200437957 ASSIGNMENT NO: A6 Task 1 The following are some additional pseudo-instructions that one could define in the assembly system that we have discussed. For each of them, give one or more real assembly instructions to perform the expected operation. Remember: pseudo-instructions cannot modify any registers except the specified $rd and $pc for branch/jump (where applicable), but pseudo instructions may rely on $at for intermediate results. Provide short description of the potential use of each listed pseudo-instruction below. Answer: A). xchg $rt, o[$rs] #swap the memory in M[$rs+o] with $rt .xchg : use to changes data between to operands. $rt : A second type register in R-type instruction $rs : used first source register MIPS assembly instruction: Sub $at, $rt, $0 lw $rt, 0 [$rs] sw $at, 0 [$rs] B). slld $rs,$rt,shamt #Shift the double word rs:rt left by shamt Slld : used for shift left register $rt: A second type register in R-type of instruction $rs: is source register and used for first source register Shamt : it is used to shift two operands. MIPS assembly Instruction: Slr $at,rt, 32-shamt Sll $rs,rs, shamt Downloaded by black pearl (bp6735254@gmail.com) lOMoARcPSD|21438098
Sll $rs,$rs,$at C). double $rd, $rs #$rd = 2x($rs) Double: store data in 8 memory location $rt: A second type of register in R-type of instruction $rs : is first source register and used for first source register Li: li means load the immediate value, immediate values are 16-bits. Bgt: bgt means branching pseudo instruction Blt: blt means branching pseudo instruction Sll : sll means shift left register MIPS assembly instruction: li $at, 0x3FFF bgt $rs, $at, ERRORHANDLER li $at, 0xC000 blt $rs,$at, ERRORHANDLER sll $rd,$rs,1 D). triple $rd, $rs #$rd = 3x($rs) triple: store data in 12 memory locations $rt: A second type of register in R-type of instruction Li: li means load the immediate value, immediate values are 16-bits Bgt : bgt means branching pseudo instruction Blt: blt means branching pseudo instruction Sll : sll means shift left register Add: add $rs and 1, and stored the result in $rd MIPS assembly instruction: Li $at, 03xFFF Bgt $rs,$at, ERRORHANDLER Downloaded by black pearl (bp6735254@gmail.com) lOMoARcPSD|21438098
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help