0% found this document useful (0 votes)
7 views1 page

Assembly Language Instruction Set

The document outlines the assembly language instruction set, detailing data transfer, logical, arithmetic, and control operations. It provides examples of each instruction type, explaining their functions and how they manipulate data in registers and memory. Additionally, it includes logical shift operations and examples of selection and iteration control structures.

Uploaded by

KM Hedar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views1 page

Assembly Language Instruction Set

The document outlines the assembly language instruction set, detailing data transfer, logical, arithmetic, and control operations. It provides examples of each instruction type, explaining their functions and how they manipulate data in registers and memory. Additionally, it includes logical shift operations and examples of selection and iteration control structures.

Uploaded by

KM Hedar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Assembly Language Instruction Set

Data transfer operations Logical operations


Instruction Description Example Example description Instruction Description Example Example description
LDR R, M Value in main memory LDR R1, 100 Load value at memory location 100 into register AND Ra, Rb, <operand> Bitwise AND operation AND R1, R1, #8 Bitwise AND operation between
address M loaded into R1 between value in value in R1 and 8 (00001000 )
10 2
register R register Rb and and store result in R1
STR R, M Value in register R stored in STR R1, 100 Store value in R1 into main memory location 100 <operand> and
main memory address store result in Ra
location M ORR Ra, Rb, <operand> Bitwise OR operation ORR R1, R1, #8 Bitwise OR operation between
MOV R, #V Copy data value #V register R MOV R1, #12 Copy the number 12 into register R1. between value in value in R1 and 8 (00001000 )
10 2
The # refers to immediate addressing ie the value is the data. register Rb and and store result in R1
<operand> and
store result in Ra
Arithmetic operations EOR Ra, Rb, <operand> Bitwise XOR operation EOR R1, R1, #8 Bitwise XOR operation between
Instruction Description Example Example description between value in value in R1 and 8 (00001000 )
10 2
register Rb and and store result in R1
ADD Ra, Rb, <operand> Add values in ADD R1, R1, #102 Add 102 to the value in
<operand> and
registers in Rb and register R1 and store the
ADD R1, R1, R2 store result in Ra
operand and load value in register R1
MVN R, <operand> Bitwise NOT operation MVN R1, #8 Bitwise NOT operation on 8
result in register Ra Add the value stored in R2 and 10
on <operand> and (00001000 ) and store result in
add to the value stored in R1
store in R 2
and output the result. R1 (11110111 )
2

SUB Ra, Rb, <operand> Subtract value in SUB R2, R1, #102 Subtract 102 from the value in
perand from register SUB R2, R1, R3 register R1 and store the
Rb load result in result in register R2 Control
register Ra subtract the value stored in R3 Instruction Description
from the value in R1 and store CMP R, <operand> Compare value in register R with <operand> value
the result in R2 B <label> Branch to position <label>
The <operand> can be a register or a data value. The register is indicated by R and a data value is preceded by a #. BEQ <label> Branch to position <label> if result of last comparison between R and <operand>
was equal
BNE <label> Branch to position <label> if result of last comparison was not equal between R and
<operand>
Logical shift operations BGT <label> Branch to position <label> if R was greater than <operand> in the last comparison
Instruction Description Example Example description comparison
LSL Ra, Rb, <operand> Logical shift left value LSL R1, R1, #2 Logical shift left value in R1 by BLT <label> Branch to position <label> if R was less than <operand> in the last comparison
in register Ra by 2 and store in register R1 HALT Terminate execution of program
<operand> value LSL R1, R1, R2 Logical shift left value in R1
and store in register by value in R2 and store in
Ra register R1
Examples
LSR Ra, Rb, <operand> LSR R1, R1, #2 Selection (if …) Selection (if .. else ..) Iteration
Logical shift left value Logical shift right value in R1 by
in register Ra by 2 and store in register R1
LSR R1, R1, R2 MOV R1, #10 MOV R1, #10 MOV R0, #0
<operand> value Logical shift right value in R1 by CMP R1, #10 CMP R1, #10 loop:
and store in register value in R2 and store in BNE end BEQ IF ADD R0 R0 #1
Ra register R1 MOV R2, #20 MOV R2, #20 CMP R0 #4
end: B ELSE BNE loop
Eg 310 << 210; 310 = 0112; 011002 = 1210 HALT IF: HALT
MOV R2, #30
ELSE:
HALT

You might also like