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

Write an assembly program (Include coments for the code and a flow chart) that w

ID: 3869639 • Letter: W

Question

Write an assembly program (Include coments for the code and a flow chart) that will examine an input string. Assume that a string does not include more than one line. Assume the input string is “ Welcome to Assembly Programming @ MSP430! ”. Your program should count the number of total characters, number of uppercase vowels , and number of special characters ( other than characters and digits). Set the port P1 to display the number of special characters , and port P2 to display the number of vowels . Storethe total number of characters in register R10.If you are using the sample string given above for testing, the correct results are shown below (in decimal):

Total Characters:40

Total Uppercase Vowels:1

Total Special Characters:6

What is the starting address of theprogram?
How many clock cycles does each instruction take to execute?
Observe the contents of memory location and registers as you step through the program. Whatis the content of the memory location at the address 0xFFFE?
What are the addresses of the special-purpose registers P1DIR and P1OUT? Monitor the
contents of these locations as you walk through your program. Set breakpoints to move easier
through your program.

Explanation / Answer

which may be clearer. Here 'source' is the C expression for the input operand while 'result' is that of the output operand. '=' indicates, that the operand is an output. m and r are constraints and inicate which types of addressing mode GCC has to use in the operand. These constraints are fully documented in the GNU GCC documentation.

Each asm statement is divided into four parts, by colons:

The assembler instructions, defined as a single string constant:

"mov %src, %res"

A list of output operands, separated by commas. Our example uses just one, and defines the identifier "res" for it:

[res] "=r" (result)

A comma separated list of input operands. Again, our example uses just one operand, and defines the identifier "src" for it:

[src] "m" (source)

The clobbered registers. This is left empty in our example, as nothing is clobbered.

So, the complete pattern is:

asm((string asm statement) : [outputs]:[inputs]:[clobbers]);

Each input and output operand is described by a constraint string followed by a C expression in parantheses.

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