Browse By Tags

  • Replacing branch-instruction with address assignment to PC

    Hi,

    in a thumb-assembly file (my toolchain is gcc 4.8), I want to replace a branch with address assignment to the program-counter.
    So instead of:

    b   lbl

    I want to have something like:

    pc = address(lbl)


    This solution works. Here, I use the following code to…

  • how to set pendsv bit in ARM7

    i want to a very easy way of setting this bit

  • How to import C variable in an assembly code in a .s file

    I'm new of arm processor and I'd like to import a variable in a .s file the variable is definited in a c file:

    #define INIT_VAR 1

    .......

    extern uint32_t save_mem = INIT_VAR;

    or better I need to write inside a memory address of that variable.

  • M0+ Stack Pointer (PSP/MSP) Clarification

    Background

     I'm working part-time on a Cortex M0+ based SoC converting a very processor-intensive section of C++ code (inner-loop executed 10s of 1000s of times a second & compiles to over 400 instructions using GNU O3) and after almost 3 months of work…

  • Count the number of trailing zeros without clz?

    I am trying to count the number of trailing zeros in floating points without using the clz command. what would be the easiest way to rewrite this code?


    ctz
            RSB      r1,r0,#0
            CMP…

  • Store the value of PC to Memory address

    I want to store the value of Program Counter(pc) to a memory location.

    I did this, 

        LDR R1, =[0x20000000]

        STR R15, [R1,#0]

    I got an error saying, "Error: r15(pc) not allowed here -- `str R15,[R1,#0]'.

    How should I get over this error?

  • NVIC and ARM asm

    Cannot configure interupts of TIM6 on stm32f103 board

    Does my NVIC configuration wrong?

    Code:

    @ stm32f103 timer & interrupt test by laper_s (from 2019-02-02)
    
    .thumb
    .cpu cortex-m3
    .syntax unified
    
    .word   0x20005000
    .word   start + 1
    
    b   start…

  • ARM/Thumb-2


    Hello everyone,

    First of all, I'm new when it comes to ARM assembly. I actually have some pieces of code written for ARM instruction set, but my target is a Cortex-M4 architecture using Thumb-2 instruction set. Do I have to re-write the whole code, change…