Chapter 04 - The Von Neumann Model

Status bits status bits are not affected subroutine

This preview shows page 25 - 31 out of 48 pages.

Status Bits Status bits are not affected. Subroutine Linkage
Image of page 25

Subscribe to view the full document.

BYU CS/ECEn 124 Chapter 4 - The Von Neumann Model 26 Compare Source and Destination CMP Compare source and destination Syntax CMP{.W or .B} src,dst Operation dst + .NOT.src + 1 or (dst − src) Description The source operand is subtracted from the destination operand. The two operands are not affected and the result is not stored; only the status bits are affected. Status Bits N: Set if result is negative, else reset Z: Set if result is zero, else reset C: Set if carry from the MSB, else reset V: Set if an arithmetic overflow, else reset Example CMP R5,R6 ; R5 = R6? JEQ EQUAL ; YES, JUMP Assembly Instructions
Image of page 26
BYU CS/ECEn 124 Chapter 4 - The Von Neumann Model 27 Jump Jxx Jump if carry set Syntax Jx label Operation If condition true: PC + 2 × offset −> PC Description If condition is true, the LSB 10-bit signed offset contained in the instruction is added to the program counter. Else the next instruction following the jump is executed. Status Bits Status bits are not affected. Examples JC label ;(JHS) Jump if carry (C)==1 JEQ label ;(JZ) Jump if zero (Z)==1 JGE label ; Jump if (N .xor. V)==0 JL label ; Jump if (N .xor. V)==1 JMP label ; Jump unconditionally JN label ; Jump if negative (N)==1 JNC label ;(JLO) Jump if carry (C)==0 JNE label ;(JNZ) Jump if zero (Z)==0 Assembly Instructions
Image of page 27

Subscribe to view the full document.

BYU CS/ECEn 124 Chapter 4 - The Von Neumann Model 28 Move Source to Destination MOV Move word or byte source to destination Syntax MOV{.W or .B} src,dst Operation src −> dst Description The source operand is moved to the destination. The source operand is not affected. The previous contents of the destination are lost. Status Bits Status bits are not affected. Example MOV #EDE,R10 ; Prepare pointer MOV #020h,R9 ; Prepare counter Assembly Instructions
Image of page 28
BYU CS/ECEn 124 Chapter 4 - The Von Neumann Model 29 Push Source to Stack PUSH Push word or byte onto stack Syntax PUSH{.W or .B} src Operation SP − 2 → SP src → @SP Description The stack pointer is decremented by two, then the source operand is moved to the RAM word addressed by the stack pointer (TOS). Status Bits Status bits are not affected. Note The system stack pointer (SP) is always decremented by two, independent of the byte suffix. Example PUSH R8 ; save R8 Assembly Instructions
Image of page 29

Subscribe to view the full document.

BYU CS/ECEn 124 Chapter 4 - The Von Neumann Model 30 Return from Interrupt RETI Return from interrupt Syntax RETI Operation TOS → SR; SP + 2 → SP TOS → PC; SP + 2 → SP Description The status register is restored to the value at the beginning of the interrupt service routine by replacing the present SR contents with the TOS contents. The stack pointer (SP) is incremented by two. The program counter is restored to the value at the beginning of interrupt service.
Image of page 30
Image of page 31
You've reached the end of this preview.
  • Fall '08
  • Staff
  • Computer Architecture, Central processing unit, von Neumann model, Von Neumann architecture

{[ 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