Chapter 04 - The Von Neumann Model

Status bits n set if result is negative else reset z

This preview shows page 20 - 26 out of 48 pages.

Status Bits N: Set if result is negative, else reset Z: Set if result is zero, else reset C: Set if there is a carry, else reset V: Set if an arithmetic overflow, else reset Example ADD.W @R13+,10(R13) ; ADD LSDs ADDC.W @R13+,10(R13) ; ADD 2/carry Assembly Instructions
Image of page 20

Subscribe to view the full document.

BYU CS/ECEn 124 Chapter 4 - The Von Neumann Model 21 AND Source to Destination AND Source AND destination Syntax AND{.W or .B} src,dst Operation src .AND. dst −> dst Description The source operand and the destination operand are logically ANDed. The result is placed into the destination. Status Bits N: Set if result MSB is set, else reset Z: Set if result is zero, else reset C: Set if result is not zero, else reset V: Reset Example MOV #0AA55h,R5 ; Load mask AND R5,TOM ; mask M(TOM) JZ TONI Assembly Instructions
Image of page 21
BYU CS/ECEn 124 Chapter 4 - The Von Neumann Model 22 Clear Bits in Destination BIC Clear bits in destination Syntax BIC{.W or .B} src,dst Operation .NOT.src .AND. dst −> dst Description The inverted source operand and the destination operand are logically ANDed. The result is placed into the destination. The source operand is not affected. Status Bits Status bits are not affected. Example BIC.W #0FC00h,LEO ; Clear 6 MSBs BIC.B #0F8h,LEO ; Clear 5 MSBs Assembly Instructions
Image of page 22

Subscribe to view the full document.

BYU CS/ECEn 124 Chapter 4 - The Von Neumann Model 23 Set Bits in Destination BIS Set bits in destination Syntax BIS{.W or .B} src,dst Operation src .OR. dst −> dst Description The source operand and the destination operand are logically ORed. The result is placed into the destination. The source operand is not affected. Status Bits Status bits are not affected. Example BIS.W #003Fh,TOM ; set the 6 LSBs BIS.B #0E0h,TOM ; set the 3 MSBs Assembly Instructions
Image of page 23
BYU CS/ECEn 124 Chapter 4 - The Von Neumann Model 24 Test Bits in Destination BIT Test bits in destination Syntax BIT{.W or .B} src,dst Operation src .AND. dst Description The source and destination operands are logically ANDed. The result affects only the status bits. The source and destination operands are not affected. Status Bits N: Set if MSB of result is set, else reset Z: Set if result is zero, else reset C: Set if result is not zero, else reset V: Reset Example BIT #0200h,R8 ; bit 9 of R8 set? JNZ TOM ; Y Assembly Instructions
Image of page 24

Subscribe to view the full document.

BYU CS/ECEn 124 Chapter 4 - The Von Neumann Model 25 Subroutine Call CALL Subroutine Syntax CALL dst Operation dst −> tmp dst is evaluated and stored SP − 2 −> SP PC −> @SP PC updated to TOS tmp −> PC dst saved to PC Description A subroutine call is made to an address anywhere in the 64K address space. All addressing modes can be used. The return address (the address of the following instruction) is stored on the stack. The call instruction is a word instruction.
Image of page 25
Image of page 26
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