Question: Turn X86 code into ARM assembly Language #include stdafx.h #include stdio.h #include char main(void) { char temp; char r1, r2; short r; _asm { MOV

Turn X86 code into ARM assembly Language

#include "stdafx.h"

#include "stdio.h"

#include

char main(void)

{

char temp;

char r1, r2;

short r;

_asm

{

MOV BL, 'a'

MOV BH, 'A';

MOV r1, BL;

MOV r2, BH;

MOV r, BX;

}

printf("BH =%c, BL = %c, BX = %x ", r2, r1, r);

printf("BH =%x, BL = %x, BX = %x ", r2, r1, r);

_asm

{

MOV temp, BH;

MOV BH, BL; //This line was added to fix the error.

MOV r2, BL;

MOV BL, temp;

MOV r2, BH;

MOV r1, BL;

MOV r, BX;

//find error here for swap the info between BL and BH and make necessary change

}

std::cout << "After swapping" << std::endl;

printf("BH =%c, BL = %c, BX = %x ", r2, r1, r);

printf("BH =%x, BL = %x, BX = %x ", r2, r1, r);

system("pause");

//getchar();

return 0;

}

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!