100%(4)4 out of 4 people found this document helpful
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.
Get answer to your question and much more
b.Specify the contents of the STATUS register.
Get answer to your question and much more
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: