打印

哪里有更详细的cortex-m3汇编手册,我只找到下面的:

[复制链接]
7179|4
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
pheavecn|  楼主 | 2008-2-20 12:06 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
2.6. Instruction set
The processor does not support ARM instructions.

The processor supports all ARMv6 Thumb instructions except those listed in Table 2.4. 

Table 2.4. Nonsupported Thumb instructions

Instruction  Action if executed  
BLX(1) Branch with link and exchange BLX(1) always faults. 
SETEND Set endianness SETEND always faults. A configuration pin selects Cortex-M3 endianness. 

The processor supports the Thumb-2 instructions listed in Table 2.5.

Table 2.5. Supported Thumb-2 instructions

Instruction type Size Instructions 
Data operations 16 ADC, ADD, AND, ASR, BIC, CMN, CMP, CPY, EOR, LSL, LSR, MOV, MUL, MVN, NEG, ORR, ROR, SBC, SUB, TST, REV, REVH, REVSH, SXTB, SXTH, UXTB, and UXTH. 
Branches 16 B<cond>, B, BL, BX, and BLX. Note, no BLX with immediate. 
Load-store single 16 LDR, LDRB, LDRH, LDRSB, LDRSH, STR, STRB, STRH. 
Load-store multiple 16 LDMIA, POP, PUSH, and STMIA. 
Exception generating 16 BKPT stops in debug if debug enabled, fault if debug disabled. SVC faults to the SVCall handler. 
Data operations with immediate 32 ADC{S}. ADD{S}, CMN, RSB{S}, SBC{S}, SUB{S}, CMP, AND{S}, TST, BIC{S}, EOR{S}, TEQ, ORR{S}, MOV{S}, ORN{S}, and MVN{S}. 
Data operations with large immediate 32 MOVW, MOVT, ADDW, and SUBW.

MOVW and MOVT have a 16-bit immediate. This means they can replace literal loads from memory.

ADDW and SUBW have a 12-bit immediate. This means they can replace many from memory literal loads.
 
Bit-field operations 32 BFI, BFC, UBFX, and SBFX. These are bitwise operations enabling control of position and size in bits. These both support C/C++ bit fields, in structs, in addition to many compare and some AND/OR assignment expressions. 
Data operations with three registers 32 ADC{S}. ADD{S}, CMN, RSB{S}, SBC{S}, SUB{S}, CMP, AND{S}, TST, BIC{S}, EOR{S}, TEQ, ORR{S}, MOV{S}, ORN{S}, and MVN{S}. No PKxxx instructions. 
Shift operations 32 ASR{S}, LSL{S}, LSR{S}, RRX {S}, and ROR {S}. 
Miscellaneous 32 REV, REVH, REVSH, RBIT, CLZ, SXTB, SXTH, UXTB, and UXTH.

Extension instructions same as corresponding v6 16-bit instructions.
 
Table branch 32 TBB and TBH table branches for switch/case use. These are LDR with shifts and then branch. 
Multiply 32 MUL, MLA, and MLS. 
Multiply with 64-bit result 32 UMULL, SMULL, UMLAL, and SMLAL. 
Load-store addressing 32 Supports Format PC+/-imm12, Rbase+imm12, Rbase+/-imm8, and adjusted register including shifts. 

T variants used when in Privilege mode.
 
Load-store single 32 LDR, LDRB, LDRSB, LDRH, LDRSH, STR, STRB, STRH, and T variants. PLD and PLI are both hints and so act as a NOP. 
Load-store multiple 32 STM, LDM, LDRD, and STRD. 
Load-store exclusive 32 LDREX, STREX, LDREXB, LDREXH, STREXB, STREXH, CLREX. 

Fault if no local monitor. This is IMP DEF. 

LDREXD and STREXD are not included in this profile.
 
Branches  32 B, BL, and B<cond>. No BLX (1) because always changes state. No BXJ. 
System 32 MSR(2) and MRS(2) replace MSR/MRS but also do more. These access the other stacks and also the status registers.

CPSIE/CPSID 32-bit forms are not supported.

No RFE or SRS.
 
