Questions tagged [thumb]
A reduced instruction set for ARM processors (based on a 16-bit encoding, instead of 32 bits in standard ARM mode), originally intended for embedded systems with a small amount of RAM. Also for question with the later Thumb2 mixed 16 and 32 bit instruction modes. Consider the tags 'slider' and 'thumbnails' for other meanings of 'thumb'.
thumb
258
questions
2
votes
0
answers
70
views
Ways to perform bitwise operations with symbols inside Assembly constants?
I am working on learning to write ARM firmware and am trying to create a Vector Table. I am using the GNU toolchain.
I have assembly code like the following:
MY_VECTOR_TABLE:
.long 0 ...
0
votes
0
answers
32
views
How TBB and DCB work in branching the flow?
I am new to ARM Cortex and facing difficulty to understand how TBB branches.
Code snippet attached:
TBB [PC,R1]
BrTable1
DCB ((P0 - BrTable1)/2)
DCB ((P1 - BrTable1)/2)
Now, my understanding is as ...
1
vote
1
answer
98
views
Mysterious ARM Opcode
In decompiling a hex file for a Texas Instruments ARM (Thumb 2) Cortex-M4f processor (CC2652RB), I have come across an opcode that I can't figure out.
What does "90 FF FF 00" do (maybe the ...
-1
votes
1
answer
183
views
How is this ARM (Thumb) LDR Instruction being calculated?
The code is running on a Cortex M0+. I am trying to calculate the addresses of LDR PC-related loads and am finding the addresses are not always consistent.
This LDR PC-related load does not follow ...
0
votes
0
answers
136
views
Which instruction encoding is supported by a ARM processor, particularly a Cortex M0, STM32F0 one for example
Confused about instruction encoding supported by my core (ie. T1, T2, etc)
Having the STM32F0 series Cortex-M0 programming manual, I found that
https://www.st.com/resource/en/programming_manual/pm0215-...
1
vote
1
answer
72
views
Why the Link register in FIQ mode will be instruction address plus 4 in thumb mode instead of instruction address plus 2?
I am going through the Cortex R5 technical reference manual (version: r1p2). And according to the manual the
LR_SVC will have IA + 4 in ARM mode and IA+2 in Thumb mode, which I can understand since ...
0
votes
1
answer
59
views
gcc inline asm / constraints / "r" relates to "l" like "g" to ...?
I'm trying to compile this for an ARM Cortex-M0+ (STM32G030) with arm-none-eabi-gcc:
asm("ldrb %0, [%1, %2]\n" : "=l" (v) : "l" (R.a+(o&~31)) , "g" (o&...
2
votes
1
answer
96
views
Loading a the address of a pointer into a register inline thumb assembly
I'm trying to read in the address from my c-pointer to a register using inline thumb assembly.
here's a reproducible:
static uint32_t volatile * volatile CurrentTaskStackPtr;
CurrentTaskStackPtr = (...
-1
votes
1
answer
32
views
Inline version of function fails
I've been writing code to interface with a hardware register on SAMV71Q20B. The function in question is:
// Reads current MII link busy status
u32 mii_is_busy(void)
{
return !GMAC->GMAC_NSR....
0
votes
2
answers
222
views
How does the arm-none-eabi-as choose section alignment?
I am playing with arm-none-eabi-as trying to understand how it aligns sections. I have the following source:
; source.s
.text
.byte 0xff
.byte 0xff
.byte 0xff
I am inspecting the resulting object ...
1
vote
1
answer
221
views
How to Properly Handle the LR Register in an Interrupt Service Routine for Thumb Mode on ARM? [closed]
When ARM chips(cortex-A7)are compiled in thumb mode, the program may run abnormally, and the exception point has been located. The problematic C code is:
while (locked && result)
{
// ...
0
votes
1
answer
84
views
Compare signed integers and return either 0 or -1 in Thumb2 assembly
In thumb2 assembly, when r0 and r1 have signed integers, I like to have r1=-1 (i.e. 0xffffffff) if r0 < r1, otherwise r1=0.
I can simply code:
4288 cmp r0, r1
bfb4 ite ...
1
vote
2
answers
894
views
Assembler Thumb Mode
im new in coding with Assembler and I have a question concerning the .thumb and .Syntax unified directive. I know there is a instruction set "Thumb", which contains 16-Bit commands, the ...
0
votes
2
answers
105
views
STM32 sometimes hardfault on reboot (thumb instruction issue?)
STM32L496 micro is hard faulting when power is cycled, but only on some builds of firmware, others are ok. I've been able to track it down to a specific path in the assembly, what looks like is ...
2
votes
1
answer
357
views
Can I force a Cortex-M4 ARM processor to use conditional instructions outside an IT block?
I need to profile different machine instruction for a project, so I'm running some instructions in a loop of ~200 instructions per time (using .rept in an __asm__ directive). The processor I'm using ...