Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Question 3. What will be the values at memory locations 02F0h, 02F2h, 02F4h, 02F

ID: 3864499 • Letter: Q

Question

Question 3. What will be the values at memory locations 02F0h, 02F2h, 02F4h, 02F6h, and 02F8h when the following program is run? cdecls C, LIST msp430.h" text retain retainrefs RESET mov #WDTPWIWDTHOLD, WDTCTL mov STACK END, SP Main loop: mov W 000 6h, 02F0h mov w #000 9h, & 02F2h clr.w 602 F 6h clr. 602 F8h mov & 02F2h, 02F4h add, w &02F0h, & 02F4h cmp #000Ah, &02F4h jhs Greater jlo Less Greater mov W &02F 0h, &02F8h jmp Mainloop Less mov 02F2h, 02F6h jmp Mainloop ;Stack Pointer definition global STACK END sect stack Interrupt Vectors sect RESET VECTOR short RESET end

Explanation / Answer

AREA LDRlabel, CODE, READONLY ENTRY ; Mark first instruction to execute start BL func1 ; Branch to first subroutine BL func2 ; Branch to second subroutine stop MOV r0, #0x18 ; angel_SWIreason_ReportException LDR r1, =0x20026 ; ADP_Stopped_ApplicationExit SVC #0x123456 ; ARM semihosting (formerly SWI) func1 LDR r0, =start ; => LDR r0,[PC, #offset into Literal Pool 1] LDR r1, =Darea + 12 ; => LDR r1,[PC, #offset into Literal Pool 1] LDR r2, =Darea + 6000 ; => LDR r2,[PC, #offset into Literal Pool 1] BX lr ; Return LTORG ; Literal Pool 1 func2 LDR r3, =Darea + 6000 ; => LDR r3,[PC, #offset into Literal Pool 1] ; (sharing with previous literal) ; LDR r4, =Darea + 6004 ; If uncommented, produces an error because ; Literal Pool 2 is out of range. BX lr ; Return Darea SPACE 8000 ; Starting at the current location, clears ; a 8000 byte area of memory to zero. END ; Literal Pool 2 is automatically inserted ; after the END directive. ; It is out of range of all the LDR ; pseudo-instructions in this example.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote