{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

data-processing-instructions

# data-processing-instructions - CSE 379 ARM Instruction Set...

This preview shows pages 1–3. Sign up to view the full content.

CSE 379 ARM Instruction Set: Arithmetic, Logical, Shifting & Rotating Overview ° Typical ARM Assembly Instruction ± ADD r3, r2, r0 ; r3 := r2 + r0 ° Destination Register ± First register ± Example ² r3 ° Source Registers ± Second and Third Registers ± Example ² r2, r0 ° Comments ± Everything after semicolon is considered to be a comment and is ignored by the assembler Move Instructions ° MOV ± Moves (copies) a 32-bit value into a register ± Example ² MOV r4, #0x17 ² Result ³ r4 = 0x00000017 ° MVN ± Moves (copies) the inversion (not, 1’s complement) of a 32-bit value into a register ± Example ² MVN r5, #0xA6 ² Result ³ r5 = 0xFFFFFF59 Arithmetic Instructions ° ADD ± Add two 32-bit values, storing sum in destination register ± Rd:= Rn + N ² N can be immediate data or a register ± Examples ² Initial Values: ³ r0 = 0x0000A810 ³ r1 = 0x0000006E ³ r2 = 0x10E9081C ³ r3 = 0x400FE9C3 ³ r4 = 0xA0BD2196

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

View Full Document
² Instructions ³ ADD r2, r1, r0 r2 = 0x0000A87E ³ ADD r3, r1, #24 r3 = 0x00000086 ³ ADD r4, r4, #0x15 r4 = 0xA0BD21AB ° ADC ± Add two 32-bit values and the carry flag, storing sum in destination register ± Rd:= Rn + N + {Carry Flag} ² N can be immediate data or a register ± Examples ² ADC r6, r2, r1 ² ADC r5, r4, #14 ° SUB ± Subtract two 32-bit values, storing difference in destination register ± Rd:= Rn - N ² N can be immediate data or a register ± Examples ² Initial Values: ³ r0 = 0x0000A810 ³ r1 = 0x0000006E ³ r2 = 0x10E9081C ³ r3 = 0x400FE9C3 ³ r4 = 0xA0BD2196 ² Instructions ³ SUB r0, r0, r1 r0 = 0x0000A7A2 ³ SUB r4, r3, #0xA5 r4 = 0x400FE91E ³ SUB r2, r1, #10 r2 = 0x00000064 ° SBC ± Subtract two 32-bit values with carry, storing difference in destination register ± Rd:= Rn - N - !{Carry Flag} ² N can be immediate data or a register ± Examples ² SBC r3, r0, r2 ² SBC r2, r1, #0x93
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 8

data-processing-instructions - CSE 379 ARM Instruction Set...

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

View Full Document
Ask a homework question - tutors are online