This is a classic problem of assembly language programming. Write a sequence of ARM instructions that swap the contents of registers r0 and r1 without using any additional registers or memory storage; that is, you can’t move r1 to a temporary location.

What will be an ideal response?

This sleight of hand uses the XOR, exclusive OR. Consider a and b.

So, to swap r0 and r1 write


EOR r0,r0,r1
EOR r1,r0,r1
EOR r0,r0,r1

Computer Science & Information Technology

You might also like to view...

A macro name like Add Date is allowed

Indicate whether the statement is true or false

Computer Science & Information Technology

Tethering is the term for a mobile device sharing its Internet connection with other Wi-Fi-capable devices

Indicate whether the statement is true or false

Computer Science & Information Technology