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

Intro Microprocessor System (CDA 3331C) MSP430G2553 Microprocessor Used **TYPE T

ID: 3722067 • Letter: I

Question

Intro Microprocessor System (CDA 3331C)

MSP430G2553 Microprocessor Used

**TYPE THE SOLUTION PLEASE**

An example of an assembly program is given below:

.cdecls C,LIST,"msp430.h"

.text
.retain
.retainrefs

RESET
mov.w #WDTPW|WDTHOLD,WDTCTL
mov.w #__STACK_END,SP

mov.w #007Dh,&0200h ;the first number
mov.w #00B5h,&0202h ;the second number
mov.w #00E8h,&0204h ;the third number

jmp $

;------------------------
;Stack Pointer definition
;------------------------
.global __STACK_END
.sect .stack

;-------------------
;Interrupt Vectors
;-------------------
.sect RESET_VECTOR
.short RESET
.end

Write a program in assembly language such that: a. It contains a subroutine which performs the and operation with the 7.7 entry of register R6 and hexadecimal number 0001h. The result will be saved in the same register b. Repeat part a by applying the same operation to five successive memory locations. Use an appropriate addressing mode.

Explanation / Answer

a.

ORG 30h
main:

MOV R6,#65h
Call Subroutine

RET
; end of main program

;Subroutine to AND r6, 0001h
Subroutine:
MOV AX,R6
ANL AX,#01h   ;AND Logic AX with 0001h
MOV R6,AX   ;To store result in R6
RET       ;To return to main Program
;end of subroutine


b.

ORG 30h
main:
MOV R6,#1000h       ;1000h is the memory location
MOV R1,#05h       ;To maintain the loop count
Again: Call subroutine  
DJNZ R1, Again
RET
;End of Main program


;Subroutine to AND r6, 0001h
Subroutine:
MOV AX,@R0   ;To retrieve the value from memory locactio
ANL AX,#01h   ;AND Logic AX with 0001h
MOV @R0,AX   ;To store result in memory location
INC R0       ;To increment the memory location
RET       ;To return to main Program
;end of subroutine

The Logic is same for any controller or processor, just the syntax changes.

This program works fine 8051 controller.

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