Exemple of basic program in assembler

First example of function write in ARM:

-addition between two number:

.global addition_arm                 @make the function readable by C program .type addition_arm, %function        @Optional line: define addtion_arm like a function

addition_arm:                        @label add     r0, r0, r1                    mov      pc, lr

-substraction between two number:

.global substract_arm                 @make the function readable by C program .type substract_arm, %function        @Optional line: define substract_arm like a function

substract_arm:                        @label sub     r0, r0, r1                    mov      pc, lr

-multiplication

.global arm_mult .type arm_mult, %function

arm_mult: mul    r0, r1, r0         bx      lr                    @Or    mov     pc, lr

-lenght string counter in arm

.global arm_strlen .type  arm_strlen, %function

arm_strlen:

Tutorial is available to the blog: Pulsar