Chapter 05c - MSP430 ISA - Instructions

Pc new pc old 2 pc offset 2 the possible range is 511

This preview shows page 9 - 11 out of 25 pages.

PC new = PC old + 2 + PC offset × 2 The possible range is -511 to +512 words relative to the PC value at the jump instruction.
Image of page 9
BYU CS/ECEn 124 Chapter 05c - MSP430 Instructions 10 To Disassemble An Instruction: Jump Instructions To decode an instruction: 1. Begin with a “PC” pointing to the first word in program memory. 2. Retrieve instruction word and increment PC by 2. 3. Find and list the corresponding instruction mnemonic using the opcode (most significant 4/6/9 bits). 4. Append “.b” or “.w” using the b/w bit when appropriate. 5. If double operand instruction, decode and list source operand (See below). 6. If single or double operand instruction, decode and list destination operand (See below). 7. If jump instruction, sign extend the 10-bit PC offset, multiply by 2, and add to the current PC. List that address.
Image of page 10

You've reached the end of your free preview.

Want to read all 25 pages?

BYU CS/ECEn 124 Chapter 05c - MSP430 Instructions 11 To Disassemble An Operand: Jump Instructions 1. To decode a source operand: a. Decode the addressing mode from the “As” bits (00=register, 01=indexed, 10=indirect, or 11=indirect auto-increment) and source register from the “S-Reg” bits. b. If “@R2”, “@R2+”, “R3”, “x(R3)”, “@R3”, or “@R3+”, list appropriate constant preceded by pound sign (ie #1). c. Else if “x(R0)”, change to symbolic mode, retrieve index (next code word), add index word to PC, increment PC, and list that address as operand (ie. 0x8023). d. Else if “x(R2)”, change to absolute mode, retrieve address (next code word), increment PC, and list address preceded by an ampersand symbol (ie. &addr). e. Else if “@PC+”, change to immediate mode, retrieve immediate value (next code word), increment PC, and list immediate value preceded by the pound symbol (ie. #100). f.
Image of page 11

You've reached the end of your free preview.

Want to read all 25 pages?

You've reached the end of your free preview.

Want to read all 25 pages?

  • Fall '08
  • Staff
  • Machine code, BYU CS/ECEn

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern