thumb

Compiling to ARM I get “Error: attempt to use an ARM instruction on a Thumb-only processor”

∥☆過路亽.° 提交于 2019-12-24 09:49:12
问题 The following command /usr/bin/arm-linux-gnueabihf-gcc -O3 -DNDEBUG -march=armv7-a -mfloat-abi=hard -fPIC -fno-builtin -fno-exceptions -fomit-frame-pointer -funwind-tables -fno-stack-protector -fvisibility=hidden -fvisibility-inlines-hidden -fno-function-sections -fno-lto -g -Wno-variadic-macros -Wno-non-virtual-dtor -o testAsm.S.o -c testAsm.S On the following assembly file testAsm.S : .syntax unified .arch armv7 .fpu vfpv3 .code 32 .global _functionPointer .p2align 2 .global _asmFunction

Using thumb to move transformed control produces weird behavior

谁都会走 提交于 2019-12-23 12:08:27
问题 I've encountered a weird behavior when trying to use a thumb to move a control around on a canvas. When I add a control to a canvas and use Thumb DragDelta event to move it around everything looks good. But when I apply a rotate transform to the control dragging it around is bizarre. The control starts to circle around the cursor, and the bigger the angle the bigger the circle. Does anyone know how to make thumb work with a transformed element? I've spent all day trying to figure it out and

How to generate the machine code of Thumb instructions?

空扰寡人 提交于 2019-12-22 18:27:25
问题 I searched Google for generating machine code of ARM instructions, such as this one Converting very simple ARM instructions to binary/hex The answer referenced ARM7TDMI-S Data Sheet (ARM DDI 0084D). The diagram of data processing instructions is good enough. Unfortunately, it's for ARM instructions, not for Thumb/Thumb-2 instructions. Take the B instruction as an example. ARM Architecture Reference Manual - ARMv7-A and ARMv7-R edition section A8.8.18, Encoding T4: For the assembly code: B

Decoding BLX instruction on ARM/Thumb (IOS)

你。 提交于 2019-12-21 20:37:12
问题 I've read through much of the ARM documentation but still having trouble decoding a BLX instruction. Here are two examples: __text:0000347C 02 F0 B2 ED BLX _objc_msgSend __text:0000469C 01 F0 A2 EC BLX _objc_msgSend Both of these are supposed to go to the same place, virtual address 0x5FE4 as seen here: __symbolstub1:00005FE4 38 F0 9F E5 LDR PC, =__imp__objc_msgSend However, I can't figure out what calculation is used to get from the above two addresses (0x347C and 0x469C) using their

What do the abbriviations (Rn, Rd, …) in the instruction set of ARM mean?

南楼画角 提交于 2019-12-21 05:46:48
问题 recently i checked the Instruction Set for an ARM Cortex-M3 processor. For example: ADD <Rd>, <Rn>, <Rm> What do those abbriviations mean exactly? I guess they mean different kinds of addresses, like directely addressed, relatively addressed or so. But what exactly? Thanks! 回答1: Operands of the form <Rx> refer to general-purpose registers, i.e. r0-r15 (or accepted aliases like sp , pc , etc.). I'm not sure if it's ever called out specifically anywhere but there is a general pattern of "d"

What's the meaning of W suffix for thumb-2 instruction?

我是研究僧i 提交于 2019-12-20 02:30:38
问题 There is a w suffix for thumb-2 instruction as below, how does it change the semantic of the instruction without it? The search result is very noisy and I didn't get the answer. addw r0, r1, #0 回答1: I see ADDW in Cortex-M3 TRM Table 2-5 Data operations with large immediate ADDW and SUBW have a 12-bit immediate. This means they can replace many from memory literal loads. It is also mentioned in Quick Reference add wide T2 ADD Rd, Rn, #<imm12> Looks like the assembler would recognize the

Mixing ARM and THUMB instructions

落花浮王杯 提交于 2019-12-19 09:24:21
问题 I am trying to mix ARM and THUMB instructions in my assembly code. For example, in the following code I try to use both modes: .thumb @ .code 16 .section __TEXT,__text .globl mySymbol1 mySymbol1: .... .arm @ .code 32 .section __TEXT,__text .globl mySymbol2 mySymbol2: ... Now, as per my understanding when I compile this code into a library and run it through nm, mysymbol1 should show up as arm and mysymbol2 should show up as thumb, i.e, 0000xxxx (__TEXT,__text) external mySymbol1 0000yyyy (_

Is ARM (not Thumb) supported on WinPhone8 at all?

僤鯓⒐⒋嵵緔 提交于 2019-12-18 09:38:22
问题 I'm facing a weird issue, somewhat similar to this. I have a Windows Phone 8 native DLL project, mostly C++ but with an ARM assembly source in it. The source is in ARM mode (i. e. not Thumb). C++ is compiled to Thumb. The app crashes when C++ tries to call into an assembly routine. The call command in the disassembly is BLX with an immediate offset - it's supposed to switch mode back to ARM, unconditionally, but somehow it doesn't. I have the details of the exception. The exception code is

GCC --gc-sections and finding symbol dependencies

有些话、适合烂在心里 提交于 2019-12-18 03:45:37
问题 I'm trying to reduce the size of my elf executable. I'm compiling with -ffunction-sections -fdata-sections and linking with -gc-sections , but it appears some of the symbols that I believe are unused are not being discarded. Is there some command in the GNU toolchain I can run to find out which symbols are being used and where? Toolchain: GNU arm-none-eabi Platform: Cortex-M4 Language: C++ Here are my typical build flags: Compilation: arm-none-eabi-g++.exe -Wall -O3 -mthumb -std=c++11 -mcpu

Changing the address value of a function pointer [closed]

落爺英雄遲暮 提交于 2019-12-13 08:30:02
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 4 years ago . I have the following code in C: int addInt(int n, int m) { return n + m; } int (*functionPtr)(int, int); functionPtr = &addInt; functionPtr is a function pointer and it points to the specific address of the function addInt . I want to change 1 bit of its value, but I can't figure it out how. Let's