我本来是想实验一下里面的宏展开的情况,可是ads里面编译不过,郁闷? ;汇编指令实验 WTCON EQU 0x4a000008 ;Interrupt mask control INTMSK EQU 0x4a000008 ;Interrupt mask control SVCMODE EQU 0x13 ABORTMODE EQU 0x17 UNDEFMODE EQU 0x1B MODEMASK EQU 0x1F I_BIT EQU 0x80 F_BIT EQU 0x40 T_BIT EQU 0x20 NOINT EQU 0xc0
AREA Init,CODE,READONLY ;该伪指令定义了一个代码段段名为Init属性只读 ENTRY ;程序的入口点标识 ResetEntry b SYS_RST_HANDLER b HandlerUndef ;handler for Undefined mode b HandlerSWI ;handler for SWI interrupt MACRO $HandlerLabel HANDLER $HandleLabel $HandlerLabel sub sp,sp,#4 ;decrement sp(to store jump address) stmfd sp!,{r0} ;PUSH the work register to stack ldr r0,=$HandleLabel;load the address of HandleXXX to r0 ldr r0,[r0] ;load the contents str r0,[sp,#4] ;store the contents(ISR)HandleXXX ldmfd sp!,{r0,pc} ;POP the work register and pc MEND
SYS_RST_HANDLER mrs r0, cpsr ;enter svc mode and disable irq,fiq bic r0, r0, #MODEMASK orr r0, r0, #(SVCMODE :OR: I_BIT :OR: F_BIT) msr cpsr_c, r0 LTORG ;声明一个数据缓冲池的开始 HandlerUndef HANDLER HandleUndef HandlerSWI HANDLER HandleSWI
^(0x800) HandleUndef #4 HandleSWI # 4 END ;程序结束符 请教上面的有什么问题? |