Question: I Need this code in full assembly and to be able to work on my raspberry pi but is not working. need help. #include stdafx.h

I Need this code in full assembly and to be able to work on my raspberry pi but is not working. need help.

#include "stdafx.h"

#include "stdio.h"

#include

char main(void)

{

char temp;

char r1, r2;

short r;

_asm

{

STR R3, [R6, #0x18]

SBCS R7, R6

ADDS R0, R1, #6

MOVS R0, R0

MOVS R0, R0

SUBS R5, #0x88

MOVS R0, R0

MOVS R0, R0

LDRH R6, [R4, #0xA]

MOVS R5, R3

MOVS R0, R0

}

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

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

_asm

{

SUBS R5, #0x88

MOVS R0, R0

MOVS R0, R0

SVC #0x88

ADDS R0, R1, #6

MOVS R0, R0

MOVS R0, R0

ADDS R2, R1, #6

MOVS R0, R0

MOVS R0, R0

SUBS R5, #0x88

MOVS R0, R0

MOVS R0, R0

ADDS R0, R1, #6

MOVS R0, R0

MOVS R0, R0

LDRH R6, [R4, #0xA]

MOVS R5, R3

MOVS R0, R0

}

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!