Question: 5. Identify and correct the errors in the following two programs. Note that the C program calls the assembly subroutine, which are assumed to
5. Identify and correct the errors in the following two programs. Note that the C program calls the assembly subroutine, which are assumed to be in different files. C Program (main.c) Assembly Program (strcpy.s) char sre[25] = "Hello!"; char dst [25]; int main(void) { strcpy (dst, src); while (1); AREA stringCopy, CODE ALIGN ALLGBY PROC loop LDRB r2, [rl]; Load a byte, r1 = *src STRB r2, [ro]; Store a byte, 20= *dst ADD rl, 1 Increase memory pointer ADD r0, #1 ; Increase memory pointer CMP 12, 40; Zero terminator BNE loop Loop if not null terminator ENDP END
Step by Step Solution
3.43 Rating (150 Votes )
There are 3 Steps involved in it
There are a few errors in both the C program mainc and the Assembly program strcpys Ill provide corr... View full answer
Get step-by-step solutions from verified subject matter experts
