Question: C code: void printMonthYear(int mon, int year) { printf( ); switch (mon) { case 1: printf(January); break; case 2: printf(February); break; case 3: printf(March); break;

C code:

void printMonthYear(int mon, int year) {

printf(" "); switch (mon) { case 1: printf("January"); break; case 2: printf("February"); break; case 3: printf("March"); break; case 4: printf("April"); break; case 5: printf("May"); break; case 6: printf("June"); break; case 7: printf("July"); break; case 8: printf("August"); break; case 9: printf("September"); break; case 10: printf("October"); break; case 11: printf("November"); break; case 12: printf("December"); }

printf(" %d ",year);

}

x86 assembly

Registers

%rip Instruction pointer

%rsp Stack pointer

%rax Return value

%rdi 1st argument

%rsi 2nd argument

%rdx 3rd argument

%rcx 4th argument

%r8 5th argument

%r9 6th argument

%r10,%r11 Callee-owned

%rbx,%rbp,

%r12-%15 Caller-owned

Please follow the guidelines thoroughly and convert the C code into a x86 assembly language. Please use the provided method, register and implementation. Please do not give me the .S file which is derived directly from the command line.Need help. Thanks,

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!