Question
;------------------------------------------------------------------------------- ; MSP430 Assembler Code Template for use with TI Code Composer Studio ; ; ;------------------------------------------------------------------------------- .cdecls C,LIST,msp430.h ; Include device header file ;------------------------------------------------------------------------------- .def
;-------------------------------------------------------------------------------
; MSP430 Assembler Code Template for use with TI Code Composer Studio
;
;
;-------------------------------------------------------------------------------
.cdecls C,LIST,"msp430.h" ; Include device header file
;-------------------------------------------------------------------------------
.def RESET ; Export program entry-point to
; make it known to linker.
;-------------------------------------------------------------------------------
.data ; RAM STARTS AT 0x0200
varW: .word 0x4444, 0x5555 ;
varB: .byte 0x77, 0x66 ;
array: .space 10 ;
.text ; Assemble into program memory.
.retain ; Override ELF conditional linking
; and retain current section.
.retainrefs ; And retain any sections that have
; references to current section.
symcon1: .set 0x0001 ;
const: .word 0x1000, 0x2000, 0x3000 ;
INIT_STACK: .set 0x400 ;0x400 = 0x03FE+2, 0x03FE = RAM BOTTOM
;-------------------------------------------------------------------------------
RESET mov.w #__STACK_END,SP ; Initialize stackpointer
StopWDT mov.w #WDTPW|WDTHOLD,&WDTCTL ; Stop watchdog timer
;-------------------------------------------------------------------------------
; Main loop here
;-------------------------------------------------------------------------------
_main:
mov.w #INIT_STACK,SP ; initialize stack pointer
mov.w #WDTPW+WDTHOLD,&WDTCTL ; stop watchdog timer
mov.w #0x5555, R4 ;
mov.w &varW, R4 ;
sub.w &varW+2, R4 ;
;CHECKPOINT 1
mov.w R4, &varW+2 ;
mov.w &varW+4, R5
;CHECKPOINT 2 ;
add.b &varB, R5 ;
;CHECKPOINT 3
mov.w #0xFFFF, &const ;
clr.w R14 ;
L1:
mov.w R14, array(R14)
incd.w R14
cmp.w #8,R14
jne L1
;CHECKPOINT 4
Loop: jmp Loop
;-------------------------------------------------------------------------------
; Stack Pointer definition
;-------------------------------------------------------------------------------
.global __STACK_END
.sect .stack
;-------------------------------------------------------------------------------
; Interrupt Vectors
;-------------------------------------------------------------------------------
.sect ".reset" ; MSP430 RESET Vector
.short RESET
a) What memory address (in hex) is yarW stored? b) What memory address (in hex) is varB stored? c) What memory address (in hex) is const+4 stored? d) What is the value of R4 (in decimal) at CHECKPOINT 1? e) What is the value of R5 (in hex) at CHECKPOINT 2? f What is the value of the memory address (16 bits) that &varW+4 points to? g) What is the value of R5 (in hex) at CHECKPOINT 3? h) What is the significance of the byte operator in add.b, specifically, how did it impact the result of question 7? what is the result of the instruction "mov.w #0xFFFF, &const"? j) What are the values of the array at CHECKPOINT 4? k) The instruction "ineL1" is Ox23FB in machine code. If 23 is the op-code/C, why are the last two bits "FB"? a) What memory address (in hex) is yarW stored? b) What memory address (in hex) is varB stored? c) What memory address (in hex) is const+4 stored? d) What is the value of R4 (in decimal) at CHECKPOINT 1? e) What is the value of R5 (in hex) at CHECKPOINT 2? f What is the value of the memory address (16 bits) that &varW+4 points to? g) What is the value of R5 (in hex) at CHECKPOINT 3? h) What is the significance of the byte operator in add.b, specifically, how did it impact the result of question 7? what is the result of the instruction "mov.w #0xFFFF, &const"? j) What are the values of the array at CHECKPOINT 4? k) The instruction "ineL1" is Ox23FB in machine code. If 23 is the op-code/C, why are the last two bits "FBStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started