C 汇编混合编程
As is Known to us,the function Main is the entry point of all programs.Therefore, we are usually neglecting all that we don't do,which makes us not understanding it more clearly.Now there is a sample arm program which will provide something that opration system usually do.
asm:
IMPORT main
area test,CODE,READONLY
ENTRY
bl start
start
bl main
C:
#define rGPBCON (*(volatile unsigned *)0x56000010) //Port B control
#define rGPBDAT (*(volatile unsigned *)0x56000014) //Port B data
#define rGPBUP (*(volatile unsigned *)0x56000018) //Pull-up control B
int main(int argc, char *argv[])
{
unsigned int temp = 0x0e;
rGPBCON = 0x00555555;
rGPBUP = 0xffff;
rGPBDAT = 0XE1F;
return 0;
}
The code very sample,but it is very useful.
相关文档:
曾经碰到过让你迷惑不解、类似于int * (* (*fp1) (int) )
[10];这样的变量声明吗?本文将由易到难,一步一步教会你如何理解这种复杂的C/C++声明:我们
将从每天都能碰到的较简单的声明入手,然后逐步加入const修饰
符和typedef,还有函数指针,最后介绍一个能够让你准确地理解任何C/C++ ......
前言:这一章我们讨论一下Linux下的信号处理函数.
Linux下的信号处理函数:
1.信号的产生
2.信号的处理
3.其它信号函数
--------------------------------------------------------------------------------
一个实例
1。信号的产生 ......
/* find files from wildcards, for MicroSoft C v4.0 */
/* ------------------------------------------------------------ */
/* copyright 1986: */
/* Nourse Gregg & Browne, Inc. */
/* 1 Horizon Road. #612 ......