swap - 0xA8973452 SWPB r1, r8, [r2] Before SWPB R1 =...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CSE 379 ARM Instruction Set: Swap Swaps a register with a word or a byte in memory Atomic Operation Reads and writes to/from a location in the same bus cycle Prevents any other location from reading/writing to that location until it completes Swapping a Word SWP rd, rm, [rn] temp = mem32[rn] mem32[rn]=rm rd=temp Swapping a Byte SWPB rd, rm, [rn] temp = mem8[rn] mem8[rn]=rm rd=temp Examples SWP r1, r8, [r2] Before SWP R1 = 0x0110AABB R2 = 0x000009FC R8 = 0x0330EEFF After SWP R1 = 0x23E04F87 R2 = 0x000009FC R8 = 0x0330EEFF 0x000009F0 Address 0x1000FFE7 Contents 0x000009F8 0xE01AEB5 0x000009FC 0x874FE023 0x00000A00 0x4CE2A819 0x00000A04 0x00000A04 0x00000A07 0x000009F4 0x39140AEC 0xA8973452 0x000009F0 Address 0x1000FFE7 Contents 0x000009F8 0xE01AEB5 0x000009FC 0xFFEE3003 0x00000A00 0x4CE2A819 0x00000A04 0x00000A04 0x00000A07 0x000009F4 0x39140AEC
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 0xA8973452 SWPB r1, r8, [r2] Before SWPB R1 = 0x0110AABB R2 = 0x000009F8 R8 = 0x0330EEFF After SWPB R1 = 0x000000E0 R2 = 0x000009F8 R8 = 0x0330EEFF References Andrew N. Sloss, Dominic Symes, and Chris Wright, ARM System Developers Guide -Designing and Optimizing System Software , Morgan Kaufmann, 2004, pp. 72-73 Steve Furber, ARM System-on-chip Architecture , 2 nd Edition, Addison-Wesley, 2000 0x000009F0 Address 0x1000FFE7 Contents 0x000009F8 0xE01AEB5 0x000009FC 0x874FE023 0x00000A00 0x4CE2A819 0x00000A04 0x00000A04 0x00000A07 0x000009F4 0x39140AEC 0xA8973452 0x000009F0 Address 0x1000FFE7 Contents 0x000009F8 0xFF1AEB5 0x000009FC 0x874FE023 0x00000A00 0x4CE2A819 0x00000A04 0x00000A04 0x00000A07 0x000009F4 0x39140AEC 0xA8973452...
View Full Document

Page1 / 2

swap - 0xA8973452 SWPB r1, r8, [r2] Before SWPB R1 =...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online