7 use mplab ide to complete this question the

This preview shows page 8 - 11 out of 11 pages.

7.Use MPLAB IDE to complete this question.The following program adds two bytes, BYTE1 AND BYTE2. If the sum generates anoverflow, it clears REG10; otherwise save the sum in REG10. Answer the followingquestions.BYTE1EQU0x34;Data bytesBYTE2EQU0x56REG10EQU0x10;Register to save the sumORG0040;Begin assembly at 0040HSTART:MOVLWBYTE1;Load first data byte
ADDLWBYTE2;Add second data byteBNOVSAVE;Is there an overflow?MOVLW0;If yes, clear W and REG10SAVE:MOVWFREG10,0;If no, save sumSLEEPEnda.Specify the sum of the data bytes.
b.Specify the contents of the STATUS register.
c.Specify the contents of REG10.
REG10 contents should be 00h because the instruction the BNOV instruction checks andfinds an OV flag the next step clears WREG and REG10.d.Assemble and single step the program and verify your answers.Assembly Code:STATUS Register Byte after execution:Results of execution WREG:
Results of execution REG10:
End of preview. Want to read all 11 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Fall
Professor
N/A
Tags
Addition, Assembly Language, Status register, WREG

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture