Professional Documents
Culture Documents
Practical 2 PDF
Practical 2 PDF
Write an ALP to perform following task: 1. Transfer data from one register to
another 2. Store two numbers in register and perform addition operation. 3.
Store two numbers in register and perform subtraction operation 4. Store two
numbers in register and perform multiplication operation 5. Store two
numbers in register and perform logical operations like AND, OR XOR. 6.
Take 3 numbers and perform multiply and accumulate. 7. Square a number.
Introduction to Keil
Programming
Introduction to Keil
Programming
Introduction to Keil
Programming
• AREA <File Name>:
• It is a software defined mnemonics.
• It uses to define text file area where we write our program followed by
our ASM file name.
• CODE,READONLY:
• It defines the code which we are going to execute and it must be read
only at execute time.
Registers of ARM7
Instructions
• MOV:
• Transfer data from source to destination.
• MOV destination, Source
• MOV R1,R3 ; copy contents from R3 to R1
• MOV R1,#15 ; load immediate value in decimal
• MOV R1,#&15 ; load immediate value in hexadecimal
• ADD:
• Add source operand1 and source operand2 and store the result in
destination.
• ADD destination, operand1, operand2
• ADD R0, R1, R2 ; R0=R1+R2
Instructions
• SUB:
• Subtract source operand2 from source operand1 and store result in destination.
• SUB destination, operand1, operand2
• SUB R0, R1, R2 ; R0=R1-R2
• MUL:
• Multiply source operand1 and source operand2 and store the result in destination.
• MUL destination, operand1, operand2
• MUL R4, R3, R2 ; R4=R3 X R2
• MLA:
• Multiply source operand1 and source operand2 and then accumulate soure operand3 and store the
result in destination.
• AND:
• Perform bitwise ANDing of source operand1 and source operand2 and store result in
destination.
• AND destination, operand1, operand2
• AND R0, R1, R2 ; R0=R1 AND R2
• ORR:
• Perform bitwise ORing of source operand1 and source operand2 and store result in
destination.
• ORR destination, operand1, operand2
• ORR R0, R1, R2 ; R0=R1 OR R2
• EOR:
• Perform bitwise Ex-ORing of source operand1 and source operand2 and store result in
destination.
• EOR destination, operand1, operand2
• EOR R0, R1, R2 ; R0=R1 Ex-OR R2