System 16 CPSIE and CPSID are quick versions of MSR(2) instructions and use the standard Thumb-2 encodings, but only permit use of i and f and not a. 
Extended32 32 NOP (all forms), Coprocessor (MCR, MCR2, MCRR, MRC, MRC2, and MRRC), and YIELD (hinted NOP). Note, no MRS(1), MSR(1), or SUBS (PC return link). 
Combined branch 16 CBZ and CBNZ (Compare and Branch if register is Zero or Non-Zero). 
Extended 16 IT and NOP. This includes YIELD. 
Divide 32 SDIV and UDIV. 32/32 divides both signed and unsigned with 32-bit quotient result, no remainder, it can be derived by subtraction. Early out is permitted. 
Sleep 16, 32 WFI, WFE, and SEV are in the class of hinted NOP instructions that control sleep behavior. 
Barriers 32 ISB, DSB, and DMB are barrier instructions that ensure certain actions have taken place before the next instruction is executed. 
Saturation 32 SSAT and USAT perform saturation on a register. They perform the following:

Normalize the value using shift test for overflow from a selected bit position, the Q value.

Set the xPSR Q bit if so, saturate the value if overflow detected.

Saturation refers to the largest unsigned value or the largest/smallest signed value for the size selected
 
沙发
grant_jx| | 2008-2-20 13:43 | 只看该作者

楼上的没找对地方Thumb 2 的汇编指令集应该是

请看下面的这段话:

1.2.1. The Thumb-2 instruction set
Thumb-2 is a superset of the Thumb instruction set. Thumb-2 introduces 32-bit instructions that are intermixed with the 16-bit instructions. The Thumb-2 instruction set covers almost all the functionality of the ARM instruction set. Thumb-2 is backwards compatible with the ARMv6 Thumb instruction set. Any code that you have compiled to run on the ARMv6 thumb instruction set runs on the Thumb-2 instruction set.

The most important difference between the Thumb-2 instruction set and the ARM instruction set is that most Thumb-2 instructions are unconditional, where as almost all ARM instructions can be conditional. However, Thumb-2 introduces a new conditional execution instruction, IT, that is a logical if-then-else function.

Thumb-2 has the performance close to or better than that of the ARM instruction set and has the code density of the original Thumb ISA.

In addition to the new 32-bit Thumb instructions, there are several new 16-bit Thumb instructions. Several new 32-bit ARM instructions are introduced at the same time.

The main enhancements are:

32-bit instructions added to the Thumb instruction set to:

provide support for exception handling in Thumb state 

provide access to coprocessors

include DSP and media instructions

improve performance in cases where a single 16-bit instruction restricts functions available to the compiler.

Addition of a 16-bit IT instruction that enables 1 - 4 following Thumb instructions to be conditional.

Addition of 16-bit Compare and Branch on Zero (CBZ) and Compare and Branch on Non Zero (CBNZ) instructions to improve code size by replacing two-instruction sequence with a single instruction.

The 32-bit ARM Thumb-2 instructions are added in the space occupied by the Thumb BL and BLX instructions. The 32-bit ARM Thumb-2 instruction format is shown in Figure 1.1.

Figure 1.1. 32-bit ARM Thumb-2 instruction format 

The instruction length and functionality is determined by first halfword (hw1). If the instruction is decoded as being 32-bits long, the second halfword (hw2) of the instruction is fetched from the instruction address plus two. 

For details on Thumb-2 operations and assembler, see the ARM Architecture Reference Manual.



出自:http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0338g/ch01s02s01.html



ARM还有这么一个文档,很容易找到:
ARM and Thumb-2 Instruction Set Quick Reference Card





使用特权

评论回复
板凳
pheavecn|  楼主 | 2008-2-21 10:09 | 只看该作者

ARM and Thumb-2 Instruction Set Quick Reference Card

这东西我看过了。
仍然不是完整的cortex-M3汇编手册。
为什么不像其他MCU一样整理一个汇编指令手册?
汇编指令   机器码   功能说明  执行周期数
等等

使用特权

评论回复
地板
zkr| | 2008-2-22 15:08 | 只看该作者

貌似是有的

到ARM网站上找找,Cortex M3的介绍那里。
印象中有一个需要注册然后才能下载的ARMv7文档,里边有。

使用特权

评论回复
5
ijk| | 2008-2-23 12:37 | 只看该作者

ARM网站上有的

ARM网站上有的,我下载过

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

88

主题

918

帖子

0

粉丝