PPT-4 - Data Transfer Instructions
PPT-4 - Data Transfer Instructions
MICROPROCESSORS
Dr. Anu Shaju Areeckal,
Asst. Professor, Dept of E&C, MIT Manipal
This ppt is for reference only. Use the referred textbooks as the main study material.
ARM Data Transfer
Instructions
Post condition
Instructions
R0 R1
LDRH R0, [R1, #4] 0x00009988 0x40000000
LDRSH R0, [R1, #4] 0xFFFF9988 0x40000000
LDRSB R0, [R1, #4]! 0xFFFFFF88 0x40000004
LDRB R0, [R1, #4]! 0x00000088 0x40000004
ARM Data Transfer Instructions
Pre condition Post condition
Instructions
R0= 0x44332211 R0 R1
R1= 0x40000000 STR R0, [R1] 0x44332211 0x40000000
Post condition STRB R0, [R1, #4]! 0x44332211 0x40000004
0x40000000 ---- STRH R0, [R1, #4]! 0x44332211 0x40000008
0x40000001 ---- Post condition
0x40000002 ---- 0x40000000 0x11
0x40000003 ---- 0x40000001 0x22
0x40000004 ---- 0x40000002 0x33
0x40000005 ---- 0x40000003 0x44
0x40000006 ---- 0x40000004 0x11
0x40000007 ---- 0x40000005 ----
0x40000008 ---- 0x40000006 ----
0x40000009 ---- 0x40000007 ----
0x40000008 0x11
0x40000009 0x22
Data transfer instruction
format
ARM Data Transfer Instruction Format
ARM Data Transfer Instruction Format
Bits [31-28] Condition
ARM Data Transfer Instruction Format
Bits [27 26]: 0 1 fixed for data transfer instructions
ARM Data Transfer Instruction Format
Bits [25]: offset is immediate(0) or register(1)
26
Swap and Swap Byte Instructions
1
Rn
temp
2 3
Memory
• Thus to Rd Rd = Rm.
Rmimplement an actual swap of contents make
• The compiler cannot produce this instruction.
09-08-2023 Dr Kanthi. M, Professor, ECE Dept. 28
09-08-2023 Dr Kanthi. M, Professor, ECE Dept. 29
REFERENCE TEXTBOOKS
• William Hohl, “ARM assembly language
fundamentals and techniques”, CRC press, 2009
• Andrew N Sloss, “ARM System developer’s guide,
designing and optimizing system software”,
Elsevier, 2004
• J. R. Gibson, “ARM Assembly Language-an
Introduction”, Dept. of Electrical Engineering and
Electronics, The University of Liverpool, 2007