lecNew-20-JMP

lecNew-20-JMP - WPI ECE2801 Foundations of Embedded...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
WPI ECE2801 Foundations of Embedded Computer Systems Lecture 20: Jumps and Assembly Directives
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
EE2801: Foundations of Embedded Systems Lecture 11 Review: MSP430 Instructions 27 core instructions : unique opcode 24 emulated instructions : no opcode for themselves, replaced by assembler with an equivalent core instruction. Three core instruction formats Dual-operand: OPCODE src, dst Single-operand: OPCODE dst/src Jump: OPCODE label Functional groups Arithmetic instructions: ADD, ADDC, SUB, SUBC, *ADC, *SBC, DADD, *DADC, *INC, *INCD, *DEC, *DECD, SXT Logical and register control instructions: AND, XOR, *INV, BIC, BIS, *CLRC, *CLRN, *CLRZ *SETC, *SETN, *SETZ Data instructions: *RLA , * RLC , RRA , RRC , SWPB , MOV, *CLR, SWPB Program flow
Background image of page 2
EE2801: Foundations of Embedded Systems Lecture 20 Three Ways to Change Program Flow Jumps (software) Unconditional Jump: JMP label Conditional Jumps: JEQ/JZ, JNE/JNZ, JC, JNC, JN, JGE, JL Branch: BR/BRANCH Procedure calls (software) CALL/RET Interrupts (software or hardware)
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
EE2801: Foundations of Embedded Systems Lecture 20 Unconditional Jump JMP label BR dst Operation: JMP: PC + 2*offset → PC BR: dst → PC Note: The offset is coded using 10 bits. So JMP can jump a limited range: 512 words backwards or 511 words forward [-512, 511]. BR/BRANCH is a word instruction. The destination address in specified by 16-bit dst. So it can branch to an address anywhere in the 64K address space. Status Bit affected: None
Background image of page 4
EE2801: Foundations of Embedded Systems Lecture 20 Comparison CMP src, dst *TST dst Operation: CMP: dst + .NOT.src +1 i.e. dst - src *TST: dst + 0FFFFh + C (CMP #0, dst) or dst+0FFh+C (CMP.B #0,dst) Note: The operation does not change the content of either location; the result affects STATUS register Status Bit affected: N, Z, C, V
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/12/2009 for the course ECE 2801 taught by Professor Jarvis during the Spring '08 term at WPI.

Page1 / 17

lecNew-20-JMP - WPI ECE2801 Foundations of Embedded...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online