Assembly Language
Assembly is a low-level programming language used to directly translate instructions into the computer’s machine code in a more human-readable way.
Spesific Use Case
Embedded systems that have limited memory and hardware capacity
Direct hardware testing
Software optimization
Compilation Process
Preprocessing - prepare the user’s code for machine code by removing comments, expanding included macros, and performing any code maintenance prior to handing the file to the compiler.
Compiling - the process of taking the expanded file from the preprocessor and translating the program into an optimized Assembly language.
Assembling - process of taking an assembly language program and using an assembler to generate machine code.
Linking - process of filling in function calls, including additional objects, libraries, and source code from other locations into the main source code.
ARM Arithmethic Operations Opcode
ADD
adding numbers
ADD a, b, c
adding value b and c, stored in a
ADDI
adding immidiate number (constant value) rather than being fetched from registers or memory location
ADDI a, c, 10
adding 10 to a, and stored in c
SUB
substracting number
SUB a, b, c
substract value and c, stored in a
MUL
multiply number
MUL a, b, c
multiply value b and c, stored in a
Bitwise Logic Operations
AND
AND a, b, c
a = b && c
result of b AND c, stored in a
ORR
ORR a, b, c
a = b || c
result of b OR c, stored in a
EOR
EOR a, b, c
a = b ^ c
result of b XOR c, stored in c
BIC
BIC a, b, c
a = b & (!c)
the result of b AND negation of c, stored in a
Others
CMP
CMP a, b
a == b
compares value at a and b
MOV
MOV a, 1
a = 1
assign value 1 to a
Last updated