📄 2410test_005.c
字号:
#include<stdlib.h>
#include<string.h>
#include<stdio.h>
#include<rt_misc.h>
#include "def.h"
#include "option.h"
#include "2410addr.h"
#include "2410lib.h"
#include "2410slib.h"
//#pragma import(__use_no_semihosting_swi) //禁止使用semihosting支持的函数
extern unsigned int bottom_of_heap;
__value_in_regs struct __initial_stackheap __user_initial_stackheap(
unsigned R0, unsigned SP, unsigned R2, unsigned SL)
{
struct __initial_stackheap config;
config.heap_base = (unsigned int)&bottom_of_heap; // defined in heap.s
// placed by scatterfile
config.stack_base = SP; // inherit SP from the execution environment
return config;
}
void main()
{
int i;
//__rt_lib_init(0,0);
Uart_Printf("hello world!\n");
__asm
{
MOV R0,#'u'
TXBusy0:
MOV R1,#0x50000010
LDR R2,[R1]
AND R2,R2,#0x4
TST R2,#4
BEQ TXBusy0
MOV R1,#0x50000020
STR R0,[R1]
//ldr r1,
//ldr r2, [r1]
//and r2, r2, #(1 << 2)
//tst r2, #(1 << 2)
//beq TXBusy
//ldr r1, =UTXH0 ;0x500000020
//str r0, [r1]
}
//printf("hello!\n");
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -