Question: // Write an assembly language version of the following C code segment: char A[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}

// Write an assembly language version of the following C code segment:

char A[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} char B[10] = {11, 12, 13, 14, 15, 16, 17, 18, 19, 20}

for (char i=1; i<10; i++) { A[i] = A[i-1] + B[i]; }

// the .h and .ino file are provided and we are of course being asked to write our own .S file. This question is an // example of a question that is going to be on an exam and I'm completely stuck here at home.

// .ino code

#include "Practice3.h"

void setup() {

compute(); Serial.begin(9600); for (int i=0; i<10;i++) Serial.println(dataA[i], DEC); }

void loop() { }

// the .h file provided...

/* * Global register variables. */ #ifdef __ASSEMBLER__

/* Assembler-only stuff */

#else /* !ASSEMBLER */

/* C-only stuff */

#include

extern "C" void compute(); extern "C" uint8_t dataA[];

#endif /* ASSEMBLER */

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!