我正在使用软核Cortex-M0,keil uvision 5,vivado 14.4
我将加法器与我的手臂架构接口
首先,我使用了汇编语言,然后在vivado仿真器中进行了正确的仿真。

我的第一个汇编代码--->

Reset_Handler PROC
GLOBAL Reset_Handler
ENTRY
LDR R1,=0x59000000
LDR R0,=0x33
STR R0,[R1]`




现在,我想使用C和汇编语言,但模拟无法正常工作,无法访问加法器寄存器

第二个组装->

Reset_Handler PROC
GLOBAL Reset_Handler
ENTRY
IMPORT __main
LDR R0, =__main
BX R0
ENDP




C代码->

#define AAA 0x59000000
int main(void)
{
  *(unsigned int*)AAA=0x44;
}

最佳答案

我的汇编代码

; Vector Table Mapped to Address 0 at Reset

                    PRESERVE8
                    THUMB

                    AREA    RESET, DATA, READONLY
                    EXPORT  __Vectors


__向量DCD 0x0000FFFC
                        DCD重置处理程序
                        DCD 0
                        DCD 0
                        DCD 0
                        DCD 0
                        DCD 0
                        DCD 0
                        DCD 0
                        DCD 0
                        DCD 0
                        DCD 0
                        DCD 0
                        DCD 0
                        DCD 0
                        DCD 0

                    ; External Interrupts

                    DCD     0
                    DCD     0
                    DCD     0
                    DCD     0
                    DCD     0
                    DCD     0
                    DCD     0
                    DCD     0
                    DCD     0
                    DCD     0
                    DCD     0
                    DCD     0
                    DCD     0
                    DCD     0
                    DCD     0
                    DCD     0

            AREA |.text|, CODE, READONLY


;重置处理程序
Reset_Handler PROC
                全局Reset_Handler
                条目
                导入__main
                LDR R0,= __ main
                 BX R0

            ENDP
            ALIGN       4
            END

10-08 12:32