data-processing-instructions

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

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

View Full Document Right Arrow Icon

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

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

Unformatted text preview: 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, 1s 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 & 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 &...
View Full Document

This document was uploaded on 11/03/2011 for the course CSE 380 at SUNY Buffalo.

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 Right Arrow Icon
Ask a homework question - tutors are online