Question: (1) Write the program segment requested (screenshot in MPlab X IDE v5.45) 3-4 Multiple-byte increment. Figures 3-4a and 3-4b illustrate one way to increment a

 (1) Write the program segment requested (screenshot in MPlab X IDEv5.45) 3-4 Multiple-byte increment. Figures 3-4a and 3-4b illustrate one way to

(1) Write the program segment requested (screenshot in MPlab X IDE v5.45) 3-4 Multiple-byte increment. Figures 3-4a and 3-4b illustrate one way to increment a 3-byte number. Write an alternative instruction sequence to increment AARG using nothing but incf instructions and either bz or bnz instructions. Is there any reason to prefer the scheme of Figure 3-4b? Is there any reason to prefer your scheme? Put in all the elements needed to be an operational asm program (see Algorithms 1 and 2 in the First Programming Exercise) [to the right] Enter your program segment from part (a) [below] Using break points and single-stepping, execute your program segment and assure it performisthe task of your chosen text problem (3-4 or 3-5) :_(Extra Credit, 10 points) Make a state table, showing-Initial values-Instruction-by-Instruction, execution of your program segment-Final values (3)_(Extra credit, 5 points Essay question) How does drawing out the state table assist in validating correctness of the program segment. AARGB1 AARGBO (most significant byte) AARGB2 (least-significant byte) (a) A three-byte binary number, AARG clrf WREG inch AARGB2,F addwfc AARG81,F addwfc AARGBO, F First clear WREG Increment the least-significant byte Add carry (and WREG-O) to middle byte Add carry to most-significant byte (b) Incrementing AARG clrf WREG decf AARGB2,F Subwfb AARGB1,F subwfb AARGBO, F ;First clear WREG Decrement the least-significant byte Subtract borrow (and WEG-) from middle byte :Subtract borrow from most-significant byte Algorithm 1 Initial code for a PIC18 assembly language program. ;; Inputs: i; Outputs: Describe program outputs> ii Side effects: ;; Required header things, ;; PIC-AS requires these to specify the target and special configuration bits in the PIC18 // Tells assembler which type CPU is the target PROCESSOR 18F47010 // Microchips new process to load CPU details (defines symbols such as PORTA) #include // Loads needed configuration bits, controls the setup for the Curiosity HPC #include "EE367_PIC18F47010_Setup01.inc" Algorithm 2 Framework for a pic-as assembly language program. PSECT udata_acs // Program Section for data in "Access" memory MyVar: DS 1 // Reserves data space for a variable PSECT Code, class=CODE, abs, reloc=2 // Program Section for data in program memory Code: ORG 0x000000 // This initial instruction goes at address zero GOTO Main 11 Jump to beginning of program ORG 0x000020 // The actual program starts at address 0x0020 Main: 1/... // Assembly language program code goes here END Code // Marks the end of program code (1) Write the program segment requested (screenshot in MPlab X IDE v5.45) 3-4 Multiple-byte increment. Figures 3-4a and 3-4b illustrate one way to increment a 3-byte number. Write an alternative instruction sequence to increment AARG using nothing but incf instructions and either bz or bnz instructions. Is there any reason to prefer the scheme of Figure 3-4b? Is there any reason to prefer your scheme? Put in all the elements needed to be an operational asm program (see Algorithms 1 and 2 in the First Programming Exercise) [to the right] Enter your program segment from part (a) [below] Using break points and single-stepping, execute your program segment and assure it performisthe task of your chosen text problem (3-4 or 3-5) :_(Extra Credit, 10 points) Make a state table, showing-Initial values-Instruction-by-Instruction, execution of your program segment-Final values (3)_(Extra credit, 5 points Essay question) How does drawing out the state table assist in validating correctness of the program segment. AARGB1 AARGBO (most significant byte) AARGB2 (least-significant byte) (a) A three-byte binary number, AARG clrf WREG inch AARGB2,F addwfc AARG81,F addwfc AARGBO, F First clear WREG Increment the least-significant byte Add carry (and WREG-O) to middle byte Add carry to most-significant byte (b) Incrementing AARG clrf WREG decf AARGB2,F Subwfb AARGB1,F subwfb AARGBO, F ;First clear WREG Decrement the least-significant byte Subtract borrow (and WEG-) from middle byte :Subtract borrow from most-significant byte Algorithm 1 Initial code for a PIC18 assembly language program. ;; Inputs: i; Outputs: Describe program outputs> ii Side effects: ;; Required header things, ;; PIC-AS requires these to specify the target and special configuration bits in the PIC18 // Tells assembler which type CPU is the target PROCESSOR 18F47010 // Microchips new process to load CPU details (defines symbols such as PORTA) #include // Loads needed configuration bits, controls the setup for the Curiosity HPC #include "EE367_PIC18F47010_Setup01.inc" Algorithm 2 Framework for a pic-as assembly language program. PSECT udata_acs // Program Section for data in "Access" memory MyVar: DS 1 // Reserves data space for a variable PSECT Code, class=CODE, abs, reloc=2 // Program Section for data in program memory Code: ORG 0x000000 // This initial instruction goes at address zero GOTO Main 11 Jump to beginning of program ORG 0x000020 // The actual program starts at address 0x0020 Main: 1/... // Assembly language program code goes here END Code // Marks the end of program code

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!