arm assembly language

第二章
1. arm word 为32,intel word为16
2. Real view tools(RVMDK)
3. arm七种处理器模式,用户程序一般在User态,这个是基础,根本。
4. 一般工作在super和user模式,FIQ和IRQ是中断模式,MMU缺页用abort模式
5. arm7,37个寄存器,也不是很多呀
6.R13为堆栈指针,每种模式都有单独的堆栈。R14用来存放返回地址。CPSR是当前状态,SPSR是跳转前的CPSR值。
2013.7.7
7. 汇编语言中的sp指针与C中的堆栈如何对应起来?汇编中的栈指的是函数调用时,需要压入的参数!而C中队和栈与这个不一样!
8. Vector table 就是一组功能与地址对应的表,例如中断了,去调用相应地址处的代码!那中断控制器呢?
9. Cortex-M只有两种模式用户模式+特权模式(特权模式只有一种), 与以前设计完全不一样!
10. 当执行了undefined instruction时,进入特权模式,PC应该是指到vector table中所指的地址0x00000004吧?
11. thumb1是16bit指令,thumb2由16bit和32bit指令组成。
      Some cores, such as the Cortex-M3 and M4, only execute Thumb-2 instructions—there are no ARM instructions at all.
12. 
    汇编语法  { symbol } { instruction | directive | pseudo-instruction } {; comment }
  Instruction mnemonics, pseudo-instructions, directives, and symbolic register names 等大写就一直大写,小写就一直小写
    空白行可以随便加
  symbol前不能加空格!
     In assembly source files, literals can be expressed as:
     • decimal numbers, for example
123
     • hexadecimal numbers, for example 0x7B
     • numbers in any base from 2 to 9 , for example 5_204 is a number in base 5
     • floating point numbers, for example 123.4
     • boolean values {TRUE} or {FALSE}
     • single character values enclosed by single quotes, for example ‘w’
     • strings enclosed in double quotes, for example "This is a string
13. 每个汇编程序由多个code sections和多个data section组成。
      AREA关键字代表一个段的开始,名字不要有特殊字符!

14. 每个ARM汇编都包含以下字段

     The constituent parts of this example are:
     • ELF sections (defined by the
AREA directive)
     • application entry (defined by the
ENTRY directive)
     • application execution
     • application termination
     • program end (defined by the
END directive).
     

    AREA ARMex, CODE, READONLY
        ; Name this block of code ARMex
    ENTRY ; Mark first instruction to execute
start
    MOV r0, #10 ; Set up parameters
    MOV r1, #3
    ADD r0, r0, r1 ; r0 = r0 + r1
stop
    MOV r0, #0x18 ; angel_SWIreason_ReportException
    LDR r1, =0x20026 ; ADP_Stopped_ApplicationExit
    SVC #0x123456 ; ARM semihosting (formerly SWI)
    END ; Mark end of file

第4章 汇编语言终于入门了,多少年了?以前汇编实在不入门,从本科时的微机原理开始,一直就没有汇编入门,后来看的书多了,才慢慢明白C与汇编的关系,其实汇编要掌握的和C差不多,基本操作:赋值,+-等,循环,分支等搞明白就可以写程序了,当然一些汇编特殊的东西如section等东西还是不一样的!
真高兴,现在终于入门了!2017.7.16
指令和数据,是分开的, 咋分开的? 啥是数据,啥是指令?ldr/str是数据,而别的都是指令?(数据就是数据,有的指令需要取数据时就访问数据总线!)
汇编中有数据段和代码段,cpu中有D-cahce和I-Cache, 能对应吗? 就是对应的!
2017.7.17
keil中汇编器和链接器分别是armasm and armlink 2017.7.22
ARM的汇编语言为啥最后改为了Unified Assembler Language(UAL),因为原来的ARM与Thumb很不一样,现在统一在UAL下面了!
汇编中常用字段:

AREA .sect Defines a block of code or data
RN .asg Can be used to associate a register with a name
EQU .equ Equates a symbol to a numeric constant
ENTRY Declares an entry point to your program
DCB, DCW, DCD .byte, .half, .word Allocates memory and specifies initial runtime contents
ALIGN .align Aligns data or code to a particular memory boundary
SPACE .space Reserves a zeroed block of memory of a particular size
LTORG Assigns the starting point of a literal pool
END .end Designates the end of a source file

2017.7.22

第5章 ldr signed 和unsigned 处理是不一样的! 这有点奇怪!
          !代表更改寄存器的值
          单bit可访问内存BIT-BANDED MEMOR
第7章

       ADDS等算数运算指令的S代表update flags;
       cpsr中的N代表两个数运算结果为负数; overflow时,用V标志表示;Z代表运算结果为0;BNE xx(判断Z标志是否为0,如果不为0,则跳转到xx)
       汇编中没有signed 和unsigned 的区别,都是补码表示的数!32位表示的范围为-2^31到(2^31-1)
       C标志代表运算值超过2^32, 这怎么算出来的?与上面那个overflow搞糊涂了, 书上有两个64位数做运算的例子用到了C标志位,我不太明白!
       MRS/MSR访问PSR
       Bool运算为AND,ORR,EOR,BIC
       移位运算 LSL,LSR,ASR,ROR,RRX
       有符号和无符号乘法!这个怎么分为无符号和有符号运算?
       处理器中除法很复杂,且用的很少,所有m4才有,arm7tdmi中没有
      2017.7.30
第8章 没啥 2017.7.30
第12章 talbes and List
第18章 C与汇编
        书差不多看完了,但是仿佛当初的那些目标没有实现,也仿佛失去了看书的意义,必须要在工作中实际用到才能印象深刻!
2017.8.20

     

       



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
2) Who uses ARM? Currently ARM CPU is licensed and produced by more than 100 companies and is the dominant CPU chip in both cell phones and tablets. Given its RISC architecture and powerful 32-bit instructions set, it can be used for both 8-bit and 32-bit embedded products. The ARM corp. has already defined the 64-bit instruction extension and for that reason many Laptop and Server manufactures are planning to introduce ARM-based Laptop and Servers. 3) Who will use our textbook? The primary audience of our textbook on ARM (ARM Assembly Language Programming & Architecture by Mazidi & Naimi) is undergraduate engineering students in Electrical and Computer Engineering departments. It can also be used by practicing engineers who need to move away from 8- and 16-bit legacy chips such as the 8051, AVR, PIC and HCS08/12 family of microcontrollers to ARM. Designers of the x86-based systems wanting to design ARM-based products can also benefit from this textbook. Table of Contents Chapter 1: The History of ARM and Microcontrollers Chapter 2: ARM Architecture and Assembly Language Programming Chapter 3: Arithmetic and Logic Instructions and Programs Chapter 4: Branch, Call, and Looping in ARM Chapter 5: Signed Numbers and IEEE 754 Floating Point Chapter 6: ARM Memory Map, Memory Access, and Stack Chapter 7: ARM Pipeline and CPU Evolution Appendix A: ARM Cortex-M3 Instruction Description Appendix B: ARM Assembler Directives Appendix C: Macros Appendix D: Flowcharts and Pseudocode Appendix E: Passing Arguments into Functions Appendix F: ASCII Codes

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